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