Esempio n. 1
0
        private static PlaybackEvent GetPlaybackEventWithNoteMetadata(TimedEvent timedEvent, TempoMap tempoMap, NotePlaybackEventMetadata noteMetadata)
        {
            var playbackEvent = new PlaybackEvent(timedEvent.Event, timedEvent.TimeAs <MetricTimeSpan>(tempoMap), timedEvent.Time);

            playbackEvent.Metadata.Note = noteMetadata;
            return(playbackEvent);
        }
Esempio n. 2
0
        private static PlaybackEvent GetPlaybackEventWithNoteTag(Note note, TimedEvent timedEvent, TempoMap tempoMap)
        {
            var playbackEvent = new PlaybackEvent(timedEvent.Event, timedEvent.TimeAs <MetricTimeSpan>(tempoMap), timedEvent.Time);

            TimeSpan noteStartTime = note.TimeAs <MetricTimeSpan>(tempoMap);
            TimeSpan noteEndTime   = TimeConverter.ConvertTo <MetricTimeSpan>(note.Time + note.Length, tempoMap);

            playbackEvent.Metadata.Note = new NotePlaybackEventMetadata(note, timedEvent.Event is NoteOnEvent, noteStartTime, noteEndTime);

            return(playbackEvent);
        }
Esempio n. 3
0
 private bool TryPlayNoteEvent(PlaybackEvent playbackEvent, out Note note)
 {
     return(TryPlayNoteEvent(playbackEvent.Metadata.Note, playbackEvent.Event, playbackEvent.Event is NoteOnEvent, playbackEvent.Time, out note));
 }