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