ddiakopoulos/hiduino

MIDI.SendSysEx adds last send type to every 3 bytes

koenschepens opened this issue · 1 comments

Hello,

First of all thanks for the amazing work!

I'm having problems with sending SysEx messages though. I'm trying to send SysEx from the Arduino using hiduino, but for every 3 bytes, the last sent MIDI signal byte gets added.

My code:

include <MIDI.h>

MIDI_CREATE_DEFAULT_INSTANCE();

void setup() {
MIDI.turnThruOff();
MIDI.begin();
}

void loop() {
MIDI.sendNoteOff(2,5,6);
byte sysex_message [] = { 0x7D,0x01,0x00,0x12,0x7B,0x22,0x7D,0x5D,0x7D};
MIDI.sendSysEx(sizeof(sysex_message)/sizeof(byte), sysex_message, false);
delay(1000);
}

Using MIDIMonitor, I can see this results in this:
7224485941539 From arduino_midi Note Off 6 85 02 05
7224486192131 From arduino_midi SysEx F0 F7
7224486816029 From arduino_midi Note Off 6 85 7D 01
7224487474300 From arduino_midi Note Off 6 85 00 12
7224488106447 From arduino_midi Note Off 6 85 7B 22
7224488737423 From arduino_midi Note Off 6 85 7D 5D
7224489393674 From arduino_midi Invalid 00 F7

If I change MIDI.sendNoteOff(2,5,6) to MIDI.sendNoteOn(2,5,6), the result is this:

7315676492278 From arduino_midi Note On 6 95 02 05
7315676725341 From arduino_midi SysEx F0 F7
7315677367149 From arduino_midi Note On 6 95 7D 01
7315678008872 From arduino_midi Note On 6 95 00 12
7315678647752 From arduino_midi Note On 6 95 7B 22
7315679315940 From arduino_midi Note On 6 95 7D 5D
7315679923905 From arduino_midi Invalid 00 F7

Now I understood that SysEx is not fully supported (receiving is going fine by the way). But is there any known workaround or fix to this problem?

Thanks in advance!

Yours,

Koen

something similar is happening to me

I've also posted this in the Arduino MIDI Library GH.