GestureSynth.me

Music calculator

MIDI Sample Dump Checksum Calculator

Compute the MIDI Sample Dump Standard data-packet XOR checksum from device ID, packet number and exactly 120 seven-bit payload bytes.

midi sample dump checksum calculator

MIDI Sample Dump Checksum Calculator guide

Use this calculator on a MIDI 1.0 Sample Dump Standard data packet. Enter the device ID and packet number as decimal integers. Paste the payload as pairs of hexadecimal digits separated by spaces or commas. Include the transmitted padding when checking the final packet of a sample dump.

Play the instrument ↑
Default result
7C hex checksum

Calculation and units

The checksum begins with the exclusive OR of 7E, the device ID, 02 and the packet number. XOR all 120 data bytes into that accumulator. All contributing values fit in seven bits, so the resulting checksum is a single seven-bit byte. The initial F0 and final F7 delimiters and the checksum field itself are outside the calculation.

Worked examples

Select a named case in the Worked example control to load these values. You can then edit any input to compare the result.

All zero payload

Device ID (decimal) = 0 · Packet number (decimal) = 0 · 120 payload bytes (hex, or HH*count) = 00*120.

7C hex checksum. Decimal 124. Header 7E 00 02 00 reduces to 7C. Payload XOR 00. Place 7C after the payload and before F7.

An entire block of zeros leaves the XOR of the header unchanged. This packet is useful for checking which fixed protocol bytes enter the accumulator.

One altered byte

Device ID (decimal) = 0 · Packet number (decimal) = 0 · 120 payload bytes (hex, or HH*count) = 00*119 01.

7D hex checksum. Decimal 125. Header 7E 00 02 00 reduces to 7C. Payload XOR 01. Place 7D after the payload and before F7.

The final payload byte flips the least significant bit. Compare the checksum with the zero block before changing either header control.

Change device ID

Device ID (decimal) = 1 · Packet number (decimal) = 0 · 120 payload bytes (hex, or HH*count) = 00*120.

7D hex checksum. Decimal 125. Header 7E 01 02 00 reduces to 7D. Payload XOR 00. Place 7D after the payload and before F7.

A device address participates in the checksum even though it precedes the sample bytes. Routing changes can invalidate an otherwise identical packet.

Last packet number

Device ID (decimal) = 0 · Packet number (decimal) = 127 · 120 payload bytes (hex, or HH*count) = 00*120.

03 hex checksum. Decimal 3. Header 7E 00 02 7F reduces to 03. Payload XOR 00. Place 03 after the payload and before F7.

The decimal packet counter reaches its seven-bit maximum here. The next packet wraps to zero and receives its own newly computed checksum.

Even repeated payload

Device ID (decimal) = 3 · Packet number (decimal) = 5 · 120 payload bytes (hex, or HH*count) = 7F*120.

7A hex checksum. Decimal 122. Header 7E 03 02 05 reduces to 7A. Payload XOR 00. Place 7A after the payload and before F7.

Identical pairs cancel in exclusive OR. An even run of the same byte leaves the variable header fields as the only changed contributions.

Two odd runs

Device ID (decimal) = 2 · Packet number (decimal) = 9 · 120 payload bytes (hex, or HH*count) = 12*59 2A*61.

4F hex checksum. Decimal 79. Header 7E 02 02 09 reduces to 77. Payload XOR 38. Place 4F after the payload and before F7.

Each odd run leaves one copy of its byte value in the payload XOR. Verify the two decimal run counts add to the required block length.

Interpreting the result

Compare the two-digit answer with the byte immediately before F7 in your capture. The tool reports the header and payload contributions separately to help isolate errors. A star followed by a decimal count repeats the preceding byte. For example, 00*118 12 34 represents 118 zeros followed by hexadecimal 12 and 34.

Measurement and model limits

Work with the seven-bit data as it appeared on the wire. Raw audio file bytes may require conversion and packing first. This routine covers the SDS data packet only. A dump header, handshake, manufacturer-specific message or a different universal sub-ID can have different field positions and validation rules.

Answers before you play

Common questions

Why does a long even run cancel?

A value XORed with itself is zero. Two identical contributions cancel regardless of where they occur, so matching checksums cannot guarantee identical data.

Can I put the entire SysEx message in the payload field?

Enter just the 120 bytes between the packet number and its checksum. Set the two variable header bytes using the separate decimal controls.

How do I enter a packet counter displayed as hexadecimal 10?

Use decimal 16 in the counter field. Payload fields retain hexadecimal notation, so a payload token of 10 already represents sixteen.

Does this send anything to the sampler?

The result is a local byte calculation. Compare it with a capture or copy the byte into a packet prepared in your own MIDI editor.