Selected Topics - Lilypond Tips and Techniques
Optional Chords
Since I only occasionally ran into this, I normally solved it by just adding markups to the defaultMelody notes - but this doesn't look right, because it doesn't line up with the chords. So I searched, and found the solution (and tweaked it slightly) that I used in "Lili Marlene". It uses some guile code to add parentheses to the chordname itself (see the source coce for "Lili Marlene"... duh.)
Formatting and compiling sets
I had a problem recently (June 2011) where the titles I had so meticulously added to sets disappeared when I (re-)ran them through Lilypond. After much consternation, hairpulling and fruitless internet searches, I finally conducted a serious troubleshooting session. I eventually discovered that the "printallheaders" command of the \paper section had somehow been changed to "print-all-headers". In the process I found a slightly better way of laying out the sets (and likewise the individual pieces), with my test case being the "Maid Behind The Bar set". The idea, as in all things Lilypond, is to separate out the music itself from the layout. For the details, see the "Maid" source file.
"No Chord"
I had a problem recently (June 2011) where the start of a piece had no chord, and it added "N.C." in the chords. Apparently, starting with version 2.13.1 (alpha version? - likely would have shown up in a later version). Apparently there are plans to also add it for R. Change these to s and we should be ok.
"subtitles"
Again, encountered in June 2011: up until now, I have been using the subtitle header to capture and print all the alternatives titles for a tune. In many cases this extends over several lines, and unitl now, I could split them into those lines by simply enclosing them in apostrophes. Now, however, lilypond doesn't do them on separate lines, but tries to do them all on the same line, with a resulting mess.
The solution in this case is to move the information into a markup at the bottom of the piece. My reference file for this is "Flowers of Edinburgh".
Gaelic Fonts
Lilypond has difficulty with text, eg. titles, that use non-standard characters, such as those for accents. I use emacs to create my source files, and it doesn't encode them properly to support this. The solution is to save the files in UTF-8 format. To do this, from within emacs, type the following;
M-x set-buffer-file-coding-system RET utf-8 RET
Long Titles
Long titles (or subtitles, more frequently) present difficulties, as Lilypond doesn't automatically wrap them. The solution to this is to wrap the text of the title in a \markup, and enclose the desired chunks in apostrophes;
subsubtitle = \markup \center-align {"The Athol/Athole/Atholl Highlanders, Duke of Atholl's March,"
"Lord Athlone's March, The Three Sisters, The Scottish"}
For examples, see "Atholl Highlanders" and "Bonnie Kate".
Midi Generation
Lilypond generates midi files automatically when the correct directives are placed in the .ly file;
\score {
.
.
.
\midi {\tempo 4=120}
.
.
}
The only problem with this is that it will only play the repeats properly when the "unfold" repeat type is used, which conflicts with the requirement to format the sheet properly using the "volta" repeat type.
At this point in time, the only solution I can think of is to copy the .ly file, rename it to ".._FullMidi.ly", change all the "volta"s to "unfold"s, then run through the interpreter to create the midi, and finally (to prevent out-of-sync source files) delete the new .ly file and the resulting extraneous output files (.ps, .pdf, .log, editor backups).
An extra glitch here - the chords don't get repeated... you will probably have to replicate the chords for the repeats...(in the right sequence). Oh wait, I can use \repeat for the chords too... I don't know what this does when the repeat is volta, but for unfold it works fine.
Another solution is to simply generate the ABC file and use the ABC player - but Lilypond does not have facility to do this, and I can't find one on the web, so this would be quite time-consuming.
