| hum2abc manpage |
COMMAND
hum2abc -- Convert Humdrum files into ABC plus files which can be converted into PostScript graphical music notation with abcm2ps.
SYNOPSIShum2abc [options] [input(s)] [> output]
OPTIONS
| -A thru -Z string | |
Single-character capital letter options will place the given text string into a header record in the output abc file. These
options override most (but not all) automatically generated
sing-letter abc records. For example to set the title on the
command-line to "Hunting Song", you would use the option:
-T "Hunting Song". This example would override the
automatic generation of title using the !!!OTL:
bibliographic record in the input data.
|
| -m number | |
Write number mesures of music on each text line of the abc output. Usually the number of measures in a text line
maps to the number of measures in a system. Hum2abc, however,
does not decide this information and instead uses the abcm2ps
directive "%%continueall" to allow abcm2ps to decide how
to break measures between systems. The default value is one
measure per text line.
|
| -n number | |
Write bar numbers every number measures. If number = 0, then print the measure number at the
start of each system (default). If number = -1
or "none", then no
measure numbers will be printed. Measures will be numbered
automatically unless measure numbers are found in the Humdrum
file in the first spine of data. Adding a "b" to the end of
a number is equivalent to also using the --box" option
to draw a box around each measure number.
|
| --box | |
Draw a box around measure numbers.
|
| --debug | |
Print debugging comments along with the output data.
|
| --dir directory | |
Convert all files in the specified directory. By default, all files which contain the string ".krn" will be converted,
this can be changed by using the "--mask" option. If "--dir"
is given, then any list of files on the command-line will be
ignored.
|
| --filenum string | |
Append any number found in the input filename to the beginning of the title. The first non-zero number plus any text after the
number in the input filename before the file extension will be
displayed in the title of the work.
The string value is a set of characters which
will be placed between the number and the title. For example if
--filenum "." is used, and the filename is file03.krn,
Then the string "3. " will be prepended to the title string.
--filenum "" would prepend "3 " to the title.
|
| --filetitle | |
Prepend filename (without extension) to title record (T:).
|
| --footer string | |
Footer string to place at the bottom of each output page when music is printed graphically. The format of the string is the same
as the abcm2ps command. The string contains three parts, separated
by two tab characters: "left-text tab center-text tab
right-text". Several special markers can be used:
| $D | current date & time |
$P | page number |
| $d | date & time of source file |
$P0 | even page numbers only |
| $F | name of file |
$P1 | odd page numbers only |
| $T | title of music |
$V | abcm2ps version used to print |
| \n | newline (footer/header pieces can be on up to two lines) |
|
| --header string | |
Header string to place at the top of each output page when music is printed graphically. See instructions for --footer.
|
| --label | |
Explicitly print the bar number in the abc data (so that it is easy to locate measures when debugging or editing).
|
| --landscape | |
Rotate the music 90 degrees into landscape mode.
|
| --mask pattern | |
Used in conjunction with the "--dir" option. Specifies a pattern present in files which will be converted in a directory.
The default pattern is ".krn".
|
| --no-autoformat | |
Match the number of measures of music on a text line to match the number of measures printed on a line in the graphical music.
Using this option will turn of the automatic layout calculations
done by abcm2ps.
|
| --no-invisible | |
Make all normally invisible items visible (such as invisible rests for layer alignments).
|
| --no-veritas | |
Turn off veritas checking and printing in abc header.
|
| -p string | |
Transmit a set of extended abc parameters to abcm2ps. For example, to left-align the title instead of having it centered, then the
option would be -p "%%titleleft". If more than one parameter setting
needs to be specified, separate them with the string "\n":
-p "%%titleleft\n%%titlefont Times-Italic 20". A full listing
of all abcm2ps parameters can be found here.
Abcm2ps parameters which can be set directly by options to hum2abc
should not be set at the same time by both methods. Only the last -p
option on the command-line will be recognized.
|
| --scale number | |
Sets the printed music magnification. The default value is 0.75. -s is an alias for --scale.
|
| --spacing number | |
Sets the abcm2ps parameter "%%notespacingfactor. The default value is 1.414. Lowering the value towards 1.0 will spread
out the music and lower the density of the music. Raising the
value towards 2.0 will compress the music, allowing for more notes
on a system.
|
| --TT string | |
Build a title from multiple reference records. Reference records will replace @{key} patterns in the
string.
|
DESCRIPTION
hum2abc is useful for printing Humdrum scores and can be considered
a replacement of the ms command in the Humdrum Toolkit. The program
converts Humdrum data into ABC-plus data which can then be printed graphically
using the program abcm2ps.
If multiple inputs are given, then all will be converted.
Each of the converted files will sequentially be given a new
X: number. If no input files are given, then standard
input will be used to read a Humdrum file, which will typically
come via a comman pipe.
Single-letter abc header records
| A: | (geographical Area) or (lyrics Author) |
| B: | (Book) |
| C: | (composer) |
| D: | (Discography) |
| F: | (Filename) |
| G: | (Group) |
| H: | (History) |
| I: | (Information) |
| K: | (initial Key) |
| L: | (default note Length) |
| M: | (initial Meter) |
|
| N: | (Notes) |
| O: | (Origin) |
| P: | (Parts) |
| Q: | (tempo) |
| R: | (Rhythm) |
| S: | (Source) |
| T: | (title) |
| W: | (Words) |
| X: | (tune reference number) |
| Z: | (transcription note) |
|
In abc files, some records can occur multiple times. For example,
the first T: record signifies the title of the music, while the
second T: in the header record indicates the sub-title for
the music. You cannot give two -T options on the command line,
because the second one would just replace the first one. In order to
specify a title and sub-title from the command line you can insert
a newline character into the title string, followed by the literal
contents of the sub-title record, staring with the T: label.
For example:
hum2abc -T "O Waly, Waly\nT: The Water Is Wide"
Will cause these lines in the header record:
T: O Waly, Waly
T: The Water Is Wide
**kern Translation Notes
Accented characters
Accented characters written in HTML encodings such as é will
automatically be converted to their abc equivalent (the current list
is not complete yet). In this case é will be converted to
\'e which will be printed as é. Alternatively, you can
use abc encoded characters directly in the Humdrum input file for titles,
movement designiations, composer's name, etc.
Embedded command-line options
Command-line options to hum2abc can be stored inside of a Humdrum file
in a !!!hum2abc: bibliographic record. There can be multiple
hum2abc records in the input file, and the contents of all records will
be parsed. If the same option (such as setting the measure number scheme)
is set, the the last one found in the file will be the one used. Embedded
options can be overridden by user-supplied command-line options used when
running the program.
Running abcm2ps
Example usages of hum2abc in conjunction with abcm2ps:
hum2abc file.krn > file.abc; abcm2ps -O= file.abc; ps2pdf file.ps
The abcm2ps option "-O=" means save the output PostScript file using
the same filename base as the input. So in this case, a file called
file.ps will be created by abcm2ps.
abcm2ps cannot receive standard input, but hum2abc can:
transpose -t +P5 file.krn | hum2abc > transpose.abc
abcm2ps -O= transpose.abc; ps2pdf file.ps
Special Cases
Multi-bar rests
If the input file contains one **kern spine, then when there
are more than two measures containing only rests, a multi-bar
rest measure will be printed. The current algorithm is simple, and
will not split properly. For example, if two measure rests contain
a repeat sign between them, a two-bar multi-rest measure will be
printed, although they should not.
Limitations
- abcm2ps can only handle 2 layers per staff.
- abcm2ps cannot process slurs/ties which start/end in different layers.
EXAMPLES
DOWNLOAD
|