public void TestNoteOnOff()
        {
            Console.WriteLine(string.Join(", ", MidiCommunicationChannel.AvailableMidiInputPorts.Select(a => a.Name)));
            Console.WriteLine(string.Join(", ", MidiCommunicationChannel.AvailableMidiOutputPorts.Select(a => a.Name)));

            using (MidiCommunicationChannel comms =
                       new MidiCommunicationChannel(TestInputPort, TestOutputPort))
            {
                var msg = ChannelVoiceMessage.NoteOn(TestMidiChannel, 80, 127);

                DebugMessage(msg);

                comms.SendMidiMessage(msg);

                Thread.Sleep(2000);
                msg = ChannelVoiceMessage.NoteOff(TestMidiChannel, 80, 30);


                DebugMessage(msg);
                comms.SendMidiMessage(msg);


                comms.NoteOn(MidiChannel.One, 80, 127);

                Thread.Sleep(2000);

                comms.NoteOff(MidiChannel.One, 80, 20);
            }
        }
 public static void NoteOn(this MidiCommunicationChannel self, int channel, int key, int velocity)
 {
     self.SendMidiMessage(ChannelVoiceMessage.NoteOn(channel, key, velocity));
 }