- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
               An Introduction to ABC Music Notation
                        by John Chambers
                       <jc@trillian.mit.edu>

Here's a simple example of ABC notation for a well-known Irish jig:

X: 1
T: The Kesh Jig
T: The Kincora Jig
R: jig
M: 6/8
L: 1/8
K: G
D \
| "G"~G3       GAB | "D7"~A3     ABd | "G"edd gdd | "D7"edB   dBA \
| "G"~G3 "(Em)"GAB | "Am"~A3 "D7"ABd | "G"edd gdB | "D7"AGF "G"G2 :|
|: A \
| "G"~B3 dBd | "C"ege "G"dBG | "G"~B3 dBG | "Am"~A3 "D7"AGA \
| "G"~B3 dBd | "C"ege "G"dBd | "C"~g3 aga | "D7"bgf  "G"g2 :|

This is fairly easy to read, and once you  understand  it,  you  can  quickly
start typing in your own tunes.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                              HEADERS

First,  there are a bunch of "header" lines that say things about the tune as
a whole.  The X:  line merely gives an index number.  If a file  has  several
tunes,  they should all be given different X numbers.  Some ABC software lets
you use the X: number to extract tunes from collections, sort of like the way
that some CD players let you pick the order of play.

The  T:   lines give titles.  This tune has two titles.  I put "The Kesh Jig"
first because, in my experience, that's the  one  that  is  the  best  known.
Printing  software  will typically show the first title in a larger font than
others, which are considered "subtitles".

The R:  line ("rhythm") says it's a jig.  This is also used by some software.
For example, f you're on a Unix-like system you could use a command like:
   grep -li "R: *jig" *.abc
to locate all the jigs in a directory of abc files.

The M: line gives the meter, 6/8 in this case.  You can use M:C and M:C|  for
the obvious "common" (4/4) and "cut" (2/2) times. You can also say M:none for
no time signature at all.

The L: line gives the basic or default length of a note.  In this case, L:1/8
says  that  a note without any time modifier is an eighth note (quaver).
This is only used in converting ABC to printed music.

The K: line gives the key.  In this case, the key is G major.  "K:  Gm" would
mean G minor. The abc standard also includes the classical modes, so that "K:
Gdor" means G dorian (one flat), and  "K:   Amix"  means  A  Mixolydian  (two
sharps).  The mode can be spelled out or abbreviated to three characters, and
minor can be abbreviated to just m.

ABC's rules say that the X: and T: lines must be first, and the  K:  line  is
the last of the header lines.  Then comes the fun part, the music.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                               MUSIC

First, if you play a melody instrument, you  can  ignore  all  the  stuff  in
double quotes. Those are called "accompaniment chords". They are to be played
on guitar or accordion or harp or whatever.  Now that you know what they are,
you  can probably understand the chords in this tune.  So we can ignore them,
and the first part of the tune is:

   D \
   | ~G3 GAB | ~A3 ABd | edd gdd | edB dBA \

The backslash means "continued on next line", and is used  to  merge  several
lines of abc into one staff. When reading, we can ignore backslashes, and the
result is:
   D | ~G3 GAB | ~A3 ABd | edd gdd | edB dBA

The  letters  A-G  and a-g are notes.  Large notes are the bottom half of the
staff, and lower case is the upper half.  The scale  actually  runs  CDEFGAB,
with C being the C below the staff, and B being the line in the middle of the
treble staff. Similarly, cdefgab is the scale from the c in the middle of the
staff  to the b above the staff.  Programmers hate this odd order of letters,
but musicians will see why it's a good idea.

A  number after a note is a note length.  So G3 means a G three times as long
as the L:  value.  In this case, it's a G of length 3/8, or a dotted  quarter
note.   You  can  also  use fractions if you wish.  So G3/2 would mean a G of
length 3/16, or a dotted eighth note.  You can omit a numerator  of  1  or  a
denominator  of 2, so G1/2, G/2 and G/ all mean the same thing, a G of length
1/16 in this tune.

The only thing left to understand  the  above  line  is  knowing  that  ~  is
notation for a "turn". It is displayed as a large ~ symbol above or below the
note, and played however you feel like playing it.

