I've got some trouble sending MIDI over USB to communicate with a lightsoftware.
The lighting software only reacts on control change commands (statusByte: 1011CCCC, whereas CCCC = Channel, Data1: Key[Byte], Data2: Value[Byte])
So apperently the USBMIDI library is not compatible with the mega board, so I tried implementing this simple feature myself, but I get only nonesense Data, if at all.
My (simplified) source:
void commCC (byte mchannel, byte key, byte val) {
byte status = 176 + mchannel; // 1011cccc
Serial.write(statusByte);
Serial.write(key);
Serial.write(val);
Serial.flush();
}
// Called like this (On Channel 15 pull up the fader 124 to max):
commCC(15, 124, 127);
Thanks for help