sxformat and checksum bug with 00?

Thomas Göllles's icon

Hi,

I am building a tool to send SysEx to a Roland JV 2080 and so far everything works as expected. But in the attached example I can no send the value 48 correct. The sysex message is 1 byte shorter with the value 48. It should be:
f0 41 10 6a 12 03 00 10 3d 30 00 f7 but instead is
f0 41 10 6a 12 03 00 10 3d 30 f7.

So why is the 00 not included and how to I fix it?

I recorded the sysex values with Midi Monitor while running the device in Ableton 10.1.6 with Max 8.1.0.

The JV 2080 is also not happy with the sysex message.

bug_test.amxd
amxd 7.76 KB
bug_test

Source Audio's icon

Post full sysex explanation,
Manufacturer, Device ID, parameter ID etc to understand your sysex string.
and preferably using decimal, not hex.
And - do you know how to calculate proper roland sysex checksum ?

Source Audio's icon

P.S. I am sure it is checksum of the param + 48 = 128,
3 + 0 + 16 + 61 = 80 + 48 = 128.
but it should be run through %128 again, so that output
becomes
240 65 16 106 18 3 0 16 61 48 0 247
and not
240 65 16 106 18 3 0 16 61 48 128 247
That is so for Roland checksum.
sxformat 240 65 16 106 18 3 0 16 61 / is $i1 / is (128-checksum(5,9,1)%128)%128 / 247

Thomas Göllles's icon

Yes thanks, your checksum works. Although, the other one worked also in many cases, but not when the result is 0.
Both checksums are Mathematically the same.
What I don't understand is why the result of the (128-checksum(5,9,1)%128) disappears when it should be 0.

Source Audio's icon

For sum of 3 0 16 61 48
result of (128-checksum(5,9,1)%128) is 128
result of (128-checksum(5,9,1)%128)%128 / is 0
128 is not allowed,only 0 - 127, so it gets droped

Max Patch
Copy patch and select New From Clipboard in Max.


Thomas Göllles's icon

Ok thanks, but i still find it strange that it is dropped without an error or warning. I am quite new to Max and coming from other programming languages this seems very strange and dangerous.

Source Audio's icon

data in sysex must stay within 0 - 127.
Try to send that sysex from other software with checksum of 128
and see what would be returned from roland, and if
any alert or error would get displayed.
Midi behaves different from device to device,
some ignore non conform data, some freak out.
It is allways good practice to check what gets sent,
by capturing it before the real output.