LilyPond Notation Reference: 2.1.3 Stanzas

### 2.1.3 Stanzas

#### Adding stanza numbers

Stanza numbers can be added by setting `stanza`, e.g.,

>     \new Voice {
>       \time 3/4 g2 e4 a2 f4 g2.
>     } \addlyrics {
>       \set stanza = #"1. "
>       Hi, my name is Bert.
>     } \addlyrics {
>       \set stanza = #"2. "
>       Oh, ché -- ri, je t'aime
>     }

These numbers are put just before the start of the first syllable.

#### Adding dynamics marks to stanzas

Stanzas differing in loudness may be indicated by putting a dynamics mark before each stanza. In LilyPond, everything coming in front of a stanza goes into the `StanzaNumber` object; dynamics marks are no different. For technical reasons, you have to set the stanza outside `\lyricmode`:

>     text = {
>       \set stanza = \markup { \dynamic "ff" "1. " }
>       \lyricmode {
>         Big bang
>       }
>     }

>     <<
>       \new Voice = "tune" {
>         \time 3/4
>         g'4 c'2
>       }
>     \new Lyrics \lyricsto "tune" \text
>     >>

#### Adding singers’ names to stanzas

Names of singers can also be added. They are printed at the start of the line, just like instrument names. They are created by setting `vocalName`. A short version may be entered as `shortVocalName`.

>     \new Voice {
>       \time 3/4 g2 e4 a2 f4 g2.
>     } \addlyrics {
>       \set vocalName = #"Bert "
>       Hi, my name is Bert.
>     } \addlyrics {
>       \set vocalName = #"Ernie "
>       Oh, ché -- ri, je t'aime
>     }

#### Stanzas with different rhythms

Often, different stanzas of one song are put to one melody in slightly differing ways. Such variations can still be captured with `\lyricsto`.

#### Ignoring melismata

One possibility is that the text has a melisma in one stanza, but multiple syllables in another. One solution is to make the faster voice ignore the melisma. This is done by setting `ignoreMelismata` in the Lyrics context.

>     <<
>       \relative c' \new Voice = "lahlah" {
>         \set Staff.autoBeaming = ##f
>         c4
>         \slurDotted
>         f8.[( g16])
>         a4
>       }
>       \new Lyrics \lyricsto "lahlah" {
>         more slow -- ly
>       }
>       \new Lyrics \lyricsto "lahlah" {
>         go
>         \set ignoreMelismata = ##t
>         fas -- ter
>         \unset ignoreMelismata
>         still
>       }
>     >>

#### Known issues and warnings

Unlike most `\set` commands, `\set ignoreMelismata` does not work if prefixed with `\once`. It is necessary to use `\set` and `\unset` to bracket the lyrics where melismata are to be ignored.

#### Adding syllables to grace notes

By default, grace notes (e.g. via `\grace`) do not get assigned syllables when using `\lyricsto`, but this behavior can be changed:

>     <<
>       \new Voice = melody \relative c' {
>         f4 \appoggiatura a32 b4
>         \grace { f16[ a16] } b2
>         \afterGrace b2 { f16[ a16] }
>         \appoggiatura a32 b4
>         \acciaccatura a8 b4
>       }
>       \new Lyrics
>       \lyricsto melody {
>         normal
>         \set includeGraceNotes = ##t
>         case,
>         gra -- ce case,
>         after -- grace case,
>         \set ignoreMelismata = ##t
>         app. case,
>         acc. case.
>       }
>     >>

#### Known issues and warnings

Like `associatedVoice`, `includeGraceNotes` needs to be set at latest one syllable before the one which is to be put under a grace note. For the case of a grace note at the very beginning of a piece of music, consider using a `\with` or `\context` block:

