public void CloseMidiDevice() { if (_midiDevice == null) { return; } _midiDevice.Close(); _midiDevice = null; }
public void AddMidiDevice(MidiIn midiInput, OnKeyPressed onKeyPressedListener = null, OnKeyReleased onKeyReleasedListener = null) { _midiDevice = new MidiDevice(midiInput, OnNoteOn, OnNoteOff); if (onKeyPressedListener != null) { _onKeyPressedListeners.Add(onKeyPressedListener); } if (onKeyReleasedListener != null) { _onKeyReleasedListeners.Add(onKeyReleasedListener); } }