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 (X:).
Inside the tune body, 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.
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
%abc or X:, and
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
-z
.
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 abcweb-1.js,
but keeps the ABC sequences.
It is used for documentation as in this file.
In a tune body, the lines beginning with a letter in range
A-G,X-Z or a-g,x-z and immediately
followed by a colon are interpreted as information fields,
and, thus, are ignored.
The field M: may specify more complex meters with a
combination of digits, parenthesis, slashes and spaces.
Ancient meters may be specified by: M:2 or M:3, 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: M:C|=2/1).
This is useful for measure numbering.
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).
Changing the unit note length also changes the unit note length
of the lower overlayed voice(s).
With abc2svg, the unit note length may be followed by '='
and a note duration. This permits a same figure (note or rest)
to have different durations in different voices
(indeed, when absent, the note duration is the unit note length
as a fraction of a whole note).
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:
direct fractions
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 <ndiv>.
With this method, only the numerator is to be set after the
accidental as "^5c".
%%microscale (abcm2ps only)
The command
%%microscale <denominator> defines
the microtone divider as a fraction of tone (!! not semitone !!).
Better use the abcMIDI command.
Notes:
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.
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 !stemless!
decoration.
The clefs baritone, tenor,
mezzosoprano and soprano are not implemented.
The clefs that transpose 2 octaves (+/-15 or
^/_15) are not implemented
When no clef is specified, the default is auto.
'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 clefpitch=
followed by the name and octave indication of the note
With abc2svg, clef=none may be used at start of
new music line before a new clef to prevent a warning about
the clef change.
] alone is an invisible bar which stops a repeat bracket.
It is better to use a decoration
!rbend! or !rbstop!) for that.
Repeat bars may contain a set of digits, - (hyphen),
, (comma) or . (dot),
or even a free string (between double quotes
- note that a [ is needed before the string
- the string may be empty).
After finding a right repeat bar, and if no left repeat bar,
playback restarts on a double bar || only
when the ABC version is lower than "2.2".
In a part, while playing, 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,
the sequence
is played
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
by ' or , to force
their direction (above or below).
With abc2svg, for slurs on two staves, a question mark
(?) after the opening slur indicates the slur
must be written between the staves.<.li>
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:
a quaver for a single note and
a semi-quaver for many notes in standard tunes,
a demi-semi-quaver in bagpipe tunes.
Grace notes greater than crotchets are drawn as crotchets.
There may be decorations on grace notes.
A space before the ending } indicates that
the grace notes must be played just after the
preceeding note.
On display, the sequence is shifted to the left
(abc2svg only).
With abcm2ps, the decorations
!dacoda!,
!dacapo!,
!D.S.alcoda!,
!D.S.alfine!!D.C.alcoda!,
!D.C.alfine!,
!editorial! and
!courtesy!
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
!beam-accel! and !beam-rall!
feathered beam
!beamon!
do not break beaming (on a measure bar)
!beambr1! and !beambr2!
let only 1 or 2 beams from the previous note
!caesura!
caesura (rails)
!-(! !-)!
glissando (straight line)
!~(! !~)!
glissando (squiggly line)
!8va(! !8va)!
ottava alta
!8vb(! !8vb)!
ottava bassa
!gmark!
grace mark ('~' like sign)
!invisible!
prevent a note, rest or measure bar to be displayed
!ped! and !ped-up!
piano pedal on and off
!ped(! and !ped)!
aligned piano pedal signs on and off
(abc2svg only)
!rbend!
close here the current repeat bracket
!rbstop!
stop here the current repeat bracket
!short!
short measure bar (on a bar)
!stemless!
no stem
!tick!
'tick' bar (on a bar)
!tie(! !tie)!
tie between notes of different voices
!trem1! .. !trem4!
tremolo (on the second of a couple of notes)
!xstem!
draw a stem up to the note on the previous staff
With abc2svg, a position as in the annotations can be defined
at the head of the decoration names (<,
>, ^, _ or
@).
With abc2svg, a number may be inserted in the decoration names
before the last parenthesis ( or )
to identify and link long decorations.
With abcm2ps, 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
\ (back-slash - space)
to redefine the character space, or
\t (back-slash - t)
to redefine the character tabulation.
The default value of these characters is !beambreak!
(see below).
In 'U:' fields, !ignore! defines the character as ignored.
This is the default value for the character
` (back-quote).
In 'U:' fields, !beambreak! defines the character as
stopping note beaming.
This is the default value for the characters
\ (space) and \t (tabulation).
Multiple lines of chord symbol / annotation may also be
indicated by ;, in which case the lines are of
the same type (gchord or annotation).
A new annotation type may be indicated after a ';' as:
"^above;_below".
In chord symbols, the characters
#, b and =
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
with abcm2ps,
the middle of the staff for a measure bar or a space
with abc2svg
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, when some commands as a subtitle T:
are found inside a music line, they are moved
to the start of the next music line.
With abcm2ps, such commands restart the generation, and, so,
a new music line is created and
all the 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.
microscale=<d> in K: or
V: fields defines the denominator to use
in microtonal accidentals (see 'microtone' pitches below
- abcm2ps only).
cue=on or cue=off
in K: and V: fields sets the voice
scale (0.7 when 'cue=on', 1.0 when 'cue=off').
This setting has the same behaviour as
%%voicescale.
stem=auto in a V: field re-enables
the automatic computation of the direction of the stems
(default).
For compatibility with previous abcm2ps versions, with abcm2ps,
the V: fields may contain:
'gchord=up' (default) and 'gchord=down'
to force the display of chord symbols above or
below the staff
(see %%pos gchord).
'gstem=up' or 'gstem=down'
to force the direction of the stems of the grace notes
(see %%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' -
see %%pos dynamic)
'lyrics=up', 'lyrics=down' or 'lyrics=auto'
to force the place of the lyrics (above or below
the staff - default is 'auto' -
see %%pos vocal).
(use the pseudo comments instead)
with abcm2ps, 'merge' in a V: field makes the voice to go
on the same staff as the previous voice (BarFly compatibility
- use %%score or voice overlay instead).
With abc2svg, any source line-break in any voice is
immediately applied at the time it occurs.
With abcm2ps, only the source line-breaks of the top voice
are applied.
The sequence (& .. & .. &) permits
voice overlay on many measures.
Setting lyrics to overlaid voices in normal voices
does not work.
Overlayed voices are created when &'s
are found and they exist up to the end of the tune
as ordinary voices.
Their attributes are copied from the ones of the immediately
upper voice at creation time. They may be modified
using common commands and parameters (%%voicescale...).
The only exception is the unit note length L:
that is not handled the same way in abcm2ps and abc2svg.
The unicode \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 "é", "Δ"
or "&".
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.
%%score and %%staves accept +
(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 (cue).
%%score and %%staves do a synchronization
of all the voices, i.e. the time of all known and future voices
is set to the time of the longest active voice.
An empty %%score or %%staves does not
change the staff system. It just does a voice synchronization.