/// <summary> /// Close the MIDI device (if opened) when destroying the script. /// </summary> private void OnDestroy() { if (output != null) { Debug.Log("Closing MIDI device " + openedOutputDevice); try { output.Close(); } catch { } openedOutputDevice = -1; } }
public void Unload() { if (_MIDISequence != null) { _MIDISequence.Clear(); } if (_MIDIOutDevice != null) { _MIDIOutDevice.Close(); } }