You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on receiving patch/configuration dumps from the Novation Circuit and Novation Launch Control XL. These are sent by the device as SysEx messages that are about 300 bytes long. Each such message is received as multiple MIDI packets.
MIKMIDI doesn't handle these messages correctly. It's interpreting each packet as a separate command, instead of part of one long command. For example, here's the list of commands I receive when the Launch Control XL sends its configuration:
This took me some time to figure out. What's going on is:
As per spec, a SysEx message ends with a 0xF7 byte.
The 0xF7 at the end of the MIKMIDISystemExclusiveCommand's data is not real: the class's -data method appended it because it didn't see a real 0xF7 at the end of the packet data.
The rest of the commands aren't commands at all, which explains why they have weird types like 0x00 and 0x3c. They're just the continuation of the SysEx data.
The last 'command' ends with the real 0xF7 byte, signaling the real end of the SysEx command.
What MIKMIDI should be doing when it receives a SysEx command that doesn't end with 0xF7 is to hold the command; then each successive packet received should be appended to the SysEx's data, until one of them ends with 0xF7. Then the SysEx command is complete and can be dispatched to the app.
If it did so, the correct SysEx command object would look like this:
I've added logic like the above to my app, and it receives the dumps correctly now. I had to access the private internalData property of the MIKMIDISystemExclusiveCommand in order to get its true data without the phantom trailing 0xF7, though.
I took a look at adding the same logic to MIKMIDI's MIKMIDIPortReadCallback function, but there's already some complex stuff going on there with buffering 14-bit CCs, involving dispatch queues, so I didn't feel confident extending that code. But it probably wouldn't be difficult for someone already familiar with this part of the codebase.
The text was updated successfully, but these errors were encountered:
I'm working on receiving patch/configuration dumps from the Novation Circuit and Novation Launch Control XL. These are sent by the device as SysEx messages that are about 300 bytes long. Each such message is received as multiple MIDI packets.
MIKMIDI doesn't handle these messages correctly. It's interpreting each packet as a separate command, instead of part of one long command. For example, here's the list of commands I receive when the Launch Control XL sends its configuration:
This took me some time to figure out. What's going on is:
-data
method appended it because it didn't see a real 0xF7 at the end of the packet data.What MIKMIDI should be doing when it receives a SysEx command that doesn't end with 0xF7 is to hold the command; then each successive packet received should be appended to the SysEx's data, until one of them ends with 0xF7. Then the SysEx command is complete and can be dispatched to the app.
If it did so, the correct SysEx command object would look like this:
I've added logic like the above to my app, and it receives the dumps correctly now. I had to access the private
internalData
property of the MIKMIDISystemExclusiveCommand in order to get its true data without the phantom trailing 0xF7, though.I took a look at adding the same logic to MIKMIDI's
MIKMIDIPortReadCallback
function, but there's already some complex stuff going on there with buffering 14-bit CCs, involving dispatch queues, so I didn't feel confident extending that code. But it probably wouldn't be difficult for someone already familiar with this part of the codebase.The text was updated successfully, but these errors were encountered: