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