]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/vocal.itely
@lsrdir and @internalsref renaming.
[lilypond.git] / Documentation / user / vocal.itely
1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @ignore
3     Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
4
5     When revising a translation, copy the HEAD committish of the
6     version that you are working on.  See TRANSLATION for details.
7 @end ignore
8
9 @c \version "2.11.38"
10
11 @node Vocal music
12 @section Vocal music
13
14 TODO
15 CLARIFY
16 http://code.google.com/p/lilypond/issues/detail?id=248
17 http://code.google.com/p/lilypond/issues/detail?id=329
18
19
20
21 > I think the issue here is that changing the associatedVoice
22 > happens one step
23 > later than expected.  I could be wrong, but I don't think this
24 > is obviously
25 > documented.
26
27 If you read section "Switching the melody associated with a lyrics
28 line"
29 it indeed says "Again, the command must be one syllable too
30 early,..."!
31 One problem with the current formulation is that the "Again"
32 refers to what's described 2 subsections earlier in "Lyrics to
33 multiple notes of a melisma", which isn't obvious unless you have
34 read all the sections
35 sequentially.
36
37
38
39 Since LilyPond input files are text, there are two issues to
40 consider when working with vocal music:
41
42 @itemize
43 @item
44 Song texts must be entered as text, not notes.  For example, the
45 input@tie{}@code{d} should be interpreted as a one letter syllable, not the
46 note@tie{}D.
47
48 @item
49 Song texts must be aligned with the notes of their melody.
50 @end itemize
51
52 There are a few different ways to define lyrics; we shall begin
53 by examining the simplest method, and gradually increase complexity.
54
55 @menu
56 * Common notation for vocals::
57 * Aligning lyrics to a melody::
58 * Placement of lyrics::
59 * Stanzas::
60 @end menu
61
62 @snippets
63
64 Checking to make sure that text scripts and lyrics are within the margins is
65 a relatively large computational task.  To speed up processing, LilyPond does
66 not perform such calculations by default; to enable it, use
67
68 @example
69 \override Score.PaperColumn #'keep-inside-line = ##t
70 @end example
71
72 To make lyrics avoid bar lines as well, use
73
74 @example
75 \layout @{
76   \context @{
77     \Lyrics
78       \consists "Bar_engraver"
79       \consists "Separating_line_group_engraver"
80       \override BarLine #'transparent = ##t
81   @}
82 @}
83 @end example
84
85 @node Common notation for vocals
86 @subsection Common notation for vocals
87
88 @menu
89 * References for vocal music::
90 * Setting simple songs::
91 * Entering lyrics::
92 * Working with lyrics and variables::
93 @end menu
94
95 @node References for vocal music
96 @subsubsection References for vocal music
97
98 TBC
99 @c TODO Add @refs
100
101 @q{Parlato} is spoken without pitch but still with rhythm; it is
102 notated by cross note heads.  This is demonstrated in
103 @ref{Special note heads}.
104
105
106 @node Setting simple songs
107 @subsubsection Setting simple songs
108
109 @cindex \addlyrics
110
111 The easiest way to add lyrics to a melody is to append
112
113 @example
114 \addlyrics @{ @var{the lyrics} @}
115 @end example
116
117 @noindent
118 to a melody.  Here is an example,
119
120 @lilypond[ragged-right,verbatim,fragment,quote]
121 \time 3/4
122 \relative { c2 e4 g2. }
123 \addlyrics { play the game }
124 @end lilypond
125
126 More stanzas can be added by adding more
127 @code{\addlyrics} sections
128
129 @lilypond[ragged-right,verbatim,fragment,quote]
130 \time 3/4
131 \relative { c2 e4 g2. }
132 \addlyrics { play the game }
133 \addlyrics { speel het spel }
134 \addlyrics { joue le jeu }
135 @end lilypond
136
137 The command @code{\addlyrics} cannot handle polyphony settings.  For these
138 cases you should use @code{\lyricsto} and @code{\lyricmode}, as will be
139 introduced in @ref{Entering lyrics}.
140
141
142
143 @node Entering lyrics
144 @subsubsection Entering lyrics
145
146 @cindex lyrics
147 @funindex \lyricmode
148 @cindex punctuation
149 @cindex spaces, in lyrics
150 @cindex quotes, in lyrics
151
152 Lyrics are entered in a special input mode, which can be introduced
153 by the keyword @code{\lyricmode}, or by using @code{\addlyrics} or
154 @code{\lyricsto}.  In this mode you can enter lyrics,
155 with punctuation and accents, and the input @code{d} is not parsed as
156 a pitch, but rather as a one letter syllable.  Syllables are entered
157 like notes, but with pitches replaced by text.  For example,
158
159 @example
160 \lyricmode @{ Twin-4 kle4 twin- kle litt- le star2 @}
161 @end example
162
163 There are two main methods to specify the horizontal placement
164 of the syllables, either by specifying the duration of each syllable
165 explicitly, like in the example above, or by automatically aligning
166 the lyrics to a melody or other voice of music, using @code{\addlyrics}
167 or @code{\lyricsto}.
168 @c  TODO: broken
169 @c For more details see @ref{The Lyrics context}.
170
171 A word or syllable of lyrics begins with an alphabetic character, and ends
172 with
173 any space or digit.  The following characters can be any character
174 that is not a digit or white space.
175
176 Any character that is not a digit or white space will be regarded as
177 part of the syllable; one important consequence of this is that a word
178 can end with @code{@}}, which often leads to the following mistake:
179
180 @example
181 \lyricmode @{ lah- lah@}
182 @end example
183
184 In this example, the @code{@}} is included in the final syllable, so the
185 opening brace is not balanced and the input file will probably not
186 compile.
187
188
189 @funindex \property in \lyricmode
190
191 @noindent
192 Similarly, a period which follows an alphabetic sequence is included in
193 the resulting string.  As a consequence, spaces must be inserted around
194 property commands: do @emph{not} write
195
196 @example
197 \override Score.LyricText #'font-shape = #'italic
198 @end example
199
200 @noindent
201 but instead use
202
203 @example
204 \override Score . LyricText #'font-shape = #'italic
205 @end example
206
207 @funindex _
208 @cindex spaces, in lyrics
209 @cindex quotes, in lyrics
210 @cindex ties, in lyrics
211
212 In order to assign more than one syllable to a single note, you can
213 surround them with quotes or use a @code{_} character, to get spaces
214 between syllables, or use tilde  symbol (@code{~}) to get a lyric tie.
215
216 @lilypond[quote,relative=2,ragged-right,fragment,verbatim]
217 \time 3/4
218 \relative { c2 e4 g2 e4 }
219 \addlyrics { gran- de_a- mi- go }
220 \addlyrics { pu- "ro y ho-" nes- to }
221 \addlyrics { pu- ro~y~ho- nes- to }
222 @end lilypond
223
224 The lyric tie is implemented with the Unicode character U+203F, so be
225 sure to have a font (Like DejaVuLGC) installed that includes this
226 glyph.
227
228
229 To enter lyrics with characters from non-English languages, or with
230 accented and special characters (such as the heart symbol or slanted quotes),
231 simply insert the characters directly into the input file and save
232 it with utf-8 encoding.  See @ref{Text encoding}, for more info.
233
234 FIXME: quotes.
235
236 @lilypond[quote,ragged-right,fragment,verbatim]
237 \relative { e4 f e d e f e2 }
238 \addlyrics { He said: â€œLet my peo ple goâ€\9d. }
239 @end lilypond
240
241 To use normal quotes in lyrics, add a backslash before the
242 quotes.  For example,
243
244 @lilypond[quote,ragged-right,fragment,verbatim]
245 \relative c' { \time 3/4 e4 e4. e8 d4 e d c2. }
246 \addlyrics { "\"I" am so lone- "ly\"" said she }
247 @end lilypond
248
249 The full definition of a word start in Lyrics mode is somewhat more
250 complex.
251
252 A word in Lyrics mode begins with: an alphabetic character, @code{_},
253 @code{?}, @code{!}, @code{:}, @code{'}, the control characters @code{^A}
254 through @code{^F}, @code{^Q} through @code{^W}, @code{^Y}, @code{^^},
255 any 8-bit character with ASCII code over 127, or a two-character
256 combination of a backslash followed by one of @code{`}, @code{'},
257 @code{"}, or @code{^}.
258
259 @c " to balance double quotes for not-so-bright context-sensitive editors
260
261 To define variables containing lyrics, the function @code{lyricmode}
262 must be used.
263
264 @example
265 verseOne = \lyricmode @{ Joy to the world the Lord is come @}
266 \score @{
267   <<
268     \new Voice = "one" \relative c'' @{
269       \autoBeamOff
270       \time 2/4
271       c4 b8. a16 g4. f8 e4 d c2
272     @}
273     \addlyrics @{ \verseOne @}
274   >>
275 @}
276 @end example
277
278
279 @seealso
280
281 Internals Reference: @rinternals{LyricText}, @rinternals{LyricSpace}.
282
283 @node Working with lyrics and variables
284 @subsubsection Working with lyrics and variables
285
286 @cindex lyrics, variables
287
288 To define variables containing lyrics, the function @code{\lyricmode}
289 must be used.  You do not have to enter durations though, if you add
290 @code{\addlyrics} or @code{\lyricsto}
291 when invoking your variable.
292
293 @example
294 verseOne = \lyricmode @{ Joy to the world the Lord is come @}
295 \score @{
296  <<
297    \new Voice = "one" \relative c'' @{
298      \autoBeamOff
299      \time 2/4
300      c4 b8. a16 g4. f8 e4 d c2
301    @}
302    \addlyrics @{ \verseOne @}
303  >>
304 @}
305 @end example
306
307 For different or more complex orderings, the best way is to setup the
308 hierarchy of staves and lyrics first, e.g.,
309 @example
310 \new ChoirStaff <<
311   \new Voice = "soprano" @{ @emph{music} @}
312   \new Lyrics = "sopranoLyrics" @{ s1 @}
313   \new Lyrics = "tenorLyrics" @{ s1 @}
314   \new Voice = "tenor" @{ @emph{music} @}
315 >>
316 @end example
317
318 and then combine the appropriate melodies and lyric lines
319
320 @example
321 \context Lyrics = sopranoLyrics \lyricsto "soprano"
322 @emph{the lyrics}
323 @end example
324
325 @noindent
326
327 The final input would resemble
328
329 @example
330 <<\new ChoirStaff << @emph{setup the music} >>
331  \lyricsto "soprano" @emph{etc}
332  \lyricsto "alto" @emph{etc}
333 @emph{etc}
334 >>
335 @end example
336
337 @seealso
338
339 @c TODO: document \new Staff << Voice \lyricsto >> bug
340 Internals Reference: @rinternals{LyricCombineMusic},
341 @rinternals{Lyrics}.
342
343
344 @node Aligning lyrics to a melody
345 @subsection Aligning lyrics to a melody
346
347 @funindex \lyricmode
348 @funindex \addlyrics
349 @funindex \lyricsto
350
351
352 Lyrics are printed by interpreting them in the context called
353 @rinternals{Lyrics}.
354
355 @example
356 \new Lyrics \lyricmode @dots{}
357 @end example
358
359 There are two main methods to specify the horizontal placement
360 of the syllables:
361
362 @itemize
363 @item
364 by automatically aligning
365 the lyrics to a melody or other voice of music, using @code{\addlyrics}
366 or @code{\lyricsto}.
367
368 @item
369 or by specifying the duration of each syllable
370 explicitly, using @code{\lyricmode}
371 @end itemize
372
373 @menu
374 * Automatic syllable durations::
375 * Manual syllable durations::
376 * Multiple syllables to one note::
377 * Multiple notes to one syllable::
378 * Skipping notes::
379 * Extenders and hyphens::
380 * Lyrics and repeats::
381 @end menu
382
383 @node Automatic syllable durations
384 @subsubsection Automatic syllable durations
385
386 @cindex automatic syllable durations
387 @cindex lyrics and melodies
388
389 The lyrics can be aligned under a given melody
390 automatically.  This is achieved by combining the
391 melody and the lyrics with the @code{\lyricsto} expression
392
393 @example
394 \new Lyrics \lyricsto @var{name} @dots{}
395 @end example
396
397 This aligns the lyrics to the
398 notes of the @rinternals{Voice} context called @var{name}, which must
399 already exist.  Therefore normally the @code{Voice} is specified first, and
400 then the lyrics are specified with @code{\lyricsto}.  The command
401 @code{\lyricsto} switches to @code{\lyricmode} mode automatically, so the
402 @code{\lyricmode} keyword may be omitted.
403
404 The following example uses different commands for entering lyrics.
405
406 @lilypond[quote,fragment,ragged-right,verbatim]
407 <<
408   \new Voice = "one" \relative c'' {
409     \autoBeamOff
410     \time 2/4
411     c4 b8. a16 g4. f8 e4 d c2
412   }
413   \new Lyrics \lyricmode { Joy4 to8. the16 world!4. the8 Lord4 is come.2 }
414   \new Lyrics \lyricmode { Joy to the earth! the Sa -- viour reigns. }
415   \new Lyrics \lyricsto "one" { No more let sins and sor -- rows grow. }
416 >>
417 @end lilypond
418
419 The second stanza is not properly aligned because the durations
420 were not specified.  A solution for that would be to use @code{\lyricsto}.
421
422 The @code{\addlyrics} command is actually just a convenient way
423 to write a more complicated LilyPond structure that sets up the
424 lyrics.
425
426 @example
427 @{ MUSIC @}
428 \addlyrics @{ LYRICS @}
429 @end example
430
431 @noindent
432 is the same as
433
434 @example
435 \new Voice = "blah" @{ music @}
436 \new Lyrics \lyricsto "blah" @{ LYRICS @}
437 @end example
438
439 @node Manual syllable durations
440 @subsubsection Manual syllable durations
441
442 Lyrics can also be entered without @code{\addlyrics} or
443 @code{\lyricsto}.  In this case,
444 syllables are entered like notes -- but with pitches replaced by text -- and the
445 duration of each syllable must be entered explicitly.  For example:
446
447 @example
448 play2 the4 game2.
449 sink2 or4 swim2.
450 @end example
451
452 The alignment to a melody can be specified with the
453 @code{associatedVoice} property,
454
455 @example
456 \set associatedVoice = #"lala"
457 @end example
458
459 @noindent
460 The value of the property (here: @code{"lala"}) should be the name of
461 a @rinternals{Voice} context.  Without this setting, extender lines
462 will not be formatted properly.
463
464 Here is an example demonstrating manual lyric durations,
465
466 @lilypond[relative=1,ragged-right,verbatim,fragment,quote]
467 << \new Voice = "melody" {
468     \time 3/4
469     c2 e4 g2.
470  }
471  \new Lyrics \lyricmode {
472    \set associatedVoice = #"melody"
473    play2 the4 game2.
474  } >>
475 @end lilypond
476
477 @seealso
478
479 Internals Reference: @rinternals{Lyrics}.
480
481
482 @node Multiple syllables to one note
483 @subsubsection Multiple syllables to one note
484
485
486 @funindex _
487 @cindex ties, in lyrics
488
489 In order to assign more than one syllable to a single note, you can
490 surround them with quotes or use a @code{_} character, to get spaces
491 between syllables, or use tilde  symbol (@code{~}) to get a lyric
492 tie@footnote{The lyric ties is implemented with the Unicode character
493 U+203F, so be
494 sure to have a font (Like DejaVuLGC) installed that includes this
495 glyph.}.
496
497 @lilypond[quote,relative=2,ragged-right,fragment,verbatim]
498 \time 3/4
499 \relative { c2 e4 g2 e4 }
500 \addlyrics { gran- de_a- mi- go }
501 \addlyrics { pu- "ro y ho-" nes- to }
502 \addlyrics { pu- ro~y~ho- nes- to }
503 @end lilypond
504
505 @seealso
506
507 Internals Reference: @rinternals{LyricCombineMusic}.
508
509 @c Here come the section which used to be "Melismata"
510 @c the new title might be more self-explanatory
511
512
513 @node Multiple notes to one syllable
514 @subsubsection Multiple notes to one syllable
515
516 @cindex melisma
517 @cindex melismata
518 @cindex phrasing, in lyrics
519
520 Sometimes, particularly in Medieval music, several notes are to be sung on one
521 single syllable; such vocalises are called melismas, or melismata.
522
523 @c this method seems to be the simplest; therefore
524 @c it might be better to present it first - vv
525
526 You can define melismata entirely in the lyrics, by entering @code{_}
527 for every note
528 that is part of the melisma.
529
530 @lilypond[relative=1,verbatim,fragment,quote]
531 { \set melismaBusyProperties = #'()
532  c d( e) f f( e) e e  }
533 \addlyrics
534  { Ky -- _ _ ri __ _ _ _  e }
535 @end lilypond
536
537 In this case, you can also have ties and slurs in the melody if you
538 set @code{melismaBusyProperties}, as is done in the example above.
539
540 However, the @code{\lyricsto} command can also
541 detect melismata automatically: it only puts one
542 syllable under a tied or slurred group of notes.  If you want to force
543 an unslurred group of notes to be a melisma, insert @code{\melisma}
544 after the first note of the group, and @code{\melismaEnd} after the
545 last one, e.g.,
546
547 @lilypond[quote,relative=2,ragged-right,fragment,verbatim]
548 <<
549   \new Voice = "lala" {
550     \time 3/4
551     f4 g8
552     \melisma
553     f e f
554     \melismaEnd
555     e2
556   }
557   \new Lyrics \lyricsto "lala" {
558     la di __ daah
559   }
560 >>
561 @end lilypond
562
563 In addition, notes are considered a melisma if they are manually
564 beamed, and automatic beaming (see @ref{Setting automatic beam
565 behavior}) is switched off.
566
567 @c TODO: there might be some more relevant place for
568 @c the following link (?)
569
570 @cindex SATB
571 @cindex choral score
572
573 A complete example of a SATB score setup is in section
574 @rlearning{Vocal ensembles}.
575
576
577 @predefined
578
579 @code{\melisma}, @code{\melismaEnd}
580 @funindex \melismaEnd
581 @funindex \melisma
582
583 @seealso
584
585 Internals Reference: @rinternals{Melisma_translator}.
586
587 @c @lsr{vocal,lyric@/-combine.ly}.
588
589 @knownissues
590
591 Melismata are not detected automatically, and extender lines must be
592 inserted by hand.
593
594 @node Skipping notes
595 @subsubsection Skipping notes
596
597 Making a lyric line run slower than the melody can be achieved by
598 inserting @code{\skip}s into the lyrics.  For every @code{\skip}, 
599 the text will be delayed another note.
600
601 For example,
602
603 @lilypond[verbatim,ragged-right,quote]
604 \relative { c c g' }
605 \addlyrics {
606   twin -- \skip 4
607   kle
608 }
609 @end lilypond
610
611
612 @node Extenders and hyphens
613 @subsubsection Extenders and hyphens
614
615 @cindex melisma
616 @cindex extender
617
618 @c leave this as samp. -gp
619 Melismata are indicated with a horizontal line centered between a syllable
620 and the next one.  Such a line is called an extender line, and it is entered
621 as @samp{ __ } (note the spaces before and after the two underscore
622 characters).
623
624 @cindex hyphens
625
626 @c leave this as samp. -gp
627 Centered hyphens are entered as @samp{ -- } between syllables of a same word
628 (note the spaces before and after the two hyphen characters).  The hyphen
629 will be centered between the syllables, and its length will be adjusted
630 depending on the space between the syllables.
631
632 In tightly engraved music, hyphens can be removed.  Whether this
633 happens can be controlled with the @code{minimum-distance} (minimum
634 distance between two syllables) and the @code{minimum-length}
635 (threshold below which hyphens are removed).
636
637 @seealso
638
639 Internals Reference: @rinternals{LyricExtender},
640 @rinternals{LyricHyphen}
641
642 @node Lyrics and repeats
643 @subsubsection Lyrics and repeats
644
645 @c TODO New section.  Add text
646 TBC
647
648
649 @node Placement of lyrics
650 @subsection Placement of lyrics
651
652 Often, different stanzas of one song are put to one melody in slightly
653 differing ways.  Such variations can still be captured with
654 @code{\lyricsto}.
655
656 @menu
657 * Divisi lyrics::
658 * Lyrics independent of notes::
659 * Chants::
660 * Spacing out syllables::
661 * Centering lyrics between staves::
662 @end menu
663
664
665
666 @node Divisi lyrics
667 @subsubsection Divisi lyrics
668
669 You can display alternate (or divisi) lyrics by naming voice
670 contexts and attaching lyrics to those specific contexts.
671
672 @lilypond[verbatim,ragged-right,quote]
673 \score{ <<
674   \new Voice = "melody" {
675     \relative c' {
676       c4
677       <<
678         { \voiceOne c8 e }
679         \new Voice = "splitpart" { \voiceTwo c4 }
680       >>
681       \oneVoice c4 c | c
682     }
683   }
684   \new Lyrics \lyricsto "melody" { we shall not o- ver- come }
685   \new Lyrics \lyricsto "splitpart" { will }
686 >> }
687 @end lilypond
688
689
690 You can use this trick to display different lyrics for a repeated
691 section.
692
693 @lilypond[verbatim,ragged-right,quote]
694 \score{ <<
695   \new Voice = "melody" \relative c' {
696     c2 e | g e | c1 |
697     \new Voice = "verse" \repeat volta 2 {c4 d e f | g1 | }
698     a2 b | c1}
699   \new Lyrics = "mainlyrics" \lyricsto melody \lyricmode {
700     do mi sol mi do
701     la si do }
702   \context Lyrics = "mainlyrics" \lyricsto verse \lyricmode {
703    do re mi fa sol }
704   \new Lyrics = "repeatlyrics" \lyricsto verse \lyricmode {
705    dodo rere mimi fafa solsol }
706 >>
707 }
708 @end lilypond
709
710
711
712 @node Lyrics independent of notes
713 @subsubsection Lyrics independent of notes
714
715 In some complex vocal music, it may be desirable to place
716 lyrics completely independently of notes.  Music defined
717 inside @code{lyricrhythm} disappears into the
718 @code{Devnull} context, but the rhythms can still be used
719 to place the lyrics.
720
721 @lilypond[quote,verbatim,ragged-right]
722 voice = {
723   c''2
724   \tag #'music { c''2 }
725   \tag #'lyricrhythm { c''4. c''8 }
726   d''1
727 }
728
729 lyr = \lyricmode { I like my cat! }
730
731 <<
732   \new Staff \keepWithTag #'music \voice
733   \new Devnull="nowhere" \keepWithTag #'lyricrhythm \voice
734   \new Lyrics \lyricsto "nowhere" \lyr
735   \new Staff { c'8 c' c' c' c' c' c' c'
736   c' c' c' c' c' c' c' c' }
737 >>
738 @end lilypond
739
740 @node Chants
741 @subsubsection Chants
742
743 @c TODO Add text from lsr and -user
744 TBC
745
746 @node Spacing out syllables
747 @subsubsection Spacing out syllables
748
749 @cindex Spacing lyrics
750 @cindex Lyrics, increasing space between
751
752 To increase the spacing between lyrics, set the minimum-distance property of
753 LyricSpace.
754
755 @lilypond[relative,verbatim,fragment,quote,ragged-right]
756 {
757   c c c c
758   \override Lyrics.LyricSpace #'minimum-distance = #1.0
759   c c c c
760 }
761 \addlyrics {
762   longtext longtext longtext longtext
763   longtext longtext longtext longtext
764 }
765 @end lilypond
766
767 To make this change for all lyrics in the score, set the property in the
768 layout.
769
770 @lilypond[relative,verbatim,quote,ragged-right]
771 \score {
772   \relative c' {
773   c c c c
774   c c c c
775   }
776   \addlyrics {
777   longtext longtext longtext longtext
778   longtext longtext longtext longtext
779   }
780   \layout {
781     \context {
782       \Lyrics
783       \override LyricSpace #'minimum-distance = #1.0
784     }
785   }
786 }
787 @end lilypond
788
789 @snippets
790 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
791 {aligning-lyrics.ly}
792
793 @c TODO Create and add lsr example of lyricMelismaAlignment
794 @c It's used like this to center-align all lyric syllables,
795 @c even when notes are tied. -td
796
797 @ignore
798 \layout
799 {
800      \context { \Score lyricMelismaAlignment = #0 }
801 }
802 @end ignore
803
804 @node Centering lyrics between staves
805 @subsubsection Centering lyrics between staves
806
807 @c TODO Add text from -user
808 TBC
809
810 @node Stanzas
811 @subsection Stanzas
812
813 @menu
814 * Adding stanza numbers ::
815 * Adding dynamics marks to stanzas::
816 * Adding singers' names to stanzas::
817 * Stanzas with different rhythms::
818 * Printing stanzas at the end ::
819 * Printing stanzas at the end in multiple columns ::
820 @end menu
821
822
823 @node Adding stanza numbers
824 @subsubsection Adding stanza numbers
825
826 @cindex stanza number
827
828 Stanza numbers can be added by setting @code{stanza}, e.g.,
829
830 @lilypond[quote,ragged-right,verbatim,relative=2,fragment]
831 \new Voice {
832   \time 3/4 g2 e4 a2 f4 g2.
833 } \addlyrics {
834   \set stanza = "1. "
835   Hi, my name is Bert.
836 } \addlyrics {
837   \set stanza = "2. "
838   Oh, ché -- ri, je t'aime
839 }
840 @end lilypond
841
842 @noindent
843 These numbers are put just before the start of the first syllable.
844
845 @c TODO Create and add snippet to show how two lines of a
846 @c stanza can be grouped together, along these lines: 
847 @c (might need improving a bit) -td
848
849 @ignore
850 leftbrace = \markup { \override #'(font-encoding . fetaBraces) \lookup
851 #"brace105" }
852
853 stanzaOneOne = {
854   \set stanza = \markup { "1. " \leftbrace }
855   \lyricmode { Child, you're mine and I love you.
856     Lend thine ear to what I say.
857     ...
858   }
859 }
860
861 stanzaOneThree =  {
862 %  \set stanza = \markup { "   "}
863   \lyricmode { Child, I have no great -- er joy
864     Than to have you walk in truth.
865 ...
866   }
867 }
868 @end ignore
869
870 @node Adding dynamics marks to stanzas
871 @subsubsection Adding dynamics marks to stanzas
872
873 Stanzas differing in loudness may be indicated by putting a
874 dynamics mark before each stanza.  In LilyPond, everything coming in
875 front of a stanza goes into the @code{StanzaNumber} object; dynamics marks
876 are no different.  For technical reasons, you have to set the stanza
877 outside @code{\lyricmode}:
878
879 @lilypond[quote,ragged-right,verbatim]
880 text = {
881   \set stanza = \markup { \dynamic "ff" "1. " }
882   \lyricmode {
883     Big bang
884   }
885 }
886
887 <<
888   \new Voice = "tune" {
889     \time 3/4
890     g'4 c'2
891   }
892 \new Lyrics \lyricsto "tune" \text
893 >>
894 @end lilypond
895
896 @node Adding singers' names to stanzas
897 @subsubsection Adding singers' names to stanzas
898
899 @cindex singer name
900 @cindex name of singer
901
902 Names of singers can also be added.  They are printed at the start of
903 the line, just like instrument names.  They are created by setting
904 @code{vocalName}.  A short version may be entered as @code{shortVocalName}.
905
906 @lilypond[fragment,ragged-right,quote,verbatim,relative=2]
907 \new Voice {
908   \time 3/4 g2 e4 a2 f4 g2.
909 } \addlyrics {
910   \set vocalName = "Bert "
911   Hi, my name is Bert.
912 } \addlyrics {
913   \set vocalName = "Ernie "
914   Oh, che -- ri, je t'aime
915 }
916 @end lilypond
917
918 @node Stanzas with different rhythms
919 @subsubsection Stanzas with different rhythms
920
921 @subsubheading Ignoring melismata
922
923 One possibility is that the text has a melisma in one stanza, but
924 multiple syllables in another one.  One solution is to make the faster
925 voice ignore the melisma.  This is done by setting
926 @code{ignoreMelismata} in the Lyrics context.
927
928 There is one tricky aspect: the setting for @code{ignoreMelismata}
929 must be set one syllable @emph{before} the non-melismatic syllable
930 in the text, as shown here,
931
932 @c  TODO: breaks compile
933 @lilypond[verbatim,ragged-right,quote]
934 %{
935 <<
936   \relative \new Voice = "lahlah" {
937     \set Staff.autoBeaming = ##f
938     c4
939     \slurDotted
940     f8.[( g16])
941     a4
942   }
943   \new Lyrics \lyricsto "lahlah" {
944     more slow -- ly
945   }
946   \new Lyrics \lyricsto "lahlah" {
947     \set ignoreMelismata = ##t % applies to "fas"
948     go fas -- ter
949     \unset ignoreMelismata
950     still
951   }
952 >>
953 %}
954 @end lilypond
955
956
957 The @code{ignoreMelismata} applies to the syllable @q{fas}, so it
958 should be entered before @q{go}.
959
960
961 @subsubheading Switching to an alternative melody
962
963 More complex variations in text underlay are possible.  It is possible
964 to switch the melody for a line of lyrics during the text.  This is
965 done by setting the @code{associatedVoice} property.  In the example
966
967 @lilypond[ragged-right,quote]
968 <<
969   \relative \new Voice = "lahlah" {
970     \set Staff.autoBeaming = ##f
971     c4
972     <<
973       \new Voice = "alternative" {
974         \voiceOne
975         \times 2/3 {
976           % show associations clearly.
977           \override NoteColumn #'force-hshift = #-3
978           f8 f g
979         }
980       }
981       {
982         \voiceTwo
983         f8.[ g16]
984         \oneVoice
985       } >>
986     a8( b) c
987   }
988   \new Lyrics \lyricsto "lahlah" {
989     Ju -- ras -- sic Park
990   }
991   \new Lyrics \lyricsto "lahlah" {
992     % Tricky: need to set associatedVoice
993     % one syllable too soon!
994     \set associatedVoice = alternative % applies to "ran"
995     Ty --
996     ran --
997     no --
998     \set associatedVoice = lahlah % applies to "rus"
999     sau -- rus Rex
1000   } >>
1001 @end lilypond
1002
1003 @noindent
1004 the text for the first stanza is set to a melody called @q{lahlah},
1005
1006 @example
1007 \new Lyrics \lyricsto "lahlah" @{
1008   Ju -- ras -- sic Park
1009 @}
1010 @end example
1011
1012
1013 The second stanza initially is set to the @code{lahlah} context, but
1014 for the syllable @q{ran}, it switches to a different melody.
1015 This is achieved with
1016 @example
1017 \set associatedVoice = alternative
1018 @end example
1019
1020 @noindent
1021 Here, @code{alternative} is the name of the @code{Voice} context
1022 containing the triplet.
1023
1024 Again, the command must be one syllable too early, before @q{Ty} in
1025 this case.
1026
1027 @example
1028 \new Lyrics \lyricsto "lahlah" @{
1029   \set associatedVoice = alternative % applies to "ran"
1030   Ty --
1031   ran --
1032   no --
1033   \set associatedVoice = lahlah % applies to "rus"
1034   sau -- rus Rex
1035 @}
1036 @end example
1037
1038 @noindent
1039 The underlay is switched back to the starting situation by assigning
1040 @code{lahlah} to @code{associatedVoice}.
1041
1042
1043 @node Printing stanzas at the end
1044 @subsubsection Printing stanzas at the end
1045
1046 Sometimes it is appropriate to have one stanza set
1047 to the music, and the rest added in verse form at
1048 the end of the piece.  This can be accomplished by adding
1049 the extra verses into a @code{\markup} section outside
1050 of the main score block.  Notice that there are two
1051 different ways to force linebreaks when using
1052 @code{\markup}.
1053
1054 @lilypond[ragged-right,verbatim,quote]
1055 melody = \relative c' {
1056 e d c d | e e e e |
1057 d d e d | c1 |
1058 }
1059
1060 text = \lyricmode {
1061 \set stanza = "1." Ma- ry had a lit- tle lamb,
1062 its fleece was white as snow.
1063 }
1064
1065 \score{ <<
1066   \new Voice = "one" { \melody }
1067   \new Lyrics \lyricsto "one" \text
1068 >>
1069   \layout { }
1070 }
1071 \markup { \column{
1072   \line{ Verse 2. }
1073   \line{ All the children laughed and played }
1074   \line{ To see a lamb at school. }
1075   }
1076 }
1077 \markup{
1078   \wordwrap-string #"
1079   Verse 3.
1080
1081   Mary took it home again,
1082
1083   It was against the rule."
1084 }
1085 @end lilypond
1086
1087
1088 @node Printing stanzas at the end in multiple columns
1089 @subsubsection Printing stanzas at the end in multiple columns
1090
1091 When a piece of music has many verses, they are often printed in
1092 multiple columns across the page.  An outdented verse number often
1093 introduces each verse.  The following example shows how to produce such
1094 output in LilyPond.
1095
1096 @lilypond[ragged-right,quote,verbatim]
1097 melody = \relative c' {
1098   c c c c | d d d d
1099 }
1100  
1101 text = \lyricmode {
1102   \set stanza = "1." This is verse one.
1103   It has two lines.
1104 }
1105
1106 \score{ <<
1107     \new Voice = "one" { \melody }
1108     \new Lyrics \lyricsto "one" \text
1109    >>
1110   \layout { }
1111 }
1112
1113 \markup {
1114   \fill-line {
1115     \hspace #0.1 % moves the column off the left margin; can be removed if
1116         % space on the page is tight
1117      \column {
1118       \line { \bold "2."
1119         \column {
1120           "This is verse two."
1121           "It has two lines."
1122         }
1123       }
1124       \hspace #0.1 % adds vertical spacing between verses
1125       \line { \bold "3."
1126         \column {
1127           "This is verse three."
1128           "It has two lines."
1129         }
1130       }
1131     }
1132     \hspace #0.1  % adds horizontal spacing between columns; if they are
1133         % still too close, add more " " pairs until the result 
1134         % looks good
1135      \column {
1136       \line { \bold "4."
1137         \column {
1138           "This is verse four."
1139           "It has two lines."
1140         }
1141       }
1142       \hspace #0.1 % adds vertical spacing between verses
1143       \line { \bold "5."
1144         \column {
1145           "This is verse five."
1146           "It has two lines."
1147         }
1148       }
1149     }
1150   \hspace #0.1 % gives some extra space on the right margin; can
1151       % be removed if page space is tight
1152   }
1153 }
1154 @end lilypond
1155
1156
1157 @seealso
1158
1159 Internals Reference: @rinternals{LyricText}, @rinternals{StanzaNumber},
1160 @rinternals{VocalName}.
1161
1162
1163
1164