LilyPond Beginnershandleiding
LilyPond Beginnershandleiding
LilyPond Beginnershandleiding
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Hoofdstuk 4: Tweaking output 136<br />
4.6.2 Using variables for tweaks<br />
Override commands are often long and tedious to type, and they have to be absolutely correct.<br />
If the same overrides are to be used many times it may be worth defining variables to hold them.<br />
Suppose we wish to emphasize certain words in lyrics by printing them in bold italics. The<br />
\italic and \bold commands only work within lyrics if they are embedded, together with the<br />
word or words to be modified, within a \markup block, which makes them tedious to enter. The<br />
need to embed the words themselves prevents their use in simple variables. As an alternative<br />
can we use \override and \revert commands?<br />
\override Lyrics.LyricText.font-shape = #'italic<br />
\override Lyrics.LyricText.font-series = #'bold<br />
\revert Lyrics.LyricText.font-shape<br />
\revert Lyrics.LyricText.font-series<br />
These would also be extremely tedious to enter if there were many words requiring emphasis.<br />
But we can define these as two variables and use those to bracket the words to be emphasized.<br />
Another advantage of using variables for these overrides is that the spaces around the dot are<br />
not necessary, since they are not being interpreted in \lyricmode directly. Here’s an example of<br />
this, although in practice we would choose shorter names for the variables to make them quicker<br />
to type:<br />
emphasize = {<br />
\override Lyrics.LyricText.font-shape = #'italic<br />
\override Lyrics.LyricText.font-series = #'bold<br />
}<br />
normal = {<br />
\revert Lyrics.LyricText.font-shape<br />
\revert Lyrics.LyricText.font-series<br />
}<br />
global = { \key c \major \time 4/4 \partial 4 }<br />
SopranoMusic = \relative c' { c4 | e4. e8 g4 g | a4 a g }<br />
AltoMusic = \relative c' { c4 | c4. c8 e4 e | f4 f e }<br />
TenorMusic = \relative c { e4 | g4. g8 c4. b8 | a8 b c d e4 }<br />
BassMusic = \relative c { c4 | c4. c8 c4 c | f8 g a b c4 }<br />
VerseOne = \lyrics {<br />
E -- | ter -- nal \emphasize Fa -- ther, | \normal strong to save,<br />
}<br />
VerseTwo = \lyricmode {<br />
O | \once \emphasize Christ, whose voice the | wa -- ters heard,<br />
}<br />
VerseThree = \lyricmode {<br />
O | \emphasize Ho -- ly Spi -- rit, | \normal who didst brood<br />
}<br />
VerseFour = \lyricmode {<br />
O | \emphasize Tri -- ni -- ty \normal of | love and pow'r<br />
}