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