# Casio vz checksum calculator?

**URL:** <https://forum.electra.one/t/casio-vz-checksum-calculator/3445>\
**Category:** Instruments\
**Created:** [December 13, 2024, 10:40pm UTC](https://forum.electra.one/t/casio-vz-checksum-calculator/3445 "2024-12-13T22:40:51Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![NewIgnis](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/newignis/32/767_2.png) [@NewIgnis](https://forum.electra.one/u/NewIgnis)\
**Post date:** [December 13, 2024, 10:40pm UTC](https://forum.electra.one/t/casio-vz-checksum-calculator/3445/1 "2024-12-13T22:40:51Z")

</div>

Does anyone has information on how Casio made its sysEx checksums?

---

<div class="post-metadata">

**Author:** ![oldgearguy](https://avatars.discourse-cdn.com/v4/letter/o/f4b2a3/32.png) [@oldgearguy](https://forum.electra.one/u/oldgearguy)\
**Post date:** [December 14, 2024, 11:06am UTC](https://forum.electra.one/t/casio-vz-checksum-calculator/3445/2 "2024-12-14T11:06:02Z")

</div>

EDIT to correct the name of the software

I use software called Hex Workshop In addition to editing binary files and such, you can calculate checksums across a range of bytes using various checksum algorithms.

There’s only a few ways to calculate checksums, so maybe post a dump and indicate where the header ends and data begins.

---

<div class="post-metadata">

**Author:** ![NewIgnis](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/newignis/32/767_2.png) [@NewIgnis](https://forum.electra.one/u/NewIgnis)\
**Post date:** [December 14, 2024, 11:15am UTC](https://forum.electra.one/t/casio-vz-checksum-calculator/3445/3 "2024-12-14T11:15:55Z")

</div>

I just downloaded it zip file “HexEdit\_220\_Project” but I’m on unfamiliar terrain here. Can you get me kickstarted on how to install this?

---

<div class="post-metadata">

**Author:** ![oldgearguy](https://avatars.discourse-cdn.com/v4/letter/o/f4b2a3/32.png) [@oldgearguy](https://forum.electra.one/u/oldgearguy)\
**Post date:** [December 14, 2024, 12:05pm UTC](https://forum.electra.one/t/casio-vz-checksum-calculator/3445/4 "2024-12-14T12:05:47Z")

</div>

On my phone at the moment. There’s an on line hex editor by that name which also can do checksums (I think).

Need to get back to my development computer in a bit to give real answer.

Hex Workshop. The link appears to be legit, but it’s showing not secure: `www.hexworkshop.com` and the download is broken.

Here’s the tool on CNET: [Hex Workshop for Windows - Free download and software reviews - CNET Download](https://download.cnet.com/hex-workshop/3000-2352_4-10004918.html?rex=true)

I guess old people use old tools. lol

---

<div class="post-metadata">

**Author:** ![NewIgnis](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/newignis/32/767_2.png) [@NewIgnis](https://forum.electra.one/u/NewIgnis)\
**Post date:** [December 14, 2024, 12:50pm UTC](https://forum.electra.one/t/casio-vz-checksum-calculator/3445/5 "2024-12-14T12:50:39Z")

</div>

Old tools , yes. But new tools too 😉  
I’m currently reverse engineering the Casio checksum using ChatGPT 🙂 No results yet though

---

<div class="post-metadata">

**Author:** ![oldgearguy](https://avatars.discourse-cdn.com/v4/letter/o/f4b2a3/32.png) [@oldgearguy](https://forum.electra.one/u/oldgearguy)\
**Post date:** [December 14, 2024, 1:40pm UTC](https://forum.electra.one/t/casio-vz-checksum-calculator/3445/6 "2024-12-14T13:40:03Z")

</div>

simplest answer is to post a dump as an attachment here.

---

<div class="post-metadata">

**Author:** ![NewIgnis](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/newignis/32/767_2.png) [@NewIgnis](https://forum.electra.one/u/NewIgnis)\
**Post date:** [December 14, 2024, 2:02pm UTC](https://forum.electra.one/t/casio-vz-checksum-calculator/3445/7 "2024-12-14T14:02:35Z")

</div>

I’ve tried the following 6 types, none of them brought a solution:

```auto
function calcChecksum(payLoad) -- calculates a checksum
  local result = 0
  local type = 4 -- fixed choice of checksum to use
  for i= 1, #payLoad do
    if type < 4 then result = result+payLoad[i] else result = result~payLoad[i] end
  end
  if type == 0 then result = (128-result)%128 end -- roland
  if type == 1 then result = ((~result & 0xFF) +1) & 0x7F end-- yamaha
  if type == 2 then result = result%128 end -- simple 7bit checksum
  if type == 3 then result = (128-(result%128))%128 end 
  if type == 4 then result = (128-result)%128 end -- 7bit XOR checksum 
  if type == 5 then result = result%128 end -- 7bit XOR checksum 
  return result 
end

```

Here are 5 strings each 159 bytes long, whereby the header is the first 7 bytes and the second to last is the checksum. Each will start with F0 and end with F7. They are as they came from the Casio VZ-8M

- F0 44 03 02 70 01 40 02 01 00 00 08 00 02 00 02 00 02 00 02 00 00 00 00 00 00 00 00 00 00 00 06 00 02 00 00 04 01 04 00 00 06 03 00 00 08 00 06 08 02 00 00 04 01 04 00 00 06 03 00 00 08 00 07 00 02 00 00 04 01 04 00 00 06 03 00 00 08 00 07 08 02 00 00 04 01 04 00 00 06 03 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 0B 00 00 00 00 00 00 04 0B 00 00 00 01 00 0A 08 07 00 03 00 03 00 00 00 01 01 0F 01 04 00 00 61 F7
- F0 44 03 02 70 01 40 02 01 00 00 08 00 02 00 02 00 02 00 02 00 00 00 00 00 00 00 00 00 00 00 06 00 02 00 00 04 01 04 00 00 06 03 00 00 08 00 06 08 02 00 00 04 01 04 00 00 06 03 00 00 08 00 07 00 02 00 00 04 01 04 00 00 06 03 00 00 08 00 07 08 02 00 00 04 01 04 00 00 06 03 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 0B 00 00 00 00 00 00 04 0B 00 00 00 01 00 07 08 07 00 03 00 03 00 00 00 01 01 04 01 0F 00 00 64 F7
- F0 44 03 02 70 01 40 02 01 00 00 08 00 02 00 02 00 02 00 02 00 00 00 00 00 00 00 00 00 00 00 06 00 02 00 00 04 01 04 00 00 06 03 00 00 08 00 06 08 02 00 00 04 01 04 00 00 06 03 00 00 00 00 07 00 02 00 00 04 01 04 00 00 06 03 00 00 08 00 07 08 02 00 00 04 01 04 00 00 06 03 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 0B 00 00 00 00 00 00 04 0B 00 00 00 01 00 05 08 05 00 03 00 03 00 00 00 01 01 04 01 0F 00 00 68 F7
- F0 44 03 02 70 01 40 02 01 00 00 08 00 02 00 02 00 02 00 02 00 00 00 00 00 00 00 00 00 00 00 06 00 02 00 00 04 01 04 00 00 06 03 00 00 08 00 06 08 02 00 02 04 01 04 00 00 06 03 00 00 08 00 07 00 02 00 00 04 01 04 00 00 06 03 00 00 08 00 07 08 02 00 00 04 01 04 00 00 06 03 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 0B 00 00 00 00 00 00 04 0B 00 00 00 01 00 08 08 08 00 03 00 03 00 00 00 01 01 04 01 0F 00 00 42 F7
- F0 44 03 02 70 01 40 02 01 00 00 08 00 02 00 02 00 02 00 02 00 00 00 00 00 00 00 00 00 00 00 06 00 02 00 00 04 01 04 00 00 06 03 00 00 08 00 06 08 02 00 02 04 01 04 00 00 06 03 00 00 08 00 07 00 02 00 00 04 01 04 00 00 06 03 00 00 08 00 07 08 02 00 00 04 01 04 00 00 06 03 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 0B 00 00 00 00 00 00 04 0B 00 00 00 01 00 08 08 08 00 03 00 03 00 00 00 01 01 04 01 0F 00 00 42 F7

---

<div class="post-metadata">

**Author:** ![NewIgnis](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/newignis/32/767_2.png) [@NewIgnis](https://forum.electra.one/u/NewIgnis)\
**Post date:** [December 14, 2024, 2:28pm UTC](https://forum.electra.one/t/casio-vz-checksum-calculator/3445/8 "2024-12-14T14:28:01Z")

</div>

Iim not a programmer myself, so also Github is a bit unfamiliar, but I found these traces to a VZ and a CZ editor. If someone can retrieve the checksum constructor out of their voice edit logic, I’ll set it up in lua and test it…

> **[GitHub - riban-bw/vzeditor: Editor for Casio VZ1 / VZ10 synthesizer](https://github.com/riban-bw/vzeditor)**
>
> Editor for Casio VZ1 / VZ10 synthesizer

> **[GitHub - coffeeshopped/casio-cz-editor: A patch editor for some of the Casio CZ family of...](https://github.com/coffeeshopped/casio-cz-editor)**
>
> A patch editor for some of the Casio CZ family of synthesizers, written in Max.

---

<div class="post-metadata">

**Author:** ![oldgearguy](https://avatars.discourse-cdn.com/v4/letter/o/f4b2a3/32.png) [@oldgearguy](https://forum.electra.one/u/oldgearguy)\
**Post date:** [December 14, 2024, 3:16pm UTC](https://forum.electra.one/t/casio-vz-checksum-calculator/3445/9 "2024-12-14T15:16:29Z")

</div>

Here is the checksum code

```auto
wxByte VZSysex::Checksum(wxByte* pData, unsigned int nSize, wxByte nChecksum)
{
    wxByte nSum = nChecksum;
    for(unsigned int nIndex = 0; nIndex < nSize; nIndex+=2)
        nSum += DecodeByte(pData + nIndex);
    return (0 - nSum) & 0x7F;
}

wxByte VZSysex::DecodeByte(wxByte* pCursor)
{
    return (*(pCursor) << 4) | (*(pCursor + 1));
}

```

and here is the code that validates the Casio sysex header:

```auto
bool VZSysex::Validate(bool bFix, unsigned int nSubheaderSize, bool bChecksum)
{
    m_bModified = false;
    unsigned int nPos = 0;
    m_bModified |= ValidateByte(m_pSysEx + nPos++, 0xF0, bFix);
    m_bModified |= ValidateByte(m_pSysEx + nPos++, 0x44, bFix);
    m_bModified |= ValidateByte(m_pSysEx + nPos++, 0x03, bFix);
    m_bModified |= ValidateByte(m_pSysEx + nPos++, 0x00, bFix);
    m_bModified |= ValidateByte(m_pSysEx + nPos++, 0x70, bFix); //!@todo Allow different MIDI channel [0xF0 - 0xFF]
    if(bChecksum) //!@todo Checksum created before derived classes run validate
        m_bModified |= ValidateByte(m_pSysEx + nPos++ + nSubheaderSize + m_nPayloadSize, Checksum(m_pSysEx + 7, m_nPayloadSize), bFix);
    m_bModified |= ValidateByte(m_pSysEx + nPos++ + nSubheaderSize + m_nPayloadSize, 0xF7, bFix);
    return m_bModified;
}

```

---

<div class="post-metadata">

**Author:** ![NewIgnis](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/newignis/32/767_2.png) [@NewIgnis](https://forum.electra.one/u/NewIgnis)\
**Post date:** [December 14, 2024, 3:36pm UTC](https://forum.electra.one/t/casio-vz-checksum-calculator/3445/10 "2024-12-14T15:36:22Z")

</div>

I think I start to see the logic: the checkSum is a standard one , but NOT on the sysEx 7-bit 672 byte payload, but rather on the internal Casio 8-bit 336 byte payload. Luckily I’ve kept both in sync in lua. Need to check further. Thanks you’ve set me on a good track 🙂

---

<div class="post-metadata">

**Author:** ![oldgearguy](https://avatars.discourse-cdn.com/v4/letter/o/f4b2a3/32.png) [@oldgearguy](https://forum.electra.one/u/oldgearguy)\
**Post date:** [December 14, 2024, 3:54pm UTC](https://forum.electra.one/t/casio-vz-checksum-calculator/3445/11 "2024-12-14T15:54:49Z")

</div>

Yes, that makes sense given your other tests. Just a bit more work on your part.

---

<div class="post-metadata">

**Author:** ![NewIgnis](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/newignis/32/767_2.png) [@NewIgnis](https://forum.electra.one/u/NewIgnis)\
**Post date:** [December 14, 2024, 4:33pm UTC](https://forum.electra.one/t/casio-vz-checksum-calculator/3445/12 "2024-12-14T16:33:06Z")

</div>

It works 🙂  
Now I can start changing sounds on the Casio

---

<div class="post-metadata">

**Author:** ![Hardingmal](https://avatars.discourse-cdn.com/v4/letter/h/57b2e6/32.png) [@Hardingmal](https://forum.electra.one/u/Hardingmal)\
**Post date:** [December 18, 2024, 11:30am UTC](https://forum.electra.one/t/casio-vz-checksum-calculator/3445/13 "2024-12-18T11:30:37Z")

</div>

Are you working on the VZ1 (or I guess VZ10M) by any chance? If so I have a VZ1 here I can test with

---

<div class="post-metadata">

**Author:** ![NewIgnis](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/newignis/32/767_2.png) [@NewIgnis](https://forum.electra.one/u/NewIgnis)\
**Post date:** [December 18, 2024, 8:42pm UTC](https://forum.electra.one/t/casio-vz-checksum-calculator/3445/14 "2024-12-18T20:42:42Z")

</div>

Yes, indirectly. Check it out here.

> [@Casio VZ-8M, VZ-1 & VZ-10M](https://forum.electra.one/t/casio-vz-8m/1265/26):
>
> NEW VERSION 4 CASIO VZ 8M - now available for testing [https://app.electra.one/preset/lR8oqPFHRHoflcKuHo63](https://app.electra.one/preset/lR8oqPFHRHoflcKuHo63) Full Patch parsing is present on the patch and it allows you to change all voice parameters (except effects), including the modular ones slight_smile Controls have been moved a bit though. From version 3 to version 4 some 80 lines of code have been added. I do hope it’ll work on Mk1. (Next version will contain ‘harmonic’ parameters and Effects settings - display only). I hope I’m hal…

I have a VZ-8M, but this preset should for a great deal on a VZ1 or a VZ10 since the sysex is pretty similar. If you care to join, let it be known in that other thread.

---

<div class="post-metadata">

**Author:** ![kiwigrass](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/kiwigrass/32/4983_2.png) [@kiwigrass](https://forum.electra.one/u/kiwigrass)\
**Post date:** [December 19, 2024, 11:07pm UTC](https://forum.electra.one/t/casio-vz-checksum-calculator/3445/15 "2024-12-19T23:07:57Z")

</div>

I know you have figured it out for the voice patch data, but I found this info on a VZ website from the late 1999s and thought it might be useful to you for the operation memory data part:

> There is a checksum on the end of every block of voice patch data (336 bytes) and on the end of every block of Op patch data (100 bytes).

> To get the checksum, add up every byte in that block, take the last seven bits (ie MOD 128) then subtract the answer from 128 to get your final checksum value.
