[comp.music] MIDI SysEx Checksums

a708@mindlink.UUCP (Gord Wait) (10/29/90)

Yamaha's olde DX7 checksum is the two's complement of the sum of the data
bytes: Ie add up all your data bytes, chop away anything over 8 bits (use a 32
bit add to keep the sign bit away..), invert the lowest 8 bits, (exchange 1's
for 0's, 0's for 1's) and add One to the final result. Unfortunately, there is
no standard in the sysex data for where the data to add starts amongst the
different Yamaha sysex data formats I've been working at...

Gord Wait

cho@aber-cs.UUCP (C.H. Orgill) (10/29/90)

I am trying to write an Editor-Librarian on the Macintosh for a newly
acquired Casio VZ-1. Fine so far, but in the SysEx documentation Casio
omit to mention how their 7-bit checksum is generated. I can only
assume they allude to some commonly-known format for MIDI checksums.
Unfortunately, since this is my first programming experience of MIDI,
I do not know this format ! I can only report that it is not (the sum
of all the data bytes indicated) modulo 128. All clues gratefully
received !


(p.s. this will be either Public Domain or Shareware when it's finished,
if it's ever good enough !)

Regards,

Chris Orgill,				tel +44 970 622447
Research Associate,
Computer Science Department,		 cho%cs.aber.ac.uk@uunet.uu.net (ARPA)
University College of Wales,		 cho@uk.ac.aber.cs (JANET)
Aberystwyth, Dyfed, United Kingdom. SY23 3BZ.

risto@tuura.UUCP (Risto Lankinen) (10/30/90)

cho@aber-cs.UUCP (C.H. Orgill) writes:


>I am trying to write an Editor-Librarian on the Macintosh for a newly
>acquired Casio VZ-1. Fine so far, but in the SysEx documentation Casio
>omit to mention how their 7-bit checksum is generated. I can only
>assume they allude to some commonly-known format for MIDI checksums.
>Unfortunately, since this is my first programming experience of MIDI,
>I do not know this format ! I can only report that it is not (the sum
>of all the data bytes indicated) modulo 128. All clues gratefully
>received !

Hi!

The Roland MT-32 uses a method such that on the receiving side, the string
*plus* the checksum character 0..127 are summed, after which the modulo 128
should be zero.  To calculate the character, one first calculates the sum
of the data string modulo 128, and uses 128-<that_result> as the checksum
character (to make the string & checksum eventually sum up to 128*k+0 at
the receiving side).  This may (or may not) work with Casio.

Terveisin: Risto Lankinen
-- 
Risto Lankinen / product specialist ***************************************
Nokia Data Systems, Technology Dept *  2                              2   *
THIS SPACE INTENTIONALLY LEFT BLANK * 2 -1 is PRIME!  Now working on 2 +1 *
replies: risto@yj.data.nokia.fi     ***************************************

e85rw@efd.lth.se (Ricard Wolf) (10/31/90)

In article <2077@aber-cs.UUCP> cho@uk.ac.aber.cs (Chris Orgill) writes:
>
>I am trying to write an Editor-Librarian on the Macintosh for a newly
>acquired Casio VZ-1. Fine so far, but in the SysEx documentation Casio
>omit to mention how their 7-bit checksum is generated. I can only
>assume they allude to some commonly-known format for MIDI checksums.
>Unfortunately, since this is my first programming experience of MIDI,
>I do not know this format ! I can only report that it is not (the sum
>of all the data bytes indicated) modulo 128. All clues gratefully
>received !

I don't know how Casio perform their checksum, but in som cases you
XOR all the bytes together (even though it is called a check *sum*). The
reason for this can be to permit the same routine to do the checksumming
both when receiving and transmitting.
Another difficulty is which bytes to checksum. Some manufacturers
checksum all the bytes in the SYSEX data (usually not including the ID number),
whereas others just checksum the "raw" data itself (i.e. not any headers
like patch numbers or sample lengths).

Hope this helps.

-- 
Ricard Wolf

+--------------------------+-------------------------------------+
| Ricard Wolf              | Lund Institute of Technology        |
| email: e85rw@efd.lth.se  | If you can't buy 'em - build 'em !! |
+--------------------------+-------------------------------------+