Body Large (20/130%/14)
Body Large (20/130%/14) #2

Using abc Notation for Writing Out Fiddle Tunes

About abc Notation III ~ The Tune Body

Here we continue looking at how abc notation works. On the previous page we looked at the tune header; now we look at the body of the tune.

Important Note: This page works best on a screen at least 768 pixels wide. You should hold an iPhone or any other small screen in landscape orientation for best results.

Review of the tune header

We'll need it for reference so here it is again.

  • In abc notation a percent sign indicates a comment: everything after that is for the benefit of the humans, and is ignored by the computer.

X:1                   % tune number

T:Smash The Windows   % title

T:Roaring Jelly       % another title

M:6/8                 % meter

L:1/8                 % default note length

R:Jig                 % rhythm

K:D                   % key


The tune body: First line

After the header is the tune body, which is the actual melody and optionally chords. Let's start with the first line of abc code:


 A | "D" DED F2A | "D" d2f "A" ecA  |\

"G" G2B "D/F#"  F2A | "Em" E2F  "A7" GFE |

That may look confusing, but it's actually pretty easy once you get used to it:

  • The vertical lines are bar lines. The letters in quotation marks are the chords. The other letters and numbers are the melody notes.
  • So the first full measure has the notes D, E and D. Each is the default length, an eighth note.
    • Note that the piano player would play a D chord for this measure.
  • Then it has an F#. The sharp is not written in as it's implied by the key signature. Next is an A.
    • The F# is followed by a 2 so it's twice the default length: a quarter note.
  • In the second measure there are lower case letters. These represent notes an octave above equivalent upper-case letters. There's also a new chord for the second half of the measure.
  • It doesn't all fit on one line. The backslash (\) tells the abc interpreter to keep it together with what's on the next line when it converts it to notation.
  • In the third measure notice the chord in the middle is "D/F#". This means a D chord, but to play an F# bass note with the left hand.

The end result looks like the following:

In addition to viewing the sheet music, most abc software can also play back the tune. That's useful both for proofreading a tune you've written out and for learning a tune. Those of us who can't always tell what a tune sounds like from the written notation can use the playback to find out.

 The tune body: The rest of the tune

Here is the rest of the body of the tune.

  A |\

"D" DED F2A | "D" d2f "A" ecA  | "G" G2B "D/F#"  F2A | "Em" E2F  "A7" GFE |

"D" DED F2A | "D" d2f "D7" ecA | "G" gfe "A7" cAc    | "D"  d3 - d2 :|


"D" a2f      d2f | "D" f2g     agf | "A7" gfe      cAc | "A7" e2f  gfe |

"D" a2f      d2f | "D" f2g     agf | "G" gfe "A7" cAc  | "D"  d3 - d2 ||


"D" a2f      d2f | "D" f2g     agf | "A7" gfe      cAc | "A7" e2f  gfe |

"D" fed "A7" gfe | "D" agf "G" bag | "D" fgf "A7" edc  | "D"  d3 - d2  |]

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.

Here's what an abc interpreter will produce from that code:


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. At the end of the A part, B1 and B2, two D notes are tied together. That's accomplished with a hyphen: d3 - d2.
  • Slurs. At the beginning of B1 and B2, an F and a G are slurred. That's accomplished by putting parentheses around the notes:
    (f/2g/2). Because they're sixteenth notes each has its duration divided by 2 from an eighth note.
  • Beams. If two or more notes are written with no space, they will be beamed. If there's a space between the notes, each has its own flag. Thus DED results in beamed notes but DE D would result in the D and E being beamed but not the second D

The abc Document: Summary

On this page and the previous page we've looked at the components of an abc document. The following table provides a summary of the parts and how they fit together with some sample code fragments to illustrate.


From Here ...

The last page of this section looks at ways that you can use file headers to improve the formatting of notation produced by abc code, and that you can control what prints and what doesn't. Click on the Next Page arrow to learn about formatting.



Links to Related Pages



abc Codexx
Tune Links (16, indented)