Sign in to follow this  
Followers 0
boops

A MB 64 FOR A JD 990 ROLAND

8 posts in this topic

HI ,i ve planed to build a controller for a old jd 990 ..i find this:

For example the following SysEx message turns off Tone 1 on the temporary patch on a JV-1080/JV-2080/XP-50 or XP-80. The checksum 6D is calculated as follows (all numbers are in Hex NOT decimal):

F0 41 10 6A 12 03 00 10 00 00 6D F7

            ^^ ^^^^^^^^^^^^^^ ^^ ^^

            |        |        |  |

            |        |        |  +-- End of SysEx message marker

            |        |        +-- Checksum

            |        +-- Data portion of message

            +-- Command ID (12 = DT1 - Data Set)

(1) Add the data part of the message

03 + 00 + 10 + 00 + 00 = 13 (X)

(2) Divide (X) by 0x80 (128 in decimal) and save the reminder which is (Y)

13 / 80 = 0 with remainder of 13 =(Y)

(3) Subtract (Y) from 0x80 (128) to give us the checksum

80 - 13 = 6D (checksum)

i don't understand the (2)..;some  informations please...best regards and happy new years..

Share this post


Link to post
Share on other sites

13h = 19d

19d / 128 d = 0,148...

As you can't easily represent floating point values in a hexadecimal system, you use the concept of a remainder.

-->  0 x 128d (a)

--> 19 x 1d (b)

==> total is (a)+(b)

Share this post


Link to post
Share on other sites

thanks but  :o  ....i have to look for sysex informations.. ???

Share this post


Link to post
Share on other sites

Yes, if you want to send SysEx messages, you have to understand what you are doing  :). Look here for a more in-depth explanation of the concept. Also, you will need to understand the manufacturer's (Roland) implementation of that concept.

It's complex, but it's not magic. With MIDIbox you are on the right platform for doing this!

Best regards, ilmenator

Share this post


Link to post
Share on other sites

Google modulus

seems like this pseudocode should do it:

void gen_chksum_and_send(void) {
unsigned char Y = 0;
unsigned char X = 0; // I assume it's meant to be overloaded

for (i=0; i < sysex_byte_count; i++){
X += sysex_buffer[i];
}

X %= 0x80; //There's the modulus
Y = 0x80 - X;

sysex_buffer[sysex_byte_count] = Y;

sysex_buffer_send();
}

Don't go trying to do that frequently on the PIC though, a modulus is a divide operation so it's slow.

Share this post


Link to post
Share on other sites

thanks very much  8) i will try to progress with this informations

Share this post


Link to post
Share on other sites

There is a good explanation of the checksum at the end of This Page.

The add and mask concept is easier to implement in PIC than any divide type function.

I'd start with a dummy value of zero, then do a loop until the end of the sysex data, adding the next value and masking with 128 (AND 0x7F ) , to keep the numbers in the frame. You don't need to worry about carry values, because the nominal overflow is going to be masked off anyway.

Note 0x7F = 0b01111111:  the AND function effectively means "keep all the bits except the highest".

Here is a sysex calculator on this page which will allow you to check figures during testing

Hope this helps

Share this post


Link to post
Share on other sites

1. Convert the hex values to decimal.

2. Add the values together, but if the answer to any sum exceeds 127 then subtract 128.

3. Subtract the final answer from 128.

4. Convert the resulting value back to hex and use as the checksum.

Much nicer method! Thanks Mike!

Remember the checksum is only calculated from the address [6] and the data [7]

This new (new to me anyway) info means that the above code will certainly not work.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0