The Communications of the TEX Users Group Volume 29 ... - TUG
The Communications of the TEX Users Group Volume 29 ... - TUG
The Communications of the TEX Users Group Volume 29 ... - TUG
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
A newbie’s experiences with Lilypond, Lilypond-book, L A<strong>TEX</strong> and Perl<br />
Joe M c Cool<br />
Sou<strong>the</strong>rn Regional College, Ireland<br />
mccoolj (at) src dot ac dot uk<br />
http://benburb.demon.co.uk/apache2-default/joe.html<br />
1 What’s out <strong>the</strong>re<br />
Abstract<br />
<strong>The</strong> author is an active Irish traditional musician. He is also a keen inland boater.<br />
He is having a lot <strong>of</strong> fun composing a book on “Traditional Music for Boaters”.<br />
In this paper he describes his successes and frustrations using Lilypond,<br />
Lilypond-book, L A<strong>TEX</strong> and ABC musical notation. Lilypond and L A<strong>TEX</strong> have a lot<br />
in common. Nei<strong>the</strong>r are WYSIWYG, nei<strong>the</strong>r demand GUI’s. Both compile simple<br />
flat files to produce beautiful graphical output.<br />
Lilypond’s original manifestations produced output directly for L A<strong>TEX</strong>, but <strong>of</strong><br />
late users writing books have been encouraged to use Lilypond-book. This looks<br />
for Lilypond code within L A<strong>TEX</strong> source files and produces graphics and associated<br />
instructions which can <strong>the</strong>n be processed by L A<strong>TEX</strong>.<br />
Most joy has come from automating <strong>the</strong>se processes via GNU/Linux and Perl.<br />
By definition classical music has an inherent connection<br />
with books and text. Traditional music does not.<br />
Classical music is written down in scores. Historically,<br />
traditional music is not. It is largely an aural<br />
medium and tunes are learnt by ear. Having said<br />
that, musical scores do now have an important role<br />
to play. More and more young traditonal musicians<br />
are learning how to read scores. Printed material<br />
allows us to store pieces that would o<strong>the</strong>rwise be lost<br />
and pencil and paper is a useful aid to composition.<br />
Musicians like to share pieces and <strong>the</strong> arrival<br />
<strong>of</strong> <strong>the</strong> personal computer has made this easier than<br />
ever. But, where years ago we popped manuscripts in<br />
<strong>the</strong> post, we now need to share scores electronically.<br />
This has brought about a plethora <strong>of</strong> programs and<br />
systems that enable us to do so.<br />
1.1 ABC notation<br />
In <strong>the</strong> 1980’s Chris Walshaw, <strong>the</strong>n at <strong>the</strong> University<br />
<strong>of</strong> Cambridge, began writing out fragments <strong>of</strong><br />
folk/traditional tunes using letters to represent <strong>the</strong><br />
notes. This became gradually formalised into what<br />
is known as <strong>the</strong> ABC “standard”. 1 Numerous small<br />
programs have appeared to convert ASCII files <strong>of</strong><br />
ABC to printed scores. 2 <strong>The</strong>re are also programs to<br />
convert ABC code to midi.<br />
Here’s an example <strong>of</strong> an ABC file:<br />
X: 1<br />
T:<strong>The</strong> trout<br />
1 www.walshaw.plus.com/abc<br />
2 for example, moinejf.free.fr<br />
C:Franz Schubert<br />
O:Austria<br />
M:C|<br />
L:1/8<br />
Q:1/4=160<br />
K:C<br />
G2|"C"c2c2e2e2|"C"c4G2G2|"G"G3G dcBA|"G"<br />
G4 z2G2|"C"c2c2 e2e2|"C"c4G2c2|"G"B2AB<br />
....<br />
<strong>The</strong> K: field represents <strong>the</strong> tune’s key. All lines<br />
below this contain <strong>the</strong> music. Lines above are header<br />
fields, with X: representing an index for this particular<br />
tune in a file <strong>of</strong> o<strong>the</strong>r ABC’s. Notes in quotes<br />
represent accompaniment chords.<br />
At first sight ABC seems ideal for what I wish<br />
to do. It has a simple input format. It can output<br />
PostScript files that I can incorporate into L A<strong>TEX</strong><br />
documents. ABC programs are open source and,<br />
most importantly, <strong>the</strong>re are huge collections <strong>of</strong> ABC<br />
source files available on <strong>the</strong> internet.<br />
But, I have a few issues with ABC:<br />
• <strong>the</strong>re is a gross lack <strong>of</strong> standardisation. What<br />
standardisation exists is <strong>of</strong>ten ignored by <strong>the</strong><br />
authors <strong>of</strong> ABC files.<br />
• I need a system comparable to L A<strong>TEX</strong> in terms<br />
<strong>of</strong> typesetting quality. ABC does not have <strong>the</strong><br />
fine grained control <strong>of</strong> L A<strong>TEX</strong>.<br />
• It is difficult to avoid clashing problems: note<br />
heads clashing with bar numbers, or grace notes<br />
clashing with accidentals.<br />
• At <strong>the</strong> time I started my project, <strong>the</strong> ABC mailing<br />
list seemed to vanish!<br />
376 <strong>TUG</strong>boat, <strong>Volume</strong> <strong>29</strong> (2008), No. 3 — Proceedings <strong>of</strong> <strong>the</strong> 2008 Annual Meeting