ABCM2PS() | ABCM2PS() |
abcm2ps - translate ABC music notation to PostScript or SVG
abcm2ps translates tunes written in the ABC music notation format to customary sheet music scores in PostScript or SVG. It is based on abc2ps 1.2.5 and was developed mainly to print Baroque organ scores that have independent voices played on multiple keyboards and a pedal-board. The program has since been extended to support various other notation conventions in use for sheet music.
Options given immediately after the command name apply to the run as a whole; options given after an ABC file name apply to that file.
Formatting parameters can also be set in "format files" and in the ABC files themselves.
The list of the command line options may be known running:
abcm2ps -h
The options may be grouped when they have no argument, but the last one (ex: -lnGI20).
The options may be disabled when starting with '+' or ending with '-' (ex: +MT1 is the same as -MT1-).
The general output format is the last found in the command line. It may be:
(see below for more information)
This has the same effect as a format parameter directly in the source file.
This correspond to the %%maxshrink formatting parameter (default: 0.65).
This corresponds to the %%barsperstaff formatting parameter.
This corresponds to the %%measurefirst formatting parameter.
This corresponds to the %%continueall formatting parameter.
This corresponds to the %%staffsep formatting parameter (default: 46pt).
In this mode, each tune goes to a different file which name is "<name>nnn.eps" or "<title>.eps" (see option '-O')
Output to stdout is forbidden.
EPS files are normally embedded into Postscript documents, but they may be a way to generate graphical images. For example, using GhostScript:
abcm2ps voices -Ee7 gs -sDEVICE=pngmono -r80 -g590x174 \
-dBATCH -dNOPAUSE \
-sOutputFile=quitolis.png Out001.eps
(the values for -g are the values of the bounding box in the .eps, multiplied by (80 / 72), where 80 is the value for -r, and 72 is the default resolution)
<tune index list> is either a comma-separated list of tune numbers (as per the X: header), or a regular expression which will be matched against the tune headers as a whole. The -e option must occur after an ABC file name and applies to that file.
Ranges of tune numbers may be specified like <t1>-<t2>; <t2> may be omitted which means "all remaining tunes until the end of file". Note that filtering may cause problems, e.g., with global (non-tune) definitions in the ABC file.
This corresponds to the %%select formatting parameter.
When omitted, the default type of a format file is '.fmt'.
In the form '+F', the default format file ('default.fmt') is not read.
This corresponds to the %%flatbeams formatting parameter.
This corresponds to the %%graceslurs formatting parameter.
In this mode each tune goes to a different file which name is 'Outnnn.svg' (see option '-O').
If the output is stdout (option '-O-'), all the SVG images are output without XML header.
This also shows the default settings for some parameters.
This corresponds to the %%indent formatting parameter.
If <int> is 0, the measure number appears at the left of each staff. The trailing b causes a box to be drawn around each measure number (default: no measure numbering).
This corresponds to the %%measurenb formatting parameter.
Setting this value to a higher value permits the generation of big tunes with -E or -g. The default value is 64.
This corresponds to the %%landscape formatting parameter.
See the %%writefields w formatting parameter.
This corresponds to the %%leftmargin formatting parameter.
<int> indicates the mode:
For compatibility with previous versions, '+N' is the same as '-N0', and '-N' is the same as '-N2'.
If a header is defined ("%%header"), this option is ignored.
See the %%writehistory N formatting parameter.
The directory must end with the directory separator ('/' for unix/windows, '\' for mac).
By default, the output file goes to the current directory with the name:
'Outnnn.eps' for EPS (see option '-E'),
'Outnnn.svg' for SVG (see options '-g' and '-v') or
'Out.xhtml' for XHTML+SVG (see options '-X' and '-z').
'nnn' is a sequence number.
When <name> is present, it is the name of the file, or it replaces "Out" in the file name.
If <name> is '=', it is replaced by the name of the ABC source file (not for '-z').
If <name> is '-', the result is output to stdout (not for EPS). '+O' resets the output file directory and name to their defaults.
When present, format output for bagpipe regardless of key.
When present, only the errors are shown.
This corresponds to the %%scale formatting parameter.
When present, file inclusion (%%format and %%EPS) and PostScript injection (%%beginps and %%postscript) are disabled.
Up to 4 such commands may be defined.
In this mode each page goes to a different file which name is 'Outnnn.svg' (see option '-O').
This corresponds to the %%staffwidth formatting parameter.
The default file name is 'Out.xhtml' (see option '-O').
This corresponds to the %%writefields formatting parameter.
The source file is copied to the output file and the ABC sequences are converted to SVG images. The ABC sequences start by either %abc.. or X:.. and stop on the first markup tag (<..).
The generation creates one image per block, i.e. a music line or a text block. For a same rendering as the other SVG generation (-g, -v or -X), don't forget to set the line space to null, for example enclosing the ABC sequences by:
<div style="line-height:0"> .. </div>
There can be only one output file.
Note that the default output file is 'Out.xhtml', so, don't forget to change the file type if you generate HTML (.html) or XML (.xml) files.
See "sample8.html" for a source example.
This corresponds to the %%splittune formatting parameter.
This corresponds to the %%oneperpage formatting parameter.
clef=<type><line>[+8|-8]
"clef=" can be omitted when the <type> is a clef name.
<type> denotes the clef type. It may be:
The <line> gives the number of the line within the staff that the base clef will be written on. The default values are 2 for the treble clef, 3 for the alto clef, and 4 for the tenor and bass clefs.
The "+8" and "-8" options draw an 8 above or below the staff, respectively.
When no clef is specified, clef changes between "bass" and "treble" will be inserted automatically.
V:<name> <definition> ...
where <name> is a word consisting of letters and digits only (like "violin1"). In the tune body, the following notes refer to this voice until another "V:" is encountered.
A <definition> can be one of:
All other definitions are ignored.
The | character prevents measure bars from being drawn between two staves. If %%staves occurs in a tune, all the voices not mentioned will not be output at all.
The %%score directive occurs in the ABC draft 2.0 standard and is similar to the %%staves specification described above. The rules are:
|F2A2Bc&F2c2bc|
The (&...&...&) construction allows splitting multiple measures:
|!f!(&GG<G|GG F=E| E2 E(_D/E)|_D D C D |C4- |C
&DC<C|CC_D C|=B,2_B,B, |_A,A,(G,/A,/)B,|F,4-|F,&)zzD=E|
A double ampersand (&&) will allow overlaying more than two lines of music but this feature has not yet been implemented.
edc2 edc2| w:Three blind mice, three blind mice
Each word in the w: line (delimited by blanks) is associated with one note, in sequence. The following special symbols modify this behaviour:
To include more than one line of lyrics, use multiple w: lines. To include hyphens without splitting a word over multiple notes, use \-.
If a word starts with a digit, this is interpreted as a stanza number and outdented a bit to the left.
A brief introduction referencing further documentation is installed in <docdir>/abcm2ps/README.md.
The ABC music notation is at http://abcnotation.com/.
Especially, you may find a discussion of differences with the ABC standard at http://moinejf.free.fr/abcm2ps-doc/features.xhtml and a list of formatting options at http://moinejf.free.fr/abcm2ps-doc/.
abcm2ps was written by Jean-François Moine <http://moinejf.free.fr/> starting from abc2ps by Michael Methfessel.
Parts of this manual have been written by Anselm Lingnau <lingnau@debian.org> for the Debian system.
Permission is granted to copy, distribute and/or modify this document as long as its origin is not misrepresented.