I'm doing some work with the JavaSound API to send a MIDI System Exclusive (Sysex) message to an external MIDI device (an electronic keyboard). According to the Yamaha manual, the data to send to light up one of the keys is this series of bytes: F0 43 7F 00 00 03 00 41 F7.
According to the JavaDoc on SysexMessage, the correct way to send data for a message is with setMessage(int status, byte[] data, int length)
. In this case, F0 (or 240 decimal) is the status, and everything else is the data - including the F7 (247 decimal) at the end, which indicates the end of the Sysex message.
The problem is that bytes in Java are limited to the range -128..127, so I can't send F7 in a byte array. But the JavaDoc for SysexMessage seems oblivious to this fact, saying, "If this message contains all the system exclusive data for the message, it should end with the status byte 0xF7."
Any suggestions for how to correctly send that final byte? Am I misinterpreting the JavaDoc for SysexMessage?