Monday, December 17, 2012

ABC Music Notation

There are many music-writing software packages on the market, Sibelius being the most popular for classical musicians and ubiquitous through schools and universities. There are freeware applications that work with varying degrees of sophistication as well. These products are all well and fine for the professional musician who needs to provide perfect partitur for orchestras or ensembles, extract and print individual parts, and "play in" their compositions directly from a keyboard onto the music stave. But many of us just need a simple solution to jot down a tune so we can remember it, store it and find it again and maybe email it to our friends or band members. ABC is the simple system developed for just this.

Like a lot of folk musicians, I've been using the ABC notation system for many years; for collecting and learning tunes and songs, working out chords and harmonies, recording lyrics and sharing or collaborating on arrangements. I recommend it to anyone who can understand standard music notation even slightly and has a computer. Let's start with a bit of background.


Using letters as a shorthand notation for music has been around for over 100 years. It's easy to quickly jot down EDC, EDC, to remind you how "Three Blind Mice" goes - but it becomes a bit trickier to show rhythm, key, rests and the like without recourse to standard music notation.

With the arrival of the computer era, the ASCII (standard QWERTY) keyboard became the most common data set for transmitting information, whereas music manuscripts could only be transmitted as graphics files (images) and as such, were large and unwieldy and could not be edited.

In the 1980s Chris Walshaw began writing out fragments of folk/traditional tunes using letters to represent the notes before he learned standard Western music notation. He was using a programmer's text editor and saw the power of being able to have a text language to record and distribute tunes. He developed the first iteration of the language we call ABC Notation.


While there are many people who can read ABC notation in its "native" form (at its basic level it's easy to understand), this is not its primary purpose. It's important to remember that ABC Notation is a system, not a programme. There are many programmes that "render" the ABC file into standard music notation, or turn them into sound files. Because the ABC file is ordinary keyboard characters it can be emailed, stored in a text file or database, searched on for specific terms or phrases and file sizes are kept very small. One simple text file (or .abc file) can hold hundreds or thousands of tunes.

Let's have a look at a simple tune in ABC notation, Hewlett by O'Carolan:

X: 1
T: Hewlett
C: O'Carolan
M: 3/4
K: D
AF|D2 DE FG|AB c2 A2|d2 f2 fg|fe d3 B|A2 F2 F2|G3 B AG|AF D2 D2|1 D4:|2 D6|]
|:A2 F2 AB| A2 F2 AB| A2 d2 d2|dc BA GF|G2 E2 GA| G2 E2 EF|GF GB AG|AF D3 E|
FE F2 G2|AB c2 A2|fe fg ag|fe d3 B|A2 F2 F2|G3 B AG|AF D2 D2| D6:|

You can probably guess what much of it means by just looking at it. The first 5 lines are the headers which tell us (or more importantly, tell the rendering programme) something about the tune.

The X: field is an indexing value (it can be any number you choose, for quick reference when you have many tunes in one file). It is the only field that is compulsory (your ABC code won't work in rendering programmes without it).
The T: is the title, C: is the composer, M: is the time signature and K: is the key. The rest of the code is the notes and barlines. Let's turn it into music:

  • Copy the code - everything from X: 1 to D6:| 
  • Go here: (just one of many online converters),
  • Paste it into the text window. 
  • Scroll down to the button "Submit" and click that.

After a moment or two the programme will return the music in standard notation as an image. Directly below this are two links - midi and pdf. Clicking on the midi link will play the tune on your sound card (or ask you to download it, and then play it); the pdf link will give you a printable page of music.

Now, let's look at the notes themselves. Here's the first line:

AF|D2 DE FG|AB c2 A2|d2 f2 fg|fe d3 B|A2 F2 F2|G3 B AG|AF D2 D2|1 D4:|2 D6|]

  • The notes from middle C to the B above are capital letters, the notes above B are lower case (we can go higher and lower with other symbols).
  • F and C notes are actually F sharp and C sharp - but we don't need to indicate this because we have declared that the key signature is that of "D major" in the header (K: D).
  • Default note length is an eighth-note, and that to make a quarter-note we add the multiplier 2 after the note name, 3 for a dotted-quarter, 4 for a half-note etc. 
  • Bar lines are represented by the symbol | (shift, backslash), repeats |: and :| and first and second time bars as |1 and |2 etc. Double bar line || or |]
  • Spaces are not required, but are added for clarity and grouping - eg eighth-notes grouped without spaces will be beamed when rendered.

You can change things in the editor window and press submit again and see what effect they will have. Some things will cause the rendering to fail, but most things will have the effect you expect.

There is much that you can do in ABC including chords, multiple parts, lyrics and more. There are many hundreds of databases containing thousands of tunes in ABC format all over the internet as well as many tutorials and references on ABC Notation. Once you've mastered the basics of the notation, you can collect and share the tunes you like, make your own database or write you own tunes.

Other links and references:
Mike Moroney

No comments: