MidiInput hungs up when receives SysEx message


I didn’t have time to check receiving MIDI data via MidiInput since my last post, then I check it today but I had a trouble.

I don’t know why but when an instance of MidiInput class receives MIDI SysEx message, it hungs up.

The receiving SysEx message is short, size it is less than 16 bytes.

My callback (handleMidiMessage) is confinuously called when the device sending short messages like Note On/Off, 0xbn, active sensing, clock. But once receiving SysEx, my calback is never called…

Best regards,
Masanao Hayashi


I found one bug…

In juce_MidiMessage.cpp, line 175

if (*d >= 0x80) break;should beif ((*d >= 0x80) && (*d != 0xf7)) break;I think… otherwise the next if (*d++ == 0xf7) break;never called, the size of SysEx always wrong.

I’m now re-writing midiInputProc() function. I will post it when I finish it.

Best regards,
Masanao Hayashi


ah - great bug-hunting! Thanks hayashi! That sounds like it’s the culprit.


no problem. I’ve fixed the source and now testing.

I would like to add two methods to midi input callback. One is called when start receiving SysEx message, and the other is called when SysEx message which is not terminated. Because, as you might know, our synths send HUGE SysEx (it’s sometimes over 1MB… I hate the specification though…), so we need to show the progress bar or something in the application’s GUI.

Anyway, I will send the code to you when I finished. Please consider to add those two methods.

Best regards,
Masanao Hayashi