abc Notation - Music, Computers and Very Little Grief
Created | Updated Oct 17, 2006
Music is a universal language. Unfortunately it is better at expressing emotions than ideas, so it probably won't help you settle that dispute about who has the right of way at that junction no matter how much you blow your horn1.
Perhaps the musicians themselves are to blame; after all, in the west until perhaps the 8th century it was customary to learn a tune by listening to somebody else play it. The whole problem of writing down the notes played by various instruments has taken a lot longer to solve than that of writing down ideas in the form of words2 so it is hardly surprising that when the boffins designed the first computers they were more concerned with number crunching, and later word processing, than the possibility of using computers as a means of sharing sheets of music in a readable form.
Late in 1991 a rather clever musician who also happened be a university lecturer had the embarrassingly sensible idea of using the ASCII character set3 to represent conventional musical notation. 4 For each of the notes from middle C to the B above middle C, capital letters are used - C, D, E, F, G, A, B being the first octave, then lower case letters take over; c, d, e and so on until a complete octave above middle C is represented. The only exception is the rest note, in which case a lower-case z is always used.
'OK smartypants', you ask, 'what happens when you want notes more than two octaves above middle C?'
The answer is that you add a prime (the thing that you always thought was a single quotation mark on the keyboard) after the note letter; c' d' e'. And add another prime for the next octave up. Get the idea?
'Hey! this is pretty cool!' you say. 'What about octaves below?'
To write notes an octave lower than middle C you use capitals followed by a comma; B, D, etc. and by this point hopefully you have grasped the essentials because otherwise we will soon have a punctuation problem.
By now you will probably want to know how a complete tune is notated, so let's examine an example. This is the ABC form for the folk tune 'Paddy O'Rafferty'.
X:1
T:Paddy O'Rafferty
C:Trad.
L:1/8
M:6/8
K:D
|:dff cee|def gfe|dff cee|dfe dBA|
dff cee|def gfe|faf gfe|1 dfe dBA:|2 dfe dcB||
|:~A3 ~B3|gfe fdB|AFA B2c|dfe dcB|
~A3 ~B3|efe efg|faf gfe|1 dfe dcB:|2 dfe dBA||
|:fAA eAA|def gfe|fAA eAA|dfe dBA|
fAA eAA|def gfe|faf gfe|dfe dBA:|
The notation consists of two distinct parts. The head, which contains all the information about the structure of the tune, and the body, which contains notes, barlines, some ornaments (the ~ symbol)5 and some repeat barlines. The first line, X:1 tells the interpreter6
that this is the first tune in the database file.
The second line: T:Paddy O'Rafferty, is the common title of the tune.
The X: and T: lines are always, respectively, the first and second lines of the notation, in compliance with the abc standard 1.6.
C:Trad. tells the interpreter that the composer, as far as we know, is Trad. In other words, whoever notated this learned it as a traditional tune, and either couldn't be bothered, or never managed to find out who first wrote it down.
L:1/8 means the default Length of each note will be an eighth note, or quaver7.
M:6/8 is the metre. So the tune is in 6/8 time, easy-peasy hey?
K:D - the key signature, and always the last line (abc standard 1.6) in the head section of the tune.
Now we come to the tune itself. The repeat barlines are fairly easy to spot, but for people who don't read music at all, they look like '|:' and ':|'. 'So, why', you ask, 'are the notes in groups of three?'. By grouping them together, the interpreter knows that they are joined by a beam which ends at the first space. 'And what does |1 and |2 stand for?', those are respectively first, and second endings.
If your appetite for music in abc notation is now thoroughly whetted you will want to know 'Can abc notation represent chords?'. The answer is 'yes!'. Simple guitar chords can be written between quotation marks at the beginning
of the bar to which they apply. i.e. |"Em"... or noted chords can be grouped inside brackets [CEG].
with the priorities of musicians, which usually work out along the lines of (1) Sex. (2) Beer. (3) Music.3ASCII - the abbreviation for American Standard Code for Information Interchange.4Although the original intention was to use computers to share folk music, as tends to happen with new technical innovations, it has been stretched almost to breaking point by enthusiastic users. Non-standard extensions now include tablature for various fretted instruments, harmonica and diatonic accordion.5In this case, rolls. Sorry, no butter.6whether human or machine,7The note that graphic designers seem to love, with the little wavy tail.