Beispiel #1
0
        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);
        }
Beispiel #2
0
        private void MidiListenerOnNoteOff(object sender, MidiListener.NoteEventArgs e)
        {
            _pressedNotes.RemoveAll(x => x.NoteAbsolute == e.NoteAbsolute);

            OnPressedNotesChanged?.Invoke(this, EventArgs.Empty);
        }