Features of abcm2ps and abc2svg
abcm2ps tries to follow
the ABC draft version 2.2 (February 2013).
abc2svg tries to follow the new ABC draft version 2.2 (February 2021).
Here are listed only the differences from the draft.
Last update: April 7, 2021 for abcm2ps-8.14.9 and abc2svg-1.20.19
2.1 Abc file identification
neither abcm2ps nor abc2svg check if there is a BOM at start of file.
As a consequence, the characters between the BOM and the end of line are
ignored. This impacts rendering, especially when the line contains
a tune reference number (
2.2.2 File header
There is no notion of 'file header': any valid ABC line
found outside the tunes is considered as global, and applies
to the remaining tunes.
2.2.3 Free text and typeset text
With abcm2ps, typeset text stops the music generation so that
it is always printed at its exact position in the music.
With abc2svg, typeset text is memorized and it is printed
after the current music line.
2.3 Embedded abc and abc fragments
abcm2ps handles ABC embedded in other document types
with the following constraints:
The ABC elements are recognized anywhere in any file type
as sequences which:
start on lines beginning with either
stop on the first line beginning with a ML tag
The so defined ABC sequences may contain elements of
file header, tunes, or both. They cannot contain
only fragments of tunes (an empty line is added at the
end of the sequences).
abcm2ps must be run with the command line option
The abc2svg package does not contain batch/CLI scripts that
do replacement of ABC code by SVG images in any document
type. Such scripts have to be written by users.
On the other side, when run in a web browser, abc2svg
offers some scripts for rendering the music.
These scripts are described in the main page of abc2svg. They are:
abcweb-1.js that replaces the ABC sequences in
<script type="text/vnd.abc"> elements.
abcweb1-1.js that replaces all the (X)HTML content
by one or all the ABC tunes (a menu does the selection).
abcdoc-1.js that works like
but keeps the ABC sequences.
It is used for documentation as in this file.
3. Information fields
In a tune body, the lines beginning with a letter in range
a-g,x-z and immediately
followed by a colon are interpreted as information fields,
and, thus, are ignored.
3.1.2 T: - tune title
T: information field may be omitted
3.1.6 M: - meter
M: may specify more complex meters with a
combination of digits, parenthesis, slashes and spaces.
Ancient meters may be specified by:
M:o (perfect minor),
M:o. (perfect major),
M:o| (perfect major dim 1),
M:c (imperfect minor) and
M:c. (imperfect major).
M:c| (imperfect major dim 3).
An explicit measure duration may be specified putting its
value after an '=' sign (ex:
This is useful for measure numbering.
3.1.7 L: - unit note length
The unit note length does not change on
when it has been previously defined by an other
The field L: may contain
auto in which case
the duration of each note is adjusted to fulfill the measures.
This value works when the measures are regular (fixed duration).
With abc2svg, the unit note length may be followed by '
and the associated note duration.
When omitted, the note duration is the unit note length.
3.1.8 Q: - tempo
The tempo value may preceded by
The tempo value may reference the new beat duration
3.1.9 P: - parts
P: is ignored
when the current voice is not the top voice or
when the voices are not synchronized.
3.1.14 K: - key
The list of accidentals after
exp may be
none (for no accidental).
The default clef is
3.1.17 I: - instruction
I:decoration is ignored.
I:abc-charset is ignored.
With abcm2ps, the charsets iso-8859-5 .. iso-8859-8
are not implemented. The instruction
I:abc-include may be used to include:
ABC files (extension
Such files may contain information fields, instructions
or pseudo-comments of any type, tunes,
but not fragments of tune PostScript files (extension
only with abcm2ps)
'format' files (extension
only with abcm2ps)
Microtone pitches are indicated by a number or a fraction after
an accidental (and before the note).
There are three ways to define microtone pitches:
The pitches are indicated by a fraction of semitone
in the accidentals as "^3/4c" (3/4 of a sharp).
When omitted, the numerator defaults to 1 and the
denominator to 2 ("^/c" is the same as "^1/2c"). %%MIDI (abc2svg only)
The abcMIDI command
%%MIDI temperamentequal <ndiv>
defines the octave divider
With this method, only the numerator is to be set after the
accidental as "^5c".
%%microscale (abcm2ps only)
%%microscale <denominator> defines
the microtone divider as a fraction of tone (!! not semitone !!).
Better use the abcMIDI command.
With abc2svg, the fractions are simplified
("_12/24" is the same as "_1/2", "^2/2" is "^").
Support exists only for 1/2 and 3/2, sharps and flats.
The numerator and denominator cannot be greater than 255.
4.3 Note lengths
128th notes are not handled.
A note length starting with
0 (zero) indicates
a stemless note.
For compatibility with other software, this indication
should be avoided and replaced by a
soprano are not implemented.
The clefs that transpose 2 octaves (
^/_15) are not implemented
When no clef is specified, the default is
'clef=P' is the same as 'perc'.
The clef name may be enclosed by double quotes in which case
it is the name of the function which draws the clef
(PostScript for abcm2ps, SVG for abc2svg).
The arguments of this function are the x and y offsets. When a double-quoted clef is used, the note to be put on
the 2nd staff line is 'G'.
It may be changed by the argument
followed by the name and octave indication of the note
The value of
stafflines= is the same as the one of
4.6.5 Application specific modifiers
Neither abcm2ps nor abc2svg accept their name as specific modifiers.
4.8 Repeat/bar symbols
 is the same as
[|] (invisible bar).
: (colon alone) is the same as
.| (dotted bar).
] alone is an invisible bar which stops a repeat bracket.
It is better to use a decoration
!rbstop!) for that.
Repeat bars may contain a set of digits,
, (comma) or
or even a free string (between double quotes
- note that a
[ is needed before the string
- the string may be empty).
||: is displayed as
in the middle of a music line, but as
|: when on two lines.
|| does a playback restart only when the ABC version
is lower than "2.2".
4.10 Variant endings
In a part, the right repeat bars are always honored,
and repeating cannot go before the start of the part.
For instance, with
P:A2 in the tune header,
CD CE CD CE
4.11 Ties and slurs
There may be slurs inside grace notes and also
from notes to grace notes and reverse.
There may be ties from grace notes to the next chord.
Opening slurs (
() and tie characters
-) may be preceeded by a dot
. for a dotted line, and followed
, to force
their direction (above or below).
4.12 Grace notes
Grace notes may appear before any note, rest or measure bar
and may contain chords.
The length of the grace notes is handled.
Their unit note length is not tied to L: (or M:).
Instead, for compatibility, it is:
Grace notes greater than crotchets are drawn as crotchets. a quaver for a single note and
a semi-quaver for many notes in standard tunes,
a demi-semi-quaver in bagpipe tunes.
There may be decorations on grace notes.
A space before the ending
} indicates that
the grace notes must be played just after the
On display, the sequence is shifted to the left
4.13 Duplets, triplets, quadruplets, etc.
Tuplets values may be greater than 9.
Tuplets may be nested.
With abcm2ps, the decorations
are not implemented.
The decorations on notes inside chords cannot be standard ones
because their offset is relative to the note they are attached to,
not to the chord. They must be explicitly defined by
%%deco. The following decorations are added:
!/! .. !///!
tremolo on one note
do not break beaming (on a measure bar)
let only 1 or 2 beams from the previous note
glissendo (straight line)
glissendo (squiggly line)
grace mark ('~' like sign)
prevent a note, rest or measure bar to be displayed
piano pedal on and off
aligned piano pedal signs on and off
close here the current repeat bracket
stop here the current repeat bracket
tie between notes of different voices
tremolo (on the second of a couple of notes)
draw a stem up to the note on the previous staff
4.15 Symbol lines
With abcm2ps, the field
d: is the same as
4.16 Redefinable symbols
U: fields cannot contain
chord symbols nor annotations.
With abcm2ps, the values assigned by
U: fields are
always global (they are not restored at end of tune).
In 'U:' fields, the character may be
The default value of these characters is
\ (back-slash - space)
to redefine the character space, or
\t (back-slash - t)
to redefine the character tabulation.
In 'U:' fields,
!ignore! defines the character as ignored.
This is the default value for the character
In 'U:' fields,
!beambreak! defines the character as
stopping note beaming.
This is the default value for the characters
\ (space) and
4.17 Chords and unisons
Chords of notes with different lengths is partially implemented.
Unisons may have more than 2 notes.
4.18 Chord symbols and 4.19 Annotations
Multiple lines of chord symbol / annotation may also be
;, in which case the lines are of
the same type (gchord or annotation).
A new annotation type may be indicated after a '
are displayed as unicode accidental characters.
'@' in annotations must be followed by the
<x> and <y> offsets of the text
from the symbol position (in points).
The <x> and <y> values are separated by a comma,
and <y> may be followed by a space
(usefull if the text begins with a digit, a dot or the
letters 'E' or 'e').
The exact anchor point of the text is
the middle position of the symbol
for a note, a chord or a rest
the position of a virtual note for a measure bar
the middle of the staff for a measure bar
4.20 Order of abc constructs
<grace notes>, <chord symbols>,
<annotations> and <decorations>
may be in any order.
6.1.1 Typesetting line-breaks
The line-break default setting with abcm2ps is
I:linebreak ! does not invoke
BTW, the abcm2ps command
is the same as
See %%linebreak for more information.
6.1.2 Typesetting extra space
A space (
y) may be followed by a width in points.
The default width is 10 pts.
7. Multiple voices
With abc2svg, a part
P: may appear in any voice.
With abcm2ps, it may appear only in the first voice or
in any voice when all the voices are synchonized. With abc2svg, a tune subtitle
T: is printed
after the current music line.
With abcm2ps, it restarts the generation, and, so,
all voices are resynchronized.
With abc2svg, a
V: line may contain
a comma separated list of voice IDs.
In this case, the following music is duplicated in each voice.
7.1 Voice properties
V: fields defines the denominator to use
in microtonal accidentals (see 'microtone' pitches below
- abcm2ps only).
V: fields sets the voice
scale (0.7 when 'cue=on', 1.0 when 'cue=off').
This setting has the same behaviour as
stem=auto in a
V: field re-enables
the automatic computation of the direction of the stems
For compatibility with previous abcm2ps versions, with abcm2ps,
V: fields may contain:
(use the pseudo comments instead) 'gchord=up' (default) and 'gchord=down'
to force the display of chord symbols above or
below the staff
%%pos gchord). 'gstem=up' or 'gstem=down'
to force the direction of the stems of the grace notes
%%pos gstem). 'dyn=up', 'dyn=down' or 'dyn=auto'
to force the place of the dynamic marks (above
or below the staff - default is 'auto' -
%%pos dynamic) 'lyrics=up', 'lyrics=down' or 'lyrics=auto'
to force the place of the lyrics (above or below
the staff - default is 'auto' -
%%pos vocal). with abcm2ps, 'merge' in a V: field makes the voice to go
on the same staff as the previous voice (BarFly compatibility).
%%score or voice overlay instead)
7.2 Breaking lines
With abc2svg, any source line-break of any voice is
immediately applied at the time it occurs.
With abcm2ps, only the source line-breaks of the top voice
7.4 Voice overlay
(& .. & .. &) permits
voice overlay on many measures.
Setting lyrics to overlaid voices does not work.
8.2 Text strings
The named HTML entities are not implemented.
\Uxxxxxxxx 32 bits character
is not implemented.
Use XML character references instead.
The strings may contain characters from '\001' to '\005' to display
accidentals. For compatibility, the values '\201' to '\205' are
handled the same way.
The strings may contain XML character references and
predefined entities like "é", "Δ"
With abc2svg, the macros are always handled on playing.
On printing, they are ignored with
%%writefields m false (default).
With abcm2ps, the macros are always ignored.
10. Outdated syntax
Most of the outdated ABC syntax is supported by abcm2ps,
but not by abc2svg.
Some incompatible syntaxes are handled according to
the ABC version of the file as
the ABC 2.0 line continuation mechanism (abcm2ps only).
The BarFly voice switch in tune ('V:x <notes>', i.e.
voice + notes on the same line) may work (abcm2ps only).
(use '[V:x] <notes>' instead)
Lines starting with
\ (back-slash) are ignored
(abc2mtex compatibility - abcm2ps only).
10.4 Outdated directives
With abcm2ps, the directive
11.1 Voice grouping
(plus) before a voice ID meaning that the voice is the master voice
of the staff. This is useful when the upper voice is just a help
11.2 Instrumentation directives
11.3 Accidental directives
Neither abc2svg, nor abcm2ps implement
The default value of
11.4 Formatting directives
When not specified or
the unit of lengths is expressed in pixels (1/96 inch)
Some formatting directives are not implemented, and some other
ones are defined. See the
11.4.2 Font directives
The font definitions in abc2svg and abcm2ps are described in
this document. With SVG output, the font file formats should better be
Web Open Font Format (
or TrueType (
With abcm2ps, transposition is only treated by