abc Notation - Music, Computers and Very Little Grief
Created | Updated May 17, 2013
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 musicians themselves are to blame; after all, in the West until perhaps the 8th Century, it was customary to learn a tune just 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 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 ASCII3 character set to represent conventional musical notation4. Although the original intention was to use computers to share folk music, as tends to happen with new technical innovations it has now been stretched almost to breaking-point by enthusiastic users. Non-standard extensions now include tablature for various fretted instruments, harmonica and diatonic accordion.
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 interpreter, whether human or machine, 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 quaver6.
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 do |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 whether abc notation can 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 - |"Em" - or noted chords can be grouped inside brackets: [CEG].
To Find Out More...
The abc Standard, version 1.6 explains all the features which an abc text file must, and also may include how to notate music in detail using abc.
The abc Convert-A-Matic is a very useful online conversion site: paste the text of an abc file into the window, click the 'Submit' button, and the page will present you with the sheet music in a few moments.
The abc home page, home of all things abc-related, including links to the growing support base of shareware and freeware for abc notation.