Hi,
I have the following problem when trying to calculate a Roland checksum for changing the parameters of an XV-5080.
When I calculate the checksum by hand for a fixed parameter value and insert them both into the sysex stream, it works:
EVENT_ENC id=1 bank=1 range=0x00:0x7f type=SysEx \
stream=“0xf0 0x41 0x10 0x00 0x10 0x12 \
0x1f 0x00 0x20 0x55 0x0f 0x5d 0xf7” \
lcd_pos=1:1:1 label=“TVF1”
But the following doesn’t work:
EVENT_ENC id=1 bank=1 range=0x00:0x7f type=SysEx \
stream=“0xf0 0x41 0x10 0x00 0x10 0x12 \
^chk_start 0x1f 0x00 0x20 0x55 ^val ^chk 0xf7” \
lcd_pos=1:1:1 label=“TVF1”
Trying with ^chk or ^chk_inv both fail (I get a “Bulk dump: Check Sum Error” from the synth).
The result is the same even if I replace the dynamic value ( ^val ) with a fixed value and have the NG calculate only the checksum.
So I’m wondering if I’m trying to calculate the checksum correctly. Here’s how the checksum is calculated by hand for the first example (the one that works).
parameter address + value = sum
0x1f 0x00 0x20 0x55 + 0x0f = 0xa3
31 0 32 85 + 15 = 163
163 % 128 -> 35 (=remainder)
checksum = 128 - 35 = 93 ( 0x5d )
Just in case it’s useful (and I’ve misunderstood something), here’s the Roland description from the synth’s manual:
Quote
The checksum is a value derived by adding the address, size and checksum
itself and inverting the lower 7 bits. Here’s an example of how the checksum
is calculated. We will assume that in the Exclusive message we are transmitting,
the address is aa bb cc ddH and the data or size is ee ffHH.aa + bb + cc + dd + ee + ff = sum
sum % 128 = quotient … remainder
128 - remainder = checksum