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