private void MidiListenerOnNoteOn(object sender, MidiListener.NoteEventArgs e) { if (_pressedNotes.Find(x => x.NoteAbsolute == e.NoteAbsolute) != null) { throw new ArgumentException(); } _pressedNotes.Add(e); OnPressedNotesChanged?.Invoke(this, EventArgs.Empty); }
private void MidiListenerOnNoteOff(object sender, MidiListener.NoteEventArgs e) { _pressedNotes.RemoveAll(x => x.NoteAbsolute == e.NoteAbsolute); OnPressedNotesChanged?.Invoke(this, EventArgs.Empty); }