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