>     <<
>       \new Voice = melody \relative c' {
>         \grace { c16[( d e f] }
>         g1) f
>       }
>       \new Lyrics \with { includeGraceNotes = ##t }
>       \lyricsto melody {
>         Ah __ fa
>       }
>     >>

#### Switching to an alternative melody

More complex variations in setting lyrics to music are possible. The melody to which the lyrics are being set can be changed from within the lyrics by setting the `associatedVoice` property:

>     <<
>       \relative c' \new Voice = "lahlah" {
>         \set Staff.autoBeaming = ##f
>         c4
>         <<
>           \new Voice = "alternative" {
>             \voiceOne
>             \times 2/3 {
>               % show associations clearly.
>               \override NoteColumn #'force-hshift = #-3
>               f8 f g
>             }
>           }
>           {
>             \voiceTwo
>             f8.[ g16]
>             \oneVoice
>           } >>
>         a8( b) c
>       }
>       \new Lyrics \lyricsto "lahlah" {
>         Ju -- ras -- sic Park
>       }
>       \new Lyrics \lyricsto "lahlah" {
>         % Tricky: need to set associatedVoice
>         % one syllable too soon!
>         \set associatedVoice = "alternative" % applies to "ran"
>         Ty --
>         ran --
>         no --
>         \set associatedVoice = "lahlah" % applies to "rus"
>         sau -- rus Rex
>       } >>

The text for the first stanza is set to the melody called ‘lahlah’ in the usual way, but the second stanza is set initally to the `lahlah` context and is then switched to the `alternative` melody for the syllables ‘ran’ to ‘sau’ by the lines:

>     \set associatedVoice = "alternative" % applies to "ran"
>     Ty --
>     ran --
>     no --
>     \set associatedVoice = "lahlah" % applies to "rus"
>     sau -- rus Rex

Here, `alternative` is the name of the `Voice` context containing the triplet.

Note the placement of the `\set associatedVoice` command – it appears to be one syllable too early, but this is correct.

Note: The `set associatedVoice` command must be placed one syllable before the one at which the switch to the new voice is to occur. In other words, changing the associated Voice happens one syllable later than expected. This is for technical reasons, and it is not a bug.

#### Printing stanzas at the end

Sometimes it is appropriate to have one stanza set to the music, and the rest added in verse form at the end of the piece. This can be accomplished by adding the extra verses into a `\markup` section outside of the main score block. Notice that there are two different ways to force linebreaks when using `\markup`.

>     melody = \relative c' {
>     e d c d | e e e e |
>     d d e d | c1 |
>     }

>     text = \lyricmode {
>     \set stanza = #"1." Ma- ry had a lit- tle lamb,
>     its fleece was white as snow.
>     }

>     \score{ <<
>       \new Voice = "one" { \melody }
>       \new Lyrics \lyricsto "one" \text
>     >>
>       \layout { }
>     }
>     \markup { \column{
>       \line{ Verse 2. }
>       \line{ All the children laughed and played }
>       \line{ To see a lamb at school. }
>       }
>     }
>     \markup{
>       \wordwrap-string #"
>       Verse 3.

>       Mary took it home again,

>       It was against the rule."
>     }

#### Printing stanzas at the end in multiple columns

When a piece of music has many verses, they are often printed in multiple columns across the page. An outdented verse number often introduces each verse. The following example shows how to produce such output in LilyPond.

>     melody = \relative c' {
>       c c c c | d d d d
>     }

>     text = \lyricmode {
>       \set stanza = #"1." This is verse one.
>       It has two lines.
>     }

>     \score {
>       <<
>         \new Voice = "one" { \melody }
>         \new Lyrics \lyricsto "one" \text
>       >>
>       \layout { }
>     }

>     \markup {
>       \fill-line {
>         \hspace #0.1 % moves the column off the left margin;
>             % can be removed if space on the page is tight
>          \column {
>           \line { \bold "2."
>             \column {
>               "This is verse two."
>               "It has two lines."
>             }
>           }
>           \hspace #0.1 % adds vertical spacing between verses
>           \line { \bold "3."
>             \column {
>               "This is verse three."
>               "It has two lines."
>             }
>           }
>         }
>         \hspace #0.1  % adds horizontal spacing between columns;
>             % if they are still too close, add more " " pairs
>             % until the result looks good
>          \column {
>           \line { \bold "4."
>             \column {
>               "This is verse four."
>               "It has two lines."
>             }
>           }
>           \hspace #0.1 % adds vertical spacing between verses
>           \line { \bold "5."
>             \column {
>               "This is verse five."
>               "It has two lines."
>             }
>           }
>         }
>       \hspace #0.1 % gives some extra space on the right margin;
>           % can be removed if page space is tight
>       }
>     }

#### See also

Internals Reference: LyricText, StanzaNumber.

其它语言：deutsch, español, français, 日本語。

#### LilyPond — Notation Reference