Beispiel #1
0
 public void ProgramChange(byte currentChannel, byte msb, byte lsb, byte pc)
 {
     try
     {
         MidiControlChangeMessage controlChangeMsb = new MidiControlChangeMessage(currentChannel, 0x00, msb);
         MidiControlChangeMessage controlChangeLsb = new MidiControlChangeMessage(currentChannel, 0x20, lsb);
         MidiProgramChangeMessage programChange    = new MidiProgramChangeMessage(currentChannel, (byte)(pc - 1));
         UsbTransmit(MakeUsbBuffer(controlChangeMsb.Message));
         UsbTransmit(MakeUsbBuffer(controlChangeLsb.Message));
         UsbTransmit(MakeUsbBuffer(programChange.Message));
     }
     catch { }
 }
Beispiel #2
0
 public void ProgramChange(byte currentChannel, String smsb, String slsb, String spc)
 {
     try
     {
         MidiControlChangeMessage controlChangeMsb = new MidiControlChangeMessage(currentChannel, 0x00, (byte)(UInt16.Parse(smsb)));
         MidiControlChangeMessage controlChangeLsb = new MidiControlChangeMessage(currentChannel, 0x20, (byte)(UInt16.Parse(slsb)));
         MidiProgramChangeMessage programChange    = new MidiProgramChangeMessage(currentChannel, (byte)(UInt16.Parse(spc) - 1));
         UsbTransmit(MakeUsbBuffer(controlChangeMsb.Message));
         UsbTransmit(MakeUsbBuffer(controlChangeLsb.Message));
         UsbTransmit(MakeUsbBuffer(programChange.Message));
     }
     catch { }
 }