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