Casio Barcode Music Score Format

A few models of Casio keyboards included a barcode pen that allowed loading music into the keyboard by scanning pages of barcodes. This document describes the format of those barcodes.

The barcode pen, called the MS-1, was included with the following Casio keyboards: VL-Tone VL-5, Casiotone MT-70, and Casiotone 701. The procedure of scanning barcodes to store music in the keyboard's memory was called MS Memory. (Storing music by pressing keyboard keys and buttons was called Manual Memory.)

I do not own any of these keyboards. I have learned about the barcode format by reading the keyboard manuals, studying a type-in program from a computer magazine, and analyzing the barcodes from a video and images online. (See the Links section at the end of this document.)

Barcode format

A music piece is encoded in three sections: pitch data, length data, and chord data. Each section consists of multiple lines of barcodes.

The barcode alternates between black segments and white segments. Each segment, black or white, encodes one bit. A bit value of 0 is encoded as a thin segment (0.8 mm). A bit value of 1 is encoded as a wide segment (2.0 mm). The data is encoded in a series of nybbles (4 bit values), least significant bit first.

Note: The diagram below illustrates the color of the barcode segments (black or white), but doesn't show the correct widths.

[diagram of barcode format]

Header

The nybbles 04 start every bar code line.

Line number

The first line of a section has a line number nybble of 0, each successive line increments the line number by one.

Data type

The data type nybble is only present on the first line of a section.

8 = Pitch data
4 = Length data
2 = Chord data

Data

The data is stored in pairs of nybbles. Because a nybble value of F is used to mark the end of the line, the data never contains an F nybble.

Pitch data

In the pitch section, each nybble pair in the data stores a pitch, rest, or other event.

00 = rest
1x = C
2x = C# / Db
3x = D
4x = D# / Eb
5x = E
6x = F
7x = F# / Gb
8x = G
9x = G# / Ab
Ax = A
Bx = A# / Bb
Cx = B
D0 = accompaniment start (or rhythm start on the VL-5)
E0 = return 1 ||: :||

x = octave (4, 5, 6, or 7)

I haven't found an example of the return 2 1. event in barcode.
The end event doesn't seem to be stored in the barcode.
The VL-5 doesn't have repeat buttons, so I don't know how the VL-5 responds to repeat events in the barcode.

Length data

In the length section, each nybble pair in the data stores the duration of an event in units of 12ths of a beat. The first nybble is the least significant nybble. In other words, the duration value in decimal is (second nybble)×16 + (first nybble).

Remember that the nybble F can't appear in the data, so some durations can't be stored. Fortunately, beat, half-beat, and third-beat multiples never fall on the invalid values, and quarter-beat multiples only occasionally fall on the invalid values.

Every event in the pitch data has a corresponding duration in the length data. Notes and rests have non-zero durations. Other events (accompaniment start, return 1) have zero durations.

When two successive notes have the same pitch, a short rest is typically stored between them so that the keyboard key LED will turn off for a noticeable time.

Chord data

(not accepted by the VL-5)

In the chord section, each nybble pair in the data encodes a chord for one or two chord steps.

As explained in the manuals, the chord positions are fixed at the first and third beat of every measure.
When a 4-beat rhythm is selected: ONE two THREE four, ONE two THREE four.
When a 3-beat rhythm is selected: ONE two THREE, ONE two THREE.

If there are repeats stored in the Pitch data, chord data is stored for each time the repeated section plays.

1x = C
2x = C# / Db
3x = D
4x = D# / Eb
5x = E
6x = F
7x = F# / Gb
8x = G
9x = G# / Ab
Ax = A
Bx = A# / Bb
Cx = B

x = chord type
9 = major (two steps)
A = minor (two steps)
B = seventh (two steps)
C = minor seventh (two steps)
E = diminished (two steps)

The chord type values I've confirmed so far are all in the range 9 to E, and indicate two chord steps are used. I suspect the lower values indicate the same sequence of chord types taking one step.

I don't yet know the values for the other two chord types mentioned in the manuals, major seventh and augmented.

The manuals also mention a tacet chord type that turns the chord off (leaving only rhythm accompaniment), but I don't know what barcode value it uses, if any.

End of line flag

The end of the line is signaled by an F nybble.

Last line bit

If there are more lines, this bit is 0.
If this is the last line, this bit is 1.

Check nybble

Sum all the nybbles from the line number to the end of line flag, plus the last line bit, plus the check nybble, modulo 16 decimal. For the first line, the sum should equal zero. For the other lines, the sum should equal the check nybble of the previous line.

Trailer

An optional trailer of one or more pairs of zero bits may appear.

Example data

Here are the all of the barcode nybble values I transcribed during my analysis: barcode-transcriptions.txt

Here is the decoded information for the first phrase of Cielito Lindo (from the demonstration video I found on YouTube).

pitch datalength dataeventduration (units)duration (beats)
D000accompaniment start00
0009rest14412
E000return 1 ||:00
1590C593/4
0030rest31/4
15C0C5121
A461A4221 5/6
0020rest21/6
C4C0B4121
84C0G4121
E000return 1 :||00
E000return 1 :||00
64C0F4121
3403D4484
00C0rest121

chord data: 19 8B 19 8B 19 8B 19 8B 19 8B 3C 8B

19 = C major (two steps)
8B = G seventh (two steps)
3C = D minor seventh (two steps)

Links

Documents

Casio Keyboard Manuals
generror.wordpress.com/2010/07/04/casio-keyboard-manuals/

Casio VL-Tone VL-5 Operaton Manual
Casio Casiotone MT-70 Operation Manual
Casio Casiotone 701 Operation Manual

Music on Spec from Your Spectrum issue 4 (June 1984)
www.users.globalnet.co.uk/~jg27paw4/yr04/yr04_29.htm

An article about interfacing a Spectrum computer to a Casio keyboard barcode port. The barcode values are partially described in this article, but the barcode segment format and the checksum algorithm aren't described. The included program is difficult to analyze and only produces one-line barcodes, so the format of the last line bit and check nybble weren't obvious.

Re: Casiotone CT-701 from Circuitbenders Forum
www.circuitbenders.co.uk/forum/?topic=1765.0#msg11278

This post on a circuit bending site provides a few details of the barcode format, likely gathered from the Your Spectrum article and examination of some barcodes. Some of the details posted have the wrong nybble endianness, but the information does include the barcode segment widths which I haven't seen elsewhere.

Casio VL-Tone VL-5 from Warranty Void
weltenschule.de/TableHooters/Casio_VL-5.html

Mentions that attempting to scan an MT-70 chord barcode on the VL-5 just results in an error sound, but the VL-5 accepted the melody barcodes from the same MT-70 score.

Casio Casiotone MT-70 from Warranty Void
weltenschule.de/TableHooters/Casio_MT-70.html

Mentions that the VL-Tone VL-5, Casiotone MT-70, and Casiotone 701 are known to have the barcode reader.

Video and images

Casio MT70 Barcode Reader Demo (YouTube video)
www.youtube.com/watch?v=iEQFkGJ7tIs

Cielito Lindo. This is the main example I examined. I transcribed all of the barcodes visible in the video and compared the stored data to the resulting performance.

500 miles www.flickr.com/photos/matrixsynth/381326416
Casio VL-Tone VL-5 box www.flickr.com/photos/synx508/4711455784/
Sonata yonoise.tumblr.com/post/75111180/cool-shit-i-have-that-you-dont-no-17-casio

I transcribed two or three complete barcode lines from each of the images to help confirm the checksum algorithm.


Home > Articles > Casio Barcode Music Score Format

Robert Hart
Posted May 25, 2011