Lyrics for additional verses in LilyPond? - lilypond

Is there a way in LilyPond to simply list the lyrics corresponding to
additional verses after the end of the music, with one paragraph per verse?
(N.B. This exact question has been asked before, in 2001, but the first answer ("read this book") references a dead URL, while the second (use \context Lyrics) does not work for me, I get LilyPond syntax errors.)
Here's a song under which I want to write the additional verses.
\header{
title = "Hello World"
}
\score {
\relative {
\time 2/4
\clef treble
\key a \major
cis''2 | a4 fis \bar "|."
}
\addlyrics {
He -- | llo world
}
\layout { }
\midi { }
}
\version "2.18.2"
(Sorry about the syntax highlighting, <!-- language: lang-lilypond --> is not yet supported in the Google Code Prettyfier that SO uses.)
I'd like to add verses 2, 3, and 4 underneath, separated from the music, just as words.

I got an answer from Knute Snortum on the LiliyPond mailing list here
After my score block I can add a markup block like this
\markup {
\column {
\line { \null }
\line { 2. Here I go }
}
}
It turns out that this is covered in the LilyPond documentation (printing stanzas at the end) but they use the term 'stanza' and so my searching for 'verse' did not lead me there.
(It is also worth noting this discussion on meta. Posting LilyPond questions here is likely to lead to down-votes since it is not considered programming by many of the SO community. A better Stack Exchange site to post LilyPond questions to is the Music: Practice and Theory Stack Exchange, though, as I found, the LilyPond mailing list is currently the place most likely to elicit full and prompt answers.)

Related

how to show symbols on top of LilyPond scores?

Santa offered a toy keyboard to my 4-year-old. He enjoys the provided scores, but I'd like to add some songs that we sing together and that are not included in the basic set. Every Key has a symbol (circle, triangle, square) and a color (blue, yellow, purple, red, orange) that is displayed on top of the music score, to help him figure out which keys to press.
I'm not a musician, but I do have a basic understanding on how to write music scores. I've never used lilypond, but I'm a developer and I know latex.
I tried searching for a way to add extra symbols, but I'm not sure this is feasible.
You can draw theses symbols by using some of the various graphics commands found on this page:
https://lilypond.org/doc/v2.24/Documentation/notation/graphic
Store these as markup macros at the top of the LilyPond file, and then call them in the score at the appropriate places.
\version "2.24.0"
blueTriangle = \markup {
\left-align
\with-color "blue"
\triangle ##t
}
orangeCircle = \markup {
\left-align
\with-color "orange"
\draw-circle #1 #0 ##t
}
purpleCircle = \markup {
\left-align
\with-color "purple"
\draw-circle #1 #0 ##t
}
greenSquare = \markup {
\left-align
\with-color "green"
\filled-box #'(0 . 2) #'(0 . 2) #0
}
\new Staff {
g4^\blueTriangle
d'^\orangeCircle
b'^\purpleCircle
f''^\greenSquare
}
This will be a bit tedious if you are placing a symbol above every note. But if you know Scheme you can probably devise a function that reads the note letters and octaves and places the correct symbol in automatically.

How to hide measure numbers in Lilypond?

In Lilypond, by default measure numbers are printed in each new line.
How to hide these numbers?
Thanks
It is actually at the end of the documentation:
\layout {
\context {
\Score
\omit BarNumber
}
}

Lilypond: Variable page break penalty

In my use of Lilypond, I often face the same kind of problems: Say I have four scores (3-4 lines each) that fit in two pages but not necessarily in one.
I refuse to have page breaks within scores. If possible, I want all the scores on the same page. When it's not possible however, I would like the page break to occur between the first and second scores. If that is not possible either, between the second and the third. And only if that's really necessary between the third and the fourth. That is, by order of preference, | representing the page break:
1 2 3 4 |
1 | 2 3 4
1 2 | 3 4
1 2 3 | 4
Is there a way to achieve that without trying and adding the page breaks myself? Maybe by having page-break penalties going in increasing order after each score (but remaining smaller than the penalty for adding a new page)?
Thank you by advance for your help.
You should use ly:page-turn-breaking (see Optimal page turning in the documentation). You'll probably have to play also with \pageTurn, \noPageTurn, \allowPageTurn in order to have the best control.
Here's a minimal example:
\version "2.19.82"
\header {
title = "Page turn breaking"
}
\paper {
% The default page breaking will make Score 1 end at beginning of page 2.
% The following option prevents this and keeps Score 1 all in the first page.
page-breaking = #ly:page-turn-breaking
}
\score {
\header { piece = "Score 1" }
\new Staff {
\clef "treble_8"
\repeat unfold 14 { c'1*4 }
}
\layout {
indent = 0
system-count = 14
}
}
\score {
\header { piece = "Score 2" }
\new Staff {
\clef "treble_8"
\repeat unfold 13 { e'2 f }
}
\layout {
indent = 0
system-count = 13
}
}

Custom note heads in LilyPond

I am attempting to replace the default note heads with custom graphics in Lilypond. I've read the documentation under A. 10.3 Graphic which explains how to use \markup to add graphics to a score, however I'm stuck at being able to use those to replace note heads. My question is how can I replace the default note heads for custom ones?
If I understand correctly, you want to make some noteheads substituted by arbitrary graphics. Assuming you already have the graphic in EPS format as sol.eps, this code uses it to change a 'g' to a picture of a sun ('sol' is Spanish for 'sun'):
cabezaSol = {
\once \override NoteHead #'stencil = #ly:text-interface::print
\once \override NoteHead #'text =
\markup {
\general-align #Y #CENTER {
\epsfile #X #2 #"./sol.eps"
}
}
}
{ e'4 f' \cabezaSol g' }

Multiple dynamic markings under one note

I am working with Lilypond and can't figure out how to place two dynamic markings under a whole note. I want it to start piano and then become forte but I don't want to use a crescendo. I'd also rather not indicate two tied half notes. Just p then f under a whole note. This is common in older notation which I am typesetting. Thank you.
You can add one single markup that contains multiple elements to a single note:
\version "2.18.2"
{
f'1 _\markup { \dynamic { f p } }
}
There's an example in the Notation Reference, where it says: "Spacer rests are needed to engrave multiple marks on one note."
If you adapt it to your case, you might write:
\version "2.18.2"
{
R1 |
<< f'1\p { s1\f } >> |
}
However, this triggers the following warning:
warning: Two simultaneous absolute-dynamic events, junking this one
and only the first dynamic mark is printed.
So you must place the second dynamic mark on a different musical moment:
\version "2.18.2"
{
R1 |
<< f'1\p { s4. s16\f s s2 } >> |
}