Example #1
0
 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();
     }
 }
Example #2
0
        public void Dispose()
        {
            foreach (var channel in Instruments)
            {
                channel.Stop();
            }

            percussion.Stop();

            if (midiOut != null)
            {
                midiOut.Reset();
                midiOut.Close();
                midiOut.Dispose();
                midiOut = null;
            }
        }
Example #3
0
 internal void ResetDevice()
 {
     midiOut?.Reset();
 }