Writing it down: notation and ABC
· Developing and finishing · Level 4 · 20 min
An idea that isn’t written down evaporates. And an idea written down badly will be played wrongly. In this lesson you’ll learn to write your pieces in ABC, the text format used throughout this site: a few lines of text are enough to get a clean, playable, shareable score. We’ll also look at the readability rules that professional engravers follow.
1. The header: the piece’s ID card
An ABC file starts with “letter: value” lines. Here are the essentials:
X:1tune number (added automatically on this site);T:the title;M:the time signature (4/4, 3/4, 6/8…);L:the default length of a note written without a number (1/4 = quarter note, 1/8 = eighth note);Q:the tempo, for exampleQ:1/4=100;K:the key, always last (K:C, K:G, K:Am, K:F…).
T:My first melody M:4/4 L:1/4 Q:1/4=100 K:C C D E F | G2 G2 | A G F E | D4 |]
Result:
T:My first melody M:4/4 L:1/4 Q:1/4=100 K:C C D E F | G2 G2 | A G F E | D4 |]
2. Pitches, octaves, durations, rests, accidentals
Notes use letter names: C, D, E, F, G, A, B. Capital C is middle C; lower-case c is the C an octave above; a comma lowers by an octave (C,), an apostrophe raises (c'). Duration is a multiplier of L: with L:1/8, C = eighth note, C2 = quarter, C4 = half, C3 = dotted quarter, C/ = sixteenth. A rest is z (same duration logic). Accidentals go before the note: ^F = F♯, _B = B♭, =B = natural. The bar line is |, the final double bar |].
M:4/4 L:1/8 K:G G2 A B c2 B A | G2 ^F G _B2 =B2 | z2 d2 z d e2 | g8 |]
M:4/4 L:1/8 K:G G2 A B c2 B A | G2 ^F G _B2 =B2 | z2 d2 z d e2 | g8 |]
Note: in G major (K:G) the F is already sharp thanks to the key signature; ^F merely restates it. Always count every bar: here 8 eighth notes per bar, no more, no less.
3. Chords, ties, slurs and chord symbols
A chord goes between square brackets: [CEG]4 (a half note with L:1/8). A tie is a hyphen - after the note; a slur (legato) wraps the notes in parentheses ( ). A chord symbol goes in double quotes "G7" before the note: it appears above the staff and acts as a lead sheet.
M:4/4 L:1/8 K:C "C" [CEG]4 "F" [CFA]4 | "G" [B,DG]4- [B,DG]2 (AB) | "C" (c2 G2) [CEGc]4 |]
M:4/4 L:1/8 K:C "C" [CEG]4 "F" [CFA]4 | "G" [B,DG]4- [B,DG]2 (AB) | "C" (c2 G2) [CEGc]4 |]
4. Two staves, dynamics and repeats
For piano, you declare two voices joined by a brace: %%staves {RH LH}, then V:RH clef=treble and V:LH clef=bass. Each line then starts with [V:RH] or [V:LH]. Both hands must have exactly the same number of bars, and every bar the right length. Dynamics go between exclamation marks (!p!, !mf!, !f!, !crescendo(!…), repeats use |: and :|.
M:3/4
L:1/8
Q:1/4=120
K:F
%%staves {RH LH}
V:RH clef=treble
V:LH clef=bass
[V:RH] |: !p! c2 A2 F2 | G4 E2 | !f! c2 f2 e2 | f6 :|
[V:LH] |: F,,2 [A,C]2 [A,C]2 | C,2 [G,B,]2 [G,B,]2 | F,,2 [A,C]2 [G,B,]2 | F,,6 :|
M:3/4
L:1/8
Q:1/4=120
K:F
%%staves {RH LH}
V:RH clef=treble
V:LH clef=bass
[V:RH] |: !p! c2 A2 F2 | G4 E2 | !f! c2 f2 e2 | f6 :|
[V:LH] |: F,,2 [A,C]2 [A,C]2 | C,2 [G,B,]2 [G,B,]2 | F,,2 [A,C]2 [G,B,]2 | F,,6 :|
CDEF gives four eighth notes under one beam; CD EF gives two groups of two. Use this to show the beats clearly.5. The engraver’s readability rules
A correct score isn’t necessarily a readable one. Professional publishers follow a few golden rules:
- Show the beats: beam eighth notes by beat (in twos in 2/4 or 4/4, in threes in 6/8). Compare below: the same six eighth notes, first in 3/4 (three groups of two), then in 6/8 (two groups of three). The beaming tells the performer where the stresses fall.
- Rests on the beats: in 4/4, never write a half rest across beats 2–3; write two quarter rests. The “middle” of the bar must stay visible.
- Correct enharmonic spelling: in D major write F♯, not G♭. A rising note is usually spelled with a sharp, a falling one with a flat.
- Stems: up below the middle line, down above it (ABC handles this automatically).
- Ledger lines: beyond three, change clef or use an octave sign.
M:3/4 L:1/8 K:C "^3/4" CD EF GA | G2 E4 |]
M:6/8 L:1/8 K:C "^6/8" CDE FGA | G3 E3 |]
K: must be the last header line; 2) bars that don’t add up (always count!); 3) confusing C (middle C) and c (an octave higher) — your melody jumps an octave; 4) a different number of bars in the right and left hands: the two staves drift apart.6. Sharing your work
ABC’s great advantage: it’s plain text. You can paste it into an email, a forum or a chat, and the other person pastes it into the ABC editor to see and hear the score. Keep your pieces in a simple text file: a lightweight, durable archive of your entire output.
Your workshop
- Open the ABC editor and copy the first example. Change the title, the tempo, then the key (K:G): observe what changes.
- From memory, write in ABC the first eight bars of a melody you composed in the piano roll. Check every bar by counting the durations.
- Add a left hand on a second staff (
%%staves {RH LH}) with the same number of bars. - Add chord symbols, at least two dynamics, a slur and a repeat.
- Proofread with an engraver’s eye: beaming by beat, well-placed rests, correct spelling of accidentals.
- Self-check: send the text to a musician friend (or reread it the next day): could they play your piece without asking you a single question?
← Introductions, endings and titles · Sketchbook, daily exercises and constraints →