public static void Send(int note) { try { midiOut.Send(MidiMessage.StartNote(note, 127, 1).RawData); midiOut.Reset(); } catch (Exception e) { MessageBox.Show(e.Message, "NAudio MIDI"); } finally { // midiOut.Close(); } }
public void Dispose() { foreach (var channel in Instruments) { channel.Stop(); } percussion.Stop(); if (midiOut != null) { midiOut.Reset(); midiOut.Close(); midiOut.Dispose(); midiOut = null; } }
internal void ResetDevice() { midiOut?.Reset(); }