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