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

Subsections

General structure

Program options

If the very first line of an abc file starts with the two magic characters "%!", abctab2ps parses that line for command line options (see the man page for a detailed list of all possible command line options). This can be useful for options which cannot be specified otherwise in the abc file, eg.

%!abctab2ps -noitaliantab -k 5 -tabsize 14 -paper letter

On an older Macintosh, this is the only way to pass command line options to abctab2ps because old MacOs' ship without a command line.

Immediately after "%!", the program must follow for which the options are intended. Currently only abctab2ps supports this feature, other programs will interpret this line as comment.

If the same option is specified both on the command line and in the first line of the abc file, the "%!"-line wins because it is interpreted after the command line.

abc input

Each abc input file can contain one or more tunes. Each tune starts with an "X:" (reference number) info field and is terminated by a blank line or the end of the file. Thus, no blank lines are permitted within a tune.

Each block describing one single tune is subdivided into a header and the musical data. The header consists of various info fields which specify things like title, composer, key signature and time signature. The header ends when the first musical information is encountered. (Remark: previously, and according to the standard abc specifications, the header ends with the K: (key) line, used to specify the key. However, most people are not conscious of this, leading to considerable confusion for multi-stave music. Therefore a new convention was used in abc2ps from version 1.3.3.) After the header, the music follows.

A percentage sign (%) starts a comment and causes the remainder of the line to be ignored. Comments may appear everywhere in an abc file.

An example for a valid tune block is as follows:

X:1    % here begins a header
T:Sample Tune
M:4/4
L:1/4
K:C
% here begins the music
abcd | ABCD |
abcd | ABCD |


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