jjonas Posted December 15, 2019 Report Posted December 15, 2019 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 Quote
TK. Posted December 15, 2019 Report Posted December 15, 2019 Hi, interesting: they are using a slightly different way to calculate the checksum. Actually "128-remainder" is problematic, because if the remainder is 0, it would result into an invalid value (128 is outside the 7bit range). So, I added ^chk_roland, and it masks the result with 0x7f to ensure that it will be valid. -> http://www.ucapps.de/mios32/midibox_ng_v1_037_pre6.zip Best Regards, Thorsten, Quote
jjonas Posted December 15, 2019 Author Report Posted December 15, 2019 Thanks for the fast reply! However, trying to open the link gives me "404 Not found". Quote
TK. Posted December 15, 2019 Report Posted December 15, 2019 I fixed the link, could you please try again? Quote
jjonas Posted December 16, 2019 Author Report Posted December 16, 2019 Works! (Both the link and the new version!) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.