public override void AddNote(NoteMessage note) { // All notes in a ChordOff must have the same channel. Debug.Assert(note is NoteOff && ((_notes.Count == 0) || (note.Channel == _notes[0].Channel))); NoteOff noteOff = new NoteOff(); noteOff.Channel = note.Channel; noteOff.Pitch = note.Pitch; noteOff.Velocity = 64; _notes.Add(noteOff); }
public override void AddNote(NoteMessage note) { // All notes in a ChordOn must have the same channel. Debug.Assert(note is NoteOn && ((_notes.Count == 0) || (note.Channel == _notes[0].Channel))); NoteOn newNote = new NoteOn(); newNote.Channel = note.Channel; newNote.Pitch = note.Pitch; newNote.Velocity = note.Velocity; _notes.Add(newNote); }
public void RemoveNote(NoteMessage note) { if (_notes.Count > 0) { for (int i = _notes.Count - 1; i >= 0; i--) { if (note.Channel == _notes[i].Channel && note.Pitch == _notes[i].Pitch && note.Velocity == _notes[i].Velocity) { _notes.RemoveAt(i); break; } } } }
public void RemoveNote(NoteMessage note) { if(_notes.Count > 0) for(int i = _notes.Count - 1 ; i >= 0 ; i--) { if(note.Channel == _notes[i].Channel && note.Pitch == _notes[i].Pitch && note.Velocity == _notes[i].Velocity) { _notes.RemoveAt(i); break; } } }
public abstract void AddNote(NoteMessage note);