]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/vocal.itely
Merge branch 'master' of ssh://kainhofer@git.sv.gnu.org/srv/git/lilypond into dev...
[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   \new Lyrics \lyricmode { Joy4 to8. the16 world!4. the8 Lord4 is come.2 }
462   \new Lyrics \lyricmode { Joy to the earth! the Sa -- viour reigns. }
463   \new Lyrics \lyricsto "one" { No more let sins and sor -- rows grow. }
464 >>
465 @end lilypond
466
467 The second stanza is not properly aligned because the durations
468 were not specified.  A solution for that would be to use @code{\lyricsto}.
469
470 The @code{\addlyrics} command is actually just a convenient way
471 to write a more complicated LilyPond structure that sets up the
472 lyrics.
473
474 @example
475 @{ MUSIC @}
476 \addlyrics @{ LYRICS @}
477 @end example
478
479 @noindent
480 is the same as
481
482 @example
483 \new Voice = "blah" @{ music @}
484 \new Lyrics \lyricsto "blah" @{ LYRICS @}
485 @end example
486
487 @node Manual syllable durations
488 @subsubsection Manual syllable durations
489
490 Lyrics can also be entered without @code{\addlyrics} or
491 @code{\lyricsto}.  In this case,
492 syllables are entered like notes -- but with pitches replaced by text -- and the
493 duration of each syllable must be entered explicitly.  For example:
494
495 @example
496 play2 the4 game2.
497 sink2 or4 swim2.
498 @end example
499
500 The alignment to a melody can be specified with the
501 @code{associatedVoice} property,
502
503 @example
504 \set associatedVoice = #"lala"
505 @end example
506
507 @noindent
508 The value of the property (here: @code{"lala"}) should be the name of
509 a @rinternals{Voice} context.  Without this setting, extender lines
510 will not be formatted properly.
511
512 Here is an example demonstrating manual lyric durations,
513
514 @lilypond[relative=1,ragged-right,verbatim,fragment,quote]
515 << \new Voice = "melody" {
516     \time 3/4
517     c2 e4 g2.
518  }
519  \new Lyrics \lyricmode {
520    \set associatedVoice = #"melody"
521    play2 the4 game2.
522  } >>
523 @end lilypond
524
525 @seealso
526
527 Internals Reference:
528 @rinternals{Lyrics}.
529
530
531 @node Multiple syllables to one note
532 @subsubsection Multiple syllables to one note
533
534
535 @funindex _
536 @cindex ties, in lyrics
537
538 In order to assign more than one syllable to a single note, you can
539 surround them with quotes or use a @code{_} character, to get spaces
540 between syllables, or use tilde  symbol (@code{~}) to get a lyric
541 tie@footnote{The lyric ties is implemented with the Unicode character
542 U+203F, so be
543 sure to have a font (Like DejaVuLGC) installed that includes this
544 glyph.}.
545
546 @lilypond[quote,ragged-right,fragment,verbatim]
547 \time 3/4
548 \relative c' { c2 e4 g2 e4 }
549 \addlyrics { gran- de_a- mi- go }
550 \addlyrics { pu- "ro y ho-" nes- to }
551 \addlyrics { pu- ro~y~ho- nes- to }
552 @end lilypond
553
554 @seealso
555
556 Internals Reference:
557 @rinternals{LyricCombineMusic}.
558
559 @c Here come the section which used to be "Melismata"
560 @c the new title might be more self-explanatory
561
562
563 @node Multiple notes to one syllable
564 @subsubsection Multiple notes to one syllable
565
566 @cindex melisma
567 @cindex melismata
568 @cindex phrasing, in lyrics
569
570 Sometimes, particularly in Medieval music, several notes are to be sung on one
571 single syllable; such vocalises are called melismas, or melismata.
572
573 @c this method seems to be the simplest; therefore
574 @c it might be better to present it first - vv
575
576 You can define melismata entirely in the lyrics, by entering @code{_}
577 for every note that is part of the melisma.
578
579 @c verbose! --FV
580 @c duplicated: TODO fix
581 Additionaly, you can make an extender line to be typeset to indicate
582 the melisma in the score, writing a double underscore next to the
583 first syllable of the melisma. This example shows the three elements
584 that are used for this purpose (all of them surrounded by spaces):
585 double hyphens to separate syllables in a word, underscores to add
586 notes to a melisma, and a double underscore to put an extender line.
587
588 @lilypond[relative=1,verbatim,fragment,quote]
589 { \set melismaBusyProperties = #'()
590  c d( e) f f( e) e e  }
591 \addlyrics
592  { Ky -- _ _ ri __ _ _ _  e }
593 @end lilypond
594
595 In this case, you can also have ties and slurs in the melody if you
596 set @code{melismaBusyProperties}, as is done in the example above.
597
598 However, the @code{\lyricsto} command can also
599 detect melismata automatically: it only puts one
600 syllable under a tied or slurred group of notes.  If you want to force
601 an unslurred group of notes to be a melisma, insert @code{\melisma}
602 after the first note of the group, and @code{\melismaEnd} after the
603 last one, e.g.,
604
605 @lilypond[quote,relative=2,ragged-right,fragment,verbatim]
606 <<
607   \new Voice = "lala" {
608     \time 3/4
609     f4 g8
610     \melisma
611     f e f
612     \melismaEnd
613     e2
614   }
615   \new Lyrics \lyricsto "lala" {
616     la di __ daah
617   }
618 >>
619 @end lilypond
620
621 In addition, notes are considered a melisma if they are manually
622 beamed, and automatic beaming (see @ref{Setting automatic beam
623 behavior}) is switched off.
624
625 @c TODO: there might be some more relevant place for
626 @c the following link (?)
627
628 @cindex SATB
629 @cindex choral score
630
631 A complete example of a SATB score setup is in section
632 @rlearning{Vocal ensembles}.
633
634
635 @predefined
636
637 @code{\melisma}, @code{\melismaEnd}
638 @funindex \melismaEnd
639 @funindex \melisma
640
641 @seealso
642
643 Internals Reference:
644 @rinternals{Melisma_translator}.
645
646 @c @lsr{vocal,lyric@/-combine.ly}.
647
648 @knownissues
649
650 Melismata are not detected automatically, and extender lines must be
651 inserted by hand.
652
653 @node Skipping notes
654 @subsubsection Skipping notes
655
656 Making a lyric line run slower than the melody can be achieved by
657 inserting @code{\skip}s into the lyrics.  For every @code{\skip}, 
658 the text will be delayed another note.
659
660 For example,
661
662 @lilypond[verbatim,ragged-right,quote]
663 \relative c' { c c g' }
664 \addlyrics {
665   twin -- \skip 4
666   kle
667 }
668 @end lilypond
669
670
671 @node Extenders and hyphens
672 @subsubsection Extenders and hyphens
673
674 @cindex melisma
675 @cindex extender
676
677 @c leave this as samp. -gp
678 Melismata are sometimes indicated with a long horizontal line starting
679 in the melisma syllable, and ending in the next one.  Such a line is
680 called an extender line, and it is entered as @samp{ __ } (note the
681 spaces before and after the two underscore characters).
682
683 @warning{Melismata are indicated in the score with extender lines,
684 which are entered as one double underscore; but short melismata can
685 also be entered by skipping individual notes, which are entered as
686 single underscore characters; these do not make an extender line to be
687 typeset by default.}
688
689 @cindex hyphens
690
691 @c leave this as samp. -gp
692 Centered hyphens are entered as @samp{ -- } between syllables of a same word
693 (note the spaces before and after the two hyphen characters).  The hyphen
694 will be centered between the syllables, and its length will be adjusted
695 depending on the space between the syllables.
696
697 In tightly engraved music, hyphens can be removed.  Whether this
698 happens can be controlled with the @code{minimum-distance} (minimum
699 distance between two syllables) and the @code{minimum-length}
700 (threshold below which hyphens are removed).
701
702 @seealso
703
704 Internals Reference:
705 @rinternals{LyricExtender},
706 @rinternals{LyricHyphen}
707
708 @node Lyrics and repeats
709 @subsubsection Lyrics and repeats
710
711 @c TODO New section.  Add text
712 TBC
713
714
715 @node Placement of lyrics
716 @subsection Placement of lyrics
717
718 Often, different stanzas of one song are put to one melody in slightly
719 differing ways.  Such variations can still be captured with
720 @code{\lyricsto}.
721
722 @menu
723 * Divisi lyrics::
724 * Lyrics independent of notes::
725 * Chants::
726 * Spacing out syllables::
727 * Centering lyrics between staves::
728 @end menu
729
730
731
732 @node Divisi lyrics
733 @subsubsection Divisi lyrics
734
735 You can display alternate (or divisi) lyrics by naming voice
736 contexts and attaching lyrics to those specific contexts.
737
738 @lilypond[verbatim,ragged-right,quote]
739 \score{ <<
740   \new Voice = "melody" {
741     \relative c' {
742       c4
743       <<
744         { \voiceOne c8 e }
745         \new Voice = "splitpart" { \voiceTwo c4 }
746       >>
747       \oneVoice c4 c | c
748     }
749   }
750   \new Lyrics \lyricsto "melody" { we shall not o- ver- come }
751   \new Lyrics \lyricsto "splitpart" { will }
752 >> }
753 @end lilypond
754
755
756 You can use this trick to display different lyrics for a repeated
757 section.
758
759 @lilypond[verbatim,ragged-right,quote]
760 \score{ <<
761   \new Voice = "melody" \relative c' {
762     c2 e | g e | c1 |
763     \new Voice = "verse" \repeat volta 2 {c4 d e f | g1 | }
764     a2 b | c1}
765   \new Lyrics = "mainlyrics" \lyricsto melody \lyricmode {
766     do mi sol mi do
767     la si do }
768   \context Lyrics = "mainlyrics" \lyricsto verse \lyricmode {
769    do re mi fa sol }
770   \new Lyrics = "repeatlyrics" \lyricsto verse \lyricmode {
771    dodo rere mimi fafa solsol }
772 >>
773 }
774 @end lilypond
775
776
777
778 @node Lyrics independent of notes
779 @subsubsection Lyrics independent of notes
780
781 @cindex Devnull context
782
783 In some complex vocal music, it may be desirable to place
784 lyrics completely independently of notes.  Music defined
785 inside @code{lyricrhythm} disappears into the
786 @code{Devnull} context, but the rhythms can still be used
787 to place the lyrics.
788
789 @lilypond[quote,verbatim,ragged-right]
790 voice = {
791   c''2
792   \tag #'music { c''2 }
793   \tag #'lyricrhythm { c''4. c''8 }
794   d''1
795 }
796
797 lyr = \lyricmode { I like my cat! }
798
799 <<
800   \new Staff \keepWithTag #'music \voice
801   \new Devnull="nowhere" \keepWithTag #'lyricrhythm \voice
802   \new Lyrics \lyricsto "nowhere" \lyr
803   \new Staff { c'8 c' c' c' c' c' c' c'
804   c' c' c' c' c' c' c' c' }
805 >>
806 @end lilypond
807
808 This method is recommended only if the music in the @code{Devnull}
809 context does not contain melismata.  Melismata are defined by the
810 @code{Voice} context. Connecting lyrics to a @code{Devnull} context
811 makes the voice/lyrics links to get lost, and so does the info on
812 melismata.  Therefore, if you link lyrics to a @code{Devnull} context,
813 the implicit melismata get ignored.
814
815 @c Conclusion: do not use devnull for lyrics -FV
816
817 @c this clarifies http://code.google.com/p/lilypond/issues/detail?id=248
818
819
820 @node Chants
821 @subsubsection Chants
822
823 @c TODO Add text from lsr and -user
824 TBC
825
826 @node Spacing out syllables
827 @subsubsection Spacing out syllables
828
829 @cindex Spacing lyrics
830 @cindex Lyrics, increasing space between
831
832 To increase the spacing between lyrics, set the minimum-distance property of
833 LyricSpace.
834
835 @lilypond[relative,verbatim,fragment,quote,ragged-right]
836 {
837   c c c c
838   \override Lyrics.LyricSpace #'minimum-distance = #1.0
839   c c c c
840 }
841 \addlyrics {
842   longtext longtext longtext longtext
843   longtext longtext longtext longtext
844 }
845 @end lilypond
846
847 To make this change for all lyrics in the score, set the property in the
848 layout.
849
850 @lilypond[verbatim,quote,ragged-right]
851 \score {
852   \relative c' {
853   c c c c
854   c c c c
855   }
856   \addlyrics {
857   longtext longtext longtext longtext
858   longtext longtext longtext longtext
859   }
860   \layout {
861     \context {
862       \Lyrics
863       \override LyricSpace #'minimum-distance = #1.0
864     }
865   }
866 }
867 @end lilypond
868
869 @snippets
870 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
871 {aligning-lyrics.ly}
872
873 @c TODO Create and add lsr example of lyricMelismaAlignment
874 @c It's used like this to center-align all lyric syllables,
875 @c even when notes are tied. -td
876
877 @ignore
878 \layout
879 {
880      \context { \Score lyricMelismaAlignment = #0 }
881 }
882 @end ignore
883
884 @node Centering lyrics between staves
885 @subsubsection Centering lyrics between staves
886
887 @c TODO Add text from -user
888 TBC
889
890 @node Stanzas
891 @subsection Stanzas
892
893 @menu
894 * Adding stanza numbers ::
895 * Adding dynamics marks to stanzas::
896 * Adding singers' names to stanzas::
897 * Stanzas with different rhythms::
898 * Printing stanzas at the end ::
899 * Printing stanzas at the end in multiple columns ::
900 @end menu
901
902
903 @node Adding stanza numbers
904 @subsubsection Adding stanza numbers
905
906 @cindex stanza number
907
908 Stanza numbers can be added by setting @code{stanza}, e.g.,
909
910 @lilypond[quote,ragged-right,verbatim,relative=2,fragment]
911 \new Voice {
912   \time 3/4 g2 e4 a2 f4 g2.
913 } \addlyrics {
914   \set stanza = "1. "
915   Hi, my name is Bert.
916 } \addlyrics {
917   \set stanza = "2. "
918   Oh, ché -- ri, je t'aime
919 }
920 @end lilypond
921
922
923 @noindent
924 These numbers are put just before the start of the first syllable.
925
926 @c TODO Create and add snippet to show how two lines of a
927 @c stanza can be grouped together, along these lines: 
928 @c (might need improving a bit) -td
929
930 @ignore
931 leftbrace = \markup { \override #'(font-encoding . fetaBraces) \lookup
932 #"brace105" }
933
934 stanzaOneOne = {
935   \set stanza = \markup { "1. " \leftbrace }
936   \lyricmode { Child, you're mine and I love you.
937     Lend thine ear to what I say.
938
939   }
940 }
941
942 stanzaOneThree =  {
943 %  \set stanza = \markup { "   "}
944   \lyricmode { Child, I have no great -- er joy
945     Than to have you walk in truth.
946
947   }
948 }
949
950 \new Voice {
951   \repeat volta 2 { c'8 c' c' c' c' c' c'4 
952                     c'8 c' c' c' c' c' c'4   } 
953 }  \addlyrics { \stanzaOneOne }
954    \addlyrics { \stanzaOneThree }
955
956 @end ignore
957
958 @node Adding dynamics marks to stanzas
959 @subsubsection Adding dynamics marks to stanzas
960
961 Stanzas differing in loudness may be indicated by putting a
962 dynamics mark before each stanza.  In LilyPond, everything coming in
963 front of a stanza goes into the @code{StanzaNumber} object; dynamics marks
964 are no different.  For technical reasons, you have to set the stanza
965 outside @code{\lyricmode}:
966
967 @lilypond[quote,ragged-right,verbatim]
968 text = {
969   \set stanza = \markup { \dynamic "ff" "1. " }
970   \lyricmode {
971     Big bang
972   }
973 }
974
975 <<
976   \new Voice = "tune" {
977     \time 3/4
978     g'4 c'2
979   }
980 \new Lyrics \lyricsto "tune" \text
981 >>
982 @end lilypond
983
984 @node Adding singers' names to stanzas
985 @subsubsection Adding singers' names to stanzas
986
987 @cindex singer name
988 @cindex name of singer
989
990 Names of singers can also be added.  They are printed at the start of
991 the line, just like instrument names.  They are created by setting
992 @code{vocalName}.  A short version may be entered as @code{shortVocalName}.
993
994 @lilypond[fragment,ragged-right,quote,verbatim,relative=2]
995 \new Voice {
996   \time 3/4 g2 e4 a2 f4 g2.
997 } \addlyrics {
998   \set vocalName = "Bert "
999   Hi, my name is Bert.
1000 } \addlyrics {
1001   \set vocalName = "Ernie "
1002   Oh, ché -- ri, je t'aime
1003 }
1004 @end lilypond
1005
1006 @node Stanzas with different rhythms
1007 @subsubsection Stanzas with different rhythms
1008
1009 @subsubheading Ignoring melismata
1010
1011 One possibility is that the text has a melisma in one stanza, but
1012 multiple syllables in another one.  One solution is to make the faster
1013 voice ignore the melisma.  This is done by setting
1014 @code{ignoreMelismata} in the Lyrics context.
1015
1016 There is one tricky aspect: the setting for @code{ignoreMelismata}
1017 must be set one syllable @emph{before} the non-melismatic syllable
1018 in the text, as shown here,
1019
1020 @c  TODO: breaks compile
1021 @c seems to be fixed, does not break compile anymore --FV
1022 @lilypond[verbatim,ragged-right,quote]
1023 <<
1024   \relative c' \new Voice = "lahlah" {
1025     \set Staff.autoBeaming = ##f
1026     c4
1027     \slurDotted
1028     f8.[( g16])
1029     a4
1030   }
1031   \new Lyrics \lyricsto "lahlah" {
1032     more slow -- ly
1033   }
1034   \new Lyrics \lyricsto "lahlah" {
1035     \set ignoreMelismata = ##t % applies to "fas"
1036     go fas -- ter
1037     \unset ignoreMelismata
1038     still
1039   }
1040 >>
1041 @end lilypond
1042
1043
1044 The @code{ignoreMelismata} applies to the syllable @q{fas}, so it
1045 should be entered before @q{go}.
1046
1047
1048 @subsubheading Switching to an alternative melody
1049
1050 More complex variations in text underlay are possible.  It is possible
1051 to switch the melody for a line of lyrics during the text.  This is
1052 done by setting the @code{associatedVoice} property.  In the example
1053
1054 @lilypond[ragged-right,quote]
1055 <<
1056   \relative c' \new Voice = "lahlah" {
1057     \set Staff.autoBeaming = ##f
1058     c4
1059     <<
1060       \new Voice = "alternative" {
1061         \voiceOne
1062         \times 2/3 {
1063           % show associations clearly.
1064           \override NoteColumn #'force-hshift = #-3
1065           f8 f g
1066         }
1067       }
1068       {
1069         \voiceTwo
1070         f8.[ g16]
1071         \oneVoice
1072       } >>
1073     a8( b) c
1074   }
1075   \new Lyrics \lyricsto "lahlah" {
1076     Ju -- ras -- sic Park
1077   }
1078   \new Lyrics \lyricsto "lahlah" {
1079     % Tricky: need to set associatedVoice
1080     % one syllable too soon!
1081     \set associatedVoice = alternative % applies to "ran"
1082     Ty --
1083     ran --
1084     no --
1085     \set associatedVoice = lahlah % applies to "rus"
1086     sau -- rus Rex
1087   } >>
1088 @end lilypond
1089
1090 @noindent
1091 the text for the first stanza is set to a melody called @q{lahlah},
1092
1093 @example
1094 \new Lyrics \lyricsto "lahlah" @{
1095   Ju -- ras -- sic Park
1096 @}
1097 @end example
1098
1099
1100 The second stanza initially is set to the @code{lahlah} context, but
1101 for the syllable @q{ran}, it switches to a different melody.
1102 This is achieved with
1103 @example
1104 \set associatedVoice = alternative
1105 @end example
1106
1107 @noindent
1108 Here, @code{alternative} is the name of the @code{Voice} context
1109 containing the triplet.
1110
1111 This command command must be one syllable too early, before @q{Ty} in
1112 this case.  In other words, changing the associatedVoice happens one
1113 step later than expected.  This is for technical reasons, and it is
1114 not a bug.
1115
1116 @example
1117 \new Lyrics \lyricsto "lahlah" @{
1118   \set associatedVoice = alternative % applies to "ran"
1119   Ty --
1120   ran --
1121   no --
1122   \set associatedVoice = lahlah % applies to "rus"
1123   sau -- rus Rex
1124 @}
1125 @end example
1126
1127 @noindent
1128 The underlay is switched back to the starting situation by assigning
1129 @code{lahlah} to @code{associatedVoice}.
1130
1131
1132 @node Printing stanzas at the end
1133 @subsubsection Printing stanzas at the end
1134
1135 Sometimes it is appropriate to have one stanza set
1136 to the music, and the rest added in verse form at
1137 the end of the piece.  This can be accomplished by adding
1138 the extra verses into a @code{\markup} section outside
1139 of the main score block.  Notice that there are two
1140 different ways to force linebreaks when using
1141 @code{\markup}.
1142
1143 @lilypond[ragged-right,verbatim,quote]
1144 melody = \relative c' {
1145 e d c d | e e e e |
1146 d d e d | c1 |
1147 }
1148
1149 text = \lyricmode {
1150 \set stanza = "1." Ma- ry had a lit- tle lamb,
1151 its fleece was white as snow.
1152 }
1153
1154 \score{ <<
1155   \new Voice = "one" { \melody }
1156   \new Lyrics \lyricsto "one" \text
1157 >>
1158   \layout { }
1159 }
1160 \markup { \column{
1161   \line{ Verse 2. }
1162   \line{ All the children laughed and played }
1163   \line{ To see a lamb at school. }
1164   }
1165 }
1166 \markup{
1167   \wordwrap-string #"
1168   Verse 3.
1169
1170   Mary took it home again,
1171
1172   It was against the rule."
1173 }
1174 @end lilypond
1175
1176
1177 @node Printing stanzas at the end in multiple columns
1178 @subsubsection Printing stanzas at the end in multiple columns
1179
1180 When a piece of music has many verses, they are often printed in
1181 multiple columns across the page.  An outdented verse number often
1182 introduces each verse.  The following example shows how to produce such
1183 output in LilyPond.
1184
1185 @lilypond[ragged-right,quote,verbatim]
1186 melody = \relative c' {
1187   c c c c | d d d d
1188 }
1189  
1190 text = \lyricmode {
1191   \set stanza = "1." This is verse one.
1192   It has two lines.
1193 }
1194
1195 \score{ <<
1196     \new Voice = "one" { \melody }
1197     \new Lyrics \lyricsto "one" \text
1198    >>
1199   \layout { }
1200 }
1201
1202 \markup {
1203   \fill-line {
1204     \hspace #0.1 % moves the column off the left margin; 
1205         % can be removed if space on the page is tight
1206      \column {
1207       \line { \bold "2."
1208         \column {
1209           "This is verse two."
1210           "It has two lines."
1211         }
1212       }
1213       \hspace #0.1 % adds vertical spacing between verses
1214       \line { \bold "3."
1215         \column {
1216           "This is verse three."
1217           "It has two lines."
1218         }
1219       }
1220     }
1221     \hspace #0.1  % adds horizontal spacing between columns; 
1222         % if they are still too close, add more " " pairs  
1223         % until the result looks good
1224      \column {
1225       \line { \bold "4."
1226         \column {
1227           "This is verse four."
1228           "It has two lines."
1229         }
1230       }
1231       \hspace #0.1 % adds vertical spacing between verses
1232       \line { \bold "5."
1233         \column {
1234           "This is verse five."
1235           "It has two lines."
1236         }
1237       }
1238     }
1239   \hspace #0.1 % gives some extra space on the right margin; 
1240       % can be removed if page space is tight
1241   }
1242 }
1243 @end lilypond
1244
1245
1246 @seealso
1247
1248 Internals Reference:
1249 @rinternals{LyricText},
1250 @rinternals{StanzaNumber},
1251 @rinternals{VocalName}.
1252
1253
1254
1255