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