예제 #1
0
        public void CloseMidiDevice()
        {
            if (_midiDevice == null)
            {
                return;
            }

            _midiDevice.Close();
            _midiDevice = null;
        }
예제 #2
0
        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);
            }
        }