ABC notation
- @for Musicians
- @author Kai Ruhl
- @since 2025-11
Some of the songs I can play are in
ABC-Notation
[docs]
[abc.js] (500KB)
which is a text format for musical notes
that can be exported to
HTML
and MIDI
alike.
ABC text
[tutorial]
[syntax]
consists of header and body.
Header must start with "X" and "T", and end with "K".
- X: Index, just use 1 unless several songs in a file
- T: Title
- M: Meter, e.g. 4/4
- L: Length of standard note, e.g. 1/4
- Q: Quickness aka "tempo", e.g. 360 for 120bpm, lower is slower
- K: Key, e.g. C, or Gmaj or Gmin, or C# or Bb
Body contains sections and notes.
- CDEFGAB are standard notes, starting "low"
- cdefgab ... and one octave higher.
- c' two octaves higher than C
- C, one octave lower than C
- ^C _C half tone higher or lower, =C for next note
- C2 C3 C4 note in longer, including punctuation
- C/2 C/3 C/4 note in shorter
- z z2 z3 z4 pause
- | (pipe) || (2x pipe) [| start |] end bar lines
- |: :| repeat section and :||: (or ::) for immediate next, [1 [2 etc. alternate repeats
- (CDE) legato
- .C .D .E staccato
- {CDE}F grace notes, always fast, leading to F
- (2CD (3CDE (4CDEF tuplets
- [Acea] chord
- "C" "D" "E" chord above the bar lines
- w:A bird flew on → aligned with spaces between notes
- V:1 name="bass" multiple voices
- GAB BAG & D6 | short 2nd voice
Optionally, headers
[docs]
may contain:
- C: Composer
- S: Source
- O: Geographic origin
- N: Textual notes
- Z: Name of transcribing peson
- R: Rythm
EOF (Feb:2026)