New Hampshire Country Dance Fiddle Tunes Website

About the abc Document


The abc Document III: More on The Tune Body

On the previous page we looked at the first line of code in the tune body. Now we'll look at the remainder of the tune body and a few additional aspects of the tine body that come up..

Here we continue from the previous page. Now that the tune has been defined we can look at how the music itself is presented.
There are two parts to the section on abc notation. This is part of the Detail section, intended for people interested in using abc notation. Use the buttons above to navigate the abc pages.
Important Note: This page works best on a screen at least 768 pixels wide. With an iPhone or any other small screen you may find it helpful to switch between portrait and landscape orientation for best results. Please use the abc Notation menu above to navigate the abc pages.

The Tune Body II

On the previous page we looked at the basics of how abc notation works using notation for the first line of the march On the Road to Boston as an example. Here we'll look at the entire tune, and in the process examine a couple other aspects of abc notation.

Here is the entire tune body:

A |\
"D" f2 fe/2f/2 | "D" gf ed | "A7" cd ef | "D" dA FA  |
"D" f2 fe/2f/2 | "D" gf ed | "A7" cd ef |1 "D" d2 d :|2 "D" d2 d2 ||
|: "D" "_Alt. Chords:"\
         a2 a(g/2a/2)      | "D""_B7" ba gf |\
"G""_Em" g2 g(f/2g/2)      | "G""_A7" ag fe |
"D""_D" f2 "_D7"f(e/2f/2)  | "D""_G" gf "_G#dim"yed |\
"A7" cd ef |1 "D" d2- d2  :|2 "D" d2 d |]

You may notice that at the beginning of the A part and of B1 and B2 I took the lead-in notes and put them on their own lines. That's because it's easier to read the code when it's formatted neatly, which includes lining up the bar lines. Putting the partial measures on separate lines makes that easier. This is a particularly difficult tune to format neatly because the measures of the B part take up so much more room than the measures of the A part. I decided to use a comment line between the parts, and to line up each part separately.

Some people can sight-read directly from abc code. I don't and have no interest. But it's a whole lot easier to work with abc code if it's neatly formatted. I find that if presented with code that's poorly formatted it can be much harder to understand. To illustrate, here's the first line of code with no effort to format it neatly; not even a monospaced font.

A|"D"f2 fe/2f/2|"D"gf ed|"A7"cd ef|"D"dA FA|

As I'm sure you can imagine, looking at several lines of unformatted code doesn't do wonders for the eyes!

Here's what an abc interpreter will produce from the code above.

If you look over the sheet music and the code, you should be able to see the correspondence. Here are a couple more things worth noting.

  • Ties. In the first ending of the B part, two D notes are tied together. That's accomplished with a hyphen: d2- d2. The hyphen must follow the first note immediately with no spaces in between. (This is for purposes of demonstration only; if I really wanted it to read that way I could have used a half note.)
  • Slurs. In the B part I show each pair of sixteenth notes as slurred. That's accomplished by putting parentheses around the notes: e.g. (f/2g/2). Again this is for demonstration purposes; I'd say the slurs are entirely optional.
  • Beams. If two or more notes with flags are written with no space between them, they will be beamed. If there's a space between the notes, each has its own flag. Thus in the second measure of the A part gf ed results in two sets of beamed notes but gfed would result in all notes in the the measure being beamed.
  • Putting comments below the staff. Notice the alternate chords for the B part, for example, "_D". That's actually an annotation, and isn't recognized as a chord by abc software. The underscore character (_) causes the annotation to be below the staff. To place it above the staff use "^D". The < and > characters put annotations to the left or right of the note. Thus, "<(" ">)" C2 would put parentheses around a C quarter note.
  • The Mysterious y. Did you notice the y right after the G# diminished chord? It's obviously not a note. Its purpose is to give some extra space between notes when needed.

On the Next Page. We'll look at using the File Header for formatting the tune. It can be complex, but once you know how to use it, it's possible to accomplish surprisingly complex formatting of tunes.