MIDIbox Forum: Checksum - MIDIbox Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Checksum How to find checksum from a voice or ensemple file Rate Topic: -----

#1 User is offline   Per 

  • MIDIbox Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 13-September 11

Posted 22 October 2011 - 10:57

Hello
Can anyone tell me how to find the checksum (the byte before F7) in FmBox voice/drum or ensemble files?
Is it 7bit or 8bit notation, and from where to where will i have to count?
Regards Per

#2 User is offline   TK. 

  • MIDIbox Guru
  • View gallery
  • Group: Administrators
  • Posts: 11,141
  • Joined: 01-January 01
  • LocationGermany

Posted 23 October 2011 - 20:30

Hi Per,

the checksum is calculated over the data part only (256 bytes)

Calculation (pseudo code):
    // data block is located in data[] array
    // create sysex string:

    Array<uint8> sysEx;

    sysEx.add(0xf0);
    sysEx.add(0x00);
    sysEx.add(0x00);
    sysEx.add(0x7e);
    sysEx.add(0x49);
    sysEx.add(deviceNumber);
    sysEx.add(0x02);
    sysEx.add(type);
    sysEx.add(bank);
    sysEx.add(patch);

    uint8 checksum = 0x00;
    for(int i=0; i<256; ++i) {
        uint8 b = data[i];
        sysEx.add(b);
        checksum += b;
    }

    sysEx.add(-(int)checksum & 0x7f); // 7bit !!!
    sysEx.add(0xf7);


Best Regards, Thorsten.
Posted Image Buy TK a Beer Disclaimer: buying TK a beer gets you absolutely nothing in return likesuchas firmware enhancements, technical advices and MIDIbox troubleshooting assistance.

#3 User is offline   Per 

  • MIDIbox Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 13-September 11

Posted 25 November 2011 - 03:45

Thank you Thorsten it was just what i needed
and thanks for the Fm Synth its a fantastic piece of work, and what a sound :thumbsup:
Best regards Per

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users