I am using both Serial Midi and usbMIDI in my project.
For the serial Midi I am using the 4.2 Library of Francois Best.
Now all the Midi commands work, apart from receiving Sysex. Here the libraries are different. In my setup I have included:
usbMIDI.setHandleSysEx(OnSysEx);
MIDI1.setHandleSystemExclusive(OnSerialSysEx);
Because of the differences I want to convert the serial sysex to the usbMidi sysex. But I cannot get this working. Does anyone have any idea how I could fix this? The code is below and does compile with errors:
Error message:
In function 'void OnSerialSysEx(byte*, unsigned int)':
MIDI_in.ino:59:43: warning: 'sxdata_convert' is used uninitialized in this function [-Wuninitialized]
Code:
void OnSerialSysEx(byte *ssxdata, unsigned ssxlength) {
unsigned char* sxdata_convert;
for (uint8_t count = 0; count < ssxlength; count++) {
sxdata_convert[count] = ssxdata[count];
}
OnSysEx(sxdata_convert, ssxlength, true);
}
void OnSysEx(const unsigned char* sxdata, short unsigned int sxlength, bool sx_comp) {
}
For the serial Midi I am using the 4.2 Library of Francois Best.
Now all the Midi commands work, apart from receiving Sysex. Here the libraries are different. In my setup I have included:
usbMIDI.setHandleSysEx(OnSysEx);
MIDI1.setHandleSystemExclusive(OnSerialSysEx);
Because of the differences I want to convert the serial sysex to the usbMidi sysex. But I cannot get this working. Does anyone have any idea how I could fix this? The code is below and does compile with errors:
Error message:
In function 'void OnSerialSysEx(byte*, unsigned int)':
MIDI_in.ino:59:43: warning: 'sxdata_convert' is used uninitialized in this function [-Wuninitialized]
Code:
void OnSerialSysEx(byte *ssxdata, unsigned ssxlength) {
unsigned char* sxdata_convert;
for (uint8_t count = 0; count < ssxlength; count++) {
sxdata_convert[count] = ssxdata[count];
}
OnSysEx(sxdata_convert, ssxlength, true);
}
void OnSysEx(const unsigned char* sxdata, short unsigned int sxlength, bool sx_comp) {
}