1

I'd like to send a Sysex message to a MIDI Port. Unfortunately there is no response at all when I send it. Sending regular MIDI messages (ShortMessage) works just fine, but as soon as I replace the ShortMessage with the SysexMessage things stop working.

MidiDevice midiIn = MidiSystem.getMidiDevice(midiDeviceList[NUMBER]);
Receiver rcvr = midiIn.getReceiver
byte[] clearMsg = {(byte) 0xf0, 0x47, 0x7f, 0x15, 0x1e, 0x00, 0x00, (byte) 0xf7 };

SysexMessage sysMsg = new SysexMessage();    
sysMsg.setMessage(clearMsg, clearMsg.length);

rcvr.send(sysMsg, -1);

Why doesn't the port receive the message or why isn't it being sent?

TomTom
  • 2,820
  • 4
  • 28
  • 46
  • Can you check with a loopback whether the message is sent at all? – CL. Jul 13 '14 at 18:24
  • @CL. How would I do that? I tried several MIDI inputs and monitored all IN and OUTs available, but nothing happened. – TomTom Jul 13 '14 at 19:54
  • Connect the output port to an input port, send both short and SysEx messages, and check (with any sequencer) what you can record from the input. – CL. Jul 13 '14 at 20:50
  • @CL. I've tried all ports (Gervill, Real Time Sequencer, OSX's IAC) . ShortMessages work, but no SysEx. My assumption is that there is no message sent, otherwise I would see it in my MIDI Monitoring app. – TomTom Jul 13 '14 at 22:48

2 Answers2

1

The reason SysEx messages were not sent is because OSX is has a broken MIDI system. It cannot send SysEx messages. MMJ seems to be a library to workaround this problem.

TomTom
  • 2,820
  • 4
  • 28
  • 46
1

A more recent solution is https://github.com/DerekCook/CoreMidi4J which is just another dependency you add which will make Midi on OSX work (and do no harm on other platforms).

Bart Schuller
  • 2,725
  • 19
  • 18