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