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. In 2014, a reader sent me some additional data values and information. (See the Links section at the end of this document.)
The barcode alternates between black segments and white segments. The barcode pen works by emitting infrared light and detecting if it is reflected back. The white segments need to reflect infrared light and the black segments should not reflect infrared light. You can even send infrared light directly into the pen to simulate a barcode.
Each barcode 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 exact sizes of the segments can vary a little as long as the thin to wide ratio is 1:2.5.
For most of the barcode, the bits are interpreted as nybbles (groups of 4 bits), least significant bit first. The last line bit is a solo bit. The optional trailer is pairs of zero bits.
A music piece is encoded in three sections: pitch data, length data, and chord data. Each section can consist of multiple barcode lines.
The format of a barcode line is shown below.
The nybbles 04 start every bar code line.
The first line of a section has a line number nybble of 0, each successive line increments the line number by one.
The data type nybble is only present on the first line of a section.
8 = Pitch data
4 = Length data
2 = Chord 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. (Note: In the barcode examples I have analyzed, the data section never contains an F nybble. However, Andy Wood's document includes a chord type value of F, which suggests the second nybble in each pair can be an F.)
In the pitch section, each nybble pair in the data stores a pitch, rest, or other event.
00 = rest
01 = return 2 (1st ending)
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 (repeat start/end)
x = octave (4, 5, 6, or 7)
The end event doesn't seem to be stored in the barcode.
The VL-5 manual doesn't describe any repeat events using manual entry, so I don't know if the VL-5 responds to repeat events in the barcode.
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, return 2) 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.
(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
0-7 = one step
0 = tacet (one step)
1 = major (one step)
2 = minor (one step)
3 = seventh (one step)
4 = minor seventh (one step)
5 = major seventh (one step)
6 = diminished (one step)
7 = augmented (one step)
8-F = two steps
8 = tacet (two steps)
9 = major (two steps)
A = minor (two steps)
B = seventh (two steps)
C = minor seventh (two steps)
D = major seventh (two steps)
E = diminished (two steps)
F = augmented (two steps)
The chord type values 9, A, B, C, and E were demonstrated in the Cielito Lindo example video. The other chord type values were provided from Andy Wood's document.
The end of the line is signaled by an F nybble.
If there are more lines, this bit is 0.
If this is the last line, this bit is 1.
Keep a running total (modulo 16 decimal) of all the nybbles from the line number to the end of line flag, plus the last line bit. When you get to a check nybble, do not add it to the running total, but test to make sure the running total plus the check nybble equals zero, modulo 16 decimal. Continue adding to the running total for every line in the section.
An optional trailer of one or more pairs of zero bits may appear.
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 data | length data | event | duration (units) | duration (beats) |
---|---|---|---|---|
D0 | 00 | accompaniment start | 0 | 0 |
00 | 09 | rest | 144 | 12 |
E0 | 00 | return 1 (repeat start) | 0 | 0 |
15 | 90 | C5 | 9 | 3/4 |
00 | 30 | rest | 3 | 1/4 |
15 | C0 | C5 | 12 | 1 |
A4 | 61 | A4 | 22 | 1 5/6 |
00 | 20 | rest | 2 | 1/6 |
C4 | C0 | B4 | 12 | 1 |
84 | C0 | G4 | 12 | 1 |
E0 | 00 | return 1 (repeat end) | 0 | 0 |
E0 | 00 | return 1 (repeat end) | 0 | 0 |
64 | C0 | F4 | 12 | 1 |
34 | 03 | D4 | 48 | 4 |
00 | C0 | rest | 12 | 1 |
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)
Casio Keyboard Manuals
generror.wordpress.com/2010/07/04/casio-keyboard-manuals/
Casio VL-Tone VL-5 Operation 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.
Casio Bar Codes (PDF) and e-mails by Andy G. Wood
Andy's document and e-mails added the following information:
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.
Casio MT70 Barcode Reader Demo (YouTube video, no longer available)
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 |