So, to translate this all into rather coarse ASCII  graphics,  here  are  the
first two bars of the above line:

                                                                 ,|
                                           ,|                  ,/ |
         |\                 ~            ,/ |     ~          ,/   |
     ----|/--#----------|--------------,/---|-|------------,/-|---|-|
         /              |            ,/ |   | |   |       |   |   | |
     ---/|-----6--------|---|-------|---|---|-|---|-------|---|-(*)-|
       / |              |   |       |   |   | |   |       |   |     |
     -/--|----------|\--|---|-------|---|-(*)-|---|-------|-(*)-----|
     (  /| \        | | |   | .     | (*)     | (*) .   (*)         |
     -\--|-/---8----|-|-|-(*)-----(*)---------|---------------------|
       \ |/         | ' |                     |                     |
     ----|----------|---|---------------------|---------------------|
         J        (*)

Wow, that was difficult to type! The ABC notation is much easier,  especially
if you're a keyboard player.  But anyone who plays any instrument should find
ABC fairly easy to type.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Let's see, what else do you need to know?  Oh, yes; in the above tune, you'll
see |:  and :| symbols.  You guessed right; these are repeat symbols.  I left
out  the |:  at the beginning, as is done in a lot of printed music.  You can
also indicate first and second endings:
    |: ...  |1 ...  :|2 ...  ||
where ...  represents any music.  The || symbol represents a double bar,  and
you  can  use  [| and |] to get the thick+thin or thin+thick styles of double
bars.  You can also use ::  in the middle of a line as a shorthand for  :||:,
that is, double bars with repeats on both sides.

There's also notation for two more octaves.  It is sort of pictorial, using a
comma (,) for "one octave down" and an apostrophe (') for "one octave up.  So
G,A,B,  are  the  three  lowest  notes on a fiddle or mandolin, and c' is the
second leger line above the treble staff.

It's also useful to be able to include rests.  The ABC symbol for a  rest  is
the letter 'z' (and note that it's lower case).  It is used just like a note,
and takes lengths in the same manner.

Something not covered in the above  example  is  accidentals.   There  is  an
obvious  problem  with  the ASCII character set:  It has a sharp sign, but no
natural or flat sign.  The solution is simple:  _G is a G flat;  =G  is  a  G
natural,  and ^G is a G sharp.  Note that this is a bit inconsistent with the
notation for keys and chords:  K:Gb and K:G# are how you indicate keys  of  G
flat  and  G  sharp;  "Gbm"  and  "G#7"  are G flat minor and G sharp seventh
chords.  But since 'b' is used for a note, it can't be  used  with  notes  to
indicate a flat.  So the pictorial _=^ symbols are used.

You  can  also  indicate  ties and slurs.  A tie (or single-note slur) can be
indicated with a hyphen.  If the above tune had started G3- GAB it would have
meant to tie the G to the G in the second group of notes.  To get a slur, put
parentheses around a group of notes.  Thus, in the above example,  you  might
indicate a generic jig bowing by writing:
   D | ~G2G (GA)B | ~A2A (AB)d | (ed)d (gd)d | (ed)B (dB)A |

A few words about spacing:  I've used more spaces in the above examples  than
you  really need.  About the only spaces that are needed within the music are
the ones that separate groups of notes.  This is used by abc display or print
programs  to  determine  how notes are beamed together.  If the third bar had
been |eddgdd|, the result would be six notes all  beamed  together.   If  you
write |ed dg dd| you would get a waltz-type beaming, with three groups of two
notes each.  |edd gdd| gives two groups of three notes each.

Spaces around the bar lines aren't needed, but they help a lot  if  you  want
your  ABC to be readable by humans.  Also, the header lines don't need spaces
after the colons, but they add slightly to readability.

There are some other useful header  lines.   C:   is  used  to  indicate  the
Composer.  O:  is used to comment on the Origin. S: is used to give a Source.
B: is used to list Books where the music can be found.  D:  means discography
(recordings).  H:  is used for Historical notes.  N: is used for random other
notes. And you should put your name and email address on a Z:  line, which is
used to indicate who did the transcription.  (T:  was already taken.) You can
see O:Trad in a lot of old tunes.  And Q:120 or  Q:1/4=110  may  be  used  to
indicate a metronome setting.

There's more to ABC, but this is all you  need  to  know  to  read  or  write
typical  folk tunes.  Now go to your favorite editor and type in a few tunes.
And check out the ABC home page:
   http://abcnotation.com/
You'll find pointers to lots of software and music collections there.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

This is the second file from my set of ABC documents.  Some others:
  http://trillian.mit.edu/~jc/music/abc/doc/ABCtrivial.txt
  http://trillian.mit.edu/~jc/music/abc/doc/ABCintro.txt    (this file)
  http://trillian.mit.edu/~jc/music/abc/doc/ABCprimer.html
  http://trillian.mit.edu/~jc/music/abc/doc/ABCtut.html