next up previous contents index
Next: Text Up: abctab2ps User's Guide Previous: Information fields   Contents   Index



Key and Clef

Key and clef are usually specified in the K: field. In multi stave music, the clef is specified in the V: field. For a key change inmidst a music line, use the inline version [K:].

The general form of a K: field is:

K:<key and mode> <global accidentals> [clef=]<clef and octave>

Every option in the K: field may be omitted, but the order must not be permutated. The meaning of the individual options is:

key and mode:
The key signature should be specified with a capital letter (major mode) which may be followed by a "#" or "b" for sharp or flat respectively. The mode determines the accidentals and can follow immediately after the key letter or with white spaces separated; possible mode names are maj(or) (this is the default), min(or), m(inor), ion(ian), mix(olydian), dor(ian), phr(ygian), lyd(ian), loc(rian), aeo(lian). Mode names are not case sensitive.
When key and mode are omitted C major is assumed.
global accidentals:
Global accidentals are accidentals that always override key specific accidentals. For example, "K:D =c" would write the key signature as two sharps (key of D) but then mark every c as natural (which is conceptually the same as D mixolydian). Note that the there can be several global accidentals, separated by spaces and each specified with an accidental, __, _, =, ^ or ^ ^ , followed by a letter in lower case. Global accidentals are overridden by accidentals attached to notes within the body of the abc tune and are reset by each change of signature.
clef and octave:
The clef specification must be the last word in the key field. Optionally it may start with a "clef=" prefix. Classical Western music notation has only three clef signs (G, F and C) which can appear on different music lines. abctab2ps supports the following clef names: treble (G on line 2; this is the default), treble8 (like treble, but with an "8" printed below), treble8up (like treble, but with an "8" printed above), frenchviolin (G on line 1), bass (F on line 4), varbaritone (F on line 3), subbass (F on line 5), alto (C on line 3), tenor (C on line 4), baritone (C on line 5), soprano (C on line 1), mezzosoprano (C on line 2).
Optionally the clef may contain an appended octave modifier (eg. "treble-8"), which changes the pitch interpretation (see next section).


Pitches are specified by the letters A-G and a-g, optionally followed by an apostrophe or a comma. Capital letters denote the lower octave on the staff. An apostrophe raises the pitch by one octave, a comma lowers the pitch by one octave. These codes are illustrated below:


Note how the clef influences the default octave. The default octave can be lowered or raised with the modifier "-8" or "+8" after the clef in the K: field, e.g. "K:D treble-8". To reset the octave modifier, use "[K:treble+0]".

The symbols =,^ and _ are used (before a note) to generate respectively a natural, sharp or flat. Double sharps and flats are available with ^ ^ and __ respectively.


By default, a letter generates a note with the default length, specified in the L: info field. If a the letter is followed by / or /2, the length is halved. If the letter is followed by an integer, the length is multiplied. Both modifiers can be combined, so that the multiplier 3/2 produces a dot.


For dotted rhythms there is a shorthand notation: ">" means `the previous note is dotted, the next note halved' and "<" means `the previous note is halved, the next dotted'. Similarly, ">>" and "<<" can be used for double dotting.

Rests are generated with a z and can be modified in length in exactly the same way as notes can.


Invisible rests are generated with a x. These count like regular rests, but they are not printed. This can be useful in multistave music, eg. if one voice has a longer pickup than another voice.

Multi bar rests are generated with a capital Z followed by the number of bars. When using bar numbering (command line option ``-k'' or format parameter %%barnumbers), abctab2ps takes care of multi bar rests.

Triplets can be simply coded with the notation "(3abc". Similarly, "(2ab" makes a duplet, "(4abcd" a quadruplet, etc., up to "(9". The musical meanings are:

Notation Meaning
(2 2 notes in the time of 3
(3 3 notes in the time of 2
(4 4 notes in the time of 3
(5 5 notes in the time of n
(6 6 notes in the time of 2
(7 7 notes in the time of n
(8 8 notes in the time of 3
(9 9 notes in the time of n
If the time signature is compound (3/8, 6/8, 9/8, 3/4, etc.) then n is three, otherwise n is two.

More general tuplets can be specified using the syntax (p:q:r which means `put p notes into the time of q for the next r notes'. If q is not given, it defaults as above. If r is not given, it defaults to p. For example, "(3:2:2" is equivalent to "(3::2" and "(3:2:3" is equivalent to "(3:2", "(3" or even "(3::". This can be useful to include notes of different lengths within a tuplet, for example "(3:2:2G4c2" or "(3:2:4G2A2Bc" and also describes more precisely how the simple syntax works in cases like "(3D2E2F2" or even "(3D3EF2". The number written over the tuplet is p.

The notation of nonmetric music like plainchant requires stemless notes. These can be enforced with the format parameter %%nostems. Note that notes still have lengths, so that it is in principle possible to notate nonmetric music with more than one part (like medieval organa). To adjust the notes vertically, use invisible rests (x). Invisible rests can also be used for separating note groups in monophonic stemless notation.

Bars and repeats

Bar lines are specified with a "|". abctab2ps does no plausibility check whether a bar is over or underfull, so you can put bar lines where you please. The following symbols are supported:

Notation Meaning
| bar line
|] thin-thick double bar line
|| thin-thin double bar line
[| thick-thin double bar line
:| left repeat
|: right repeat
:: left-right repeat
[|] invisible bar line

Invisible bars lines are workarounds if you need labels on the first bar or put a line break in the middle of a bar.

First and second repeats can be generated with the symbols "[1" and "[2", e.g.

faf gfe|[1 dfe dBA:|[2 d2e dcB|]
When adjacent to bar lines, these can be shortened to "|1" and ":|2", but with regard to spaces, i.e. "| [1" is legal, "| 1" is not. If you want a dot after the number in first and second repeats, use the format parameter %%endingdots.

Beams, ties and slurs, ligaturae

To group notes together under one beam they should be grouped together without spaces. Thus in 2/4, "A2BC" will produce an eighth note followed by two sixteenth notes under one beam whilst "A2 B C" will produce the same notes separated. It is possible to put rests (z) under a beam, e.g "aza". The beam slopes and the choice of upper or lower staffs are generated automatically.

You can tie two notes together either across or within a bar with a "-" symbol, e.g. "abc-|cba" or "abc-cba". More general slurs can be put in with "()" symbols. Thus "(DEFG)" puts a slur over the four notes. Spaces within a slur are ok, e.g. "(D E F G)", but the open bracket should come immediately before a note (and its accents/accidentals, etc.) and the close bracket should come immediately after a note (and its octave marker or length). Thus "(=b c'2)" is correct but ( =b c'2 ) is not.

To abctab2ps, slurs outside chords and slurs within chords are different kinds of animals. A slur outside of chord brackets always applies to the top notes of the enclosed chords and it may span several notes. A slur within chord brackets however must be closed in the immediately following chord. E.g. in order to tie the top note of a chord to the next single note, you may write "([afd] b)" or "[(afd] [b)]", but not "[(afd] b)" (in the last version, the slur is opened inside chord but closed outside which is not allowed).

In transcriptions of mensural notation into common music notation ligaturae are often indicated by square brackets. This is possible with the pseudocomment %%slurisligatura, which prints ligatura brackets instead of slurs. Note that this only applies to slurs outside chords and not to ties.

Graces and decorations

Grace notes can be written by enclosing them in curly braces ({}):


The first two examples show the meaning of grace notes according to the abc standard, which specifies that grace notes have no explicit time values and the following meaning:

This does not allow for the notation of long appoggiaturas. To overcome this limitation, abctab2ps allows for a length specifier in the grace notes (see the third example above). The length applies to all grace notes within the same pair of braces; when more than one length is specified, the last length holds (see the last example above).

When the following note is a chord, appogiaturas and accacciaturas are tied to the first note given in the chord.

Other decorations are indicated either by a magic character (e.g. "T" for a trill) or by their name in exclamation marks (e.g. "!trill!"). The decoration signs must appear immediately before a note, e.g. "TG" or "!trill!G" for a trill above middle G. If notes are grouped in chords, the decoration sign must appear outside and immediately before the chord. abctab2ps currently supports the following decorations:



Chords (i.e. more than one note head on a single stem) can be coded with brackets ([]) around the notes, e.g. "[CEGc]" produces the chord C major. They can be grouped in beams, e.g. "[d2f2][ce][df]" but there should be no spaces within a chord. A chord with two identical notes makes a unison (one head with stems going both up and down), eg: "[AA]".

Important notice: The old style chord notation with plus signs, eg. "+ac+", which was an undocumented non standard abc feature of abc2ps is no longer supported in abctab2ps.

The abc notation formally permits notes with different durations on the same stem: "[a/bc2]" and so on. However, abctab2ps assigns all notes in a chord the duration of the first note in the bracket. If you are looking for polyphonie, see the remark on abcm2ps.

Slurs and ties within chords are possible:

[(a(b] [c)d)] slurs a to c, b to d
[a-b] [ac] ties a to a

next up previous contents index
Next: Text Up: abctab2ps User's Guide Previous: Information fields   Contents   Index
Christoph Dalitz 2011-04-26