Automatic syllable durations

Lyrics can be automatically aligned to the notes of a melody in three ways:

In all three methods hyphens can be drawn between the syllables of a word and extender lines can be drawn beyond the end of a word. For details, see Extenders and hyphens.

The Voice context containing the melody to which the lyrics are being aligned must not have “died”, or the lyrics after that point will be lost. This can happen if there are periods when that voice has nothing to do. For methods of keeping contexts alive, see Keeping contexts alive.

Using \lyricsto

Lyrics can be aligned under a melody automatically by specifying the named Voice context containing the melody with \lyricsto:

<<
  \new Voice = "melody" \relative {
    a'1 a4. a8 a2
  }
  \new Lyrics \lyricsto "melody" {
    These are the words
  }
>>

[image of music]

This aligns the lyrics to the notes of the named Voice context, which must already exist. Therefore normally the Voice context is specified first, followed by the Lyrics context. The lyrics themselves follow the \lyricsto command. The \lyricsto command invokes lyric mode automatically. By default, the lyrics are placed underneath the notes. For other placements, see Placing lyrics vertically.

Using \addlyrics

The \addlyrics command is just a convenient shortcut that can sometimes be used instead of having to set up the lyrics through a more complicated LilyPond structure.

{ MUSIC }
\addlyrics { LYRICS }

is the same as

\new Voice = "blah" { MUSIC }
\new Lyrics \lyricsto "blah" { LYRICS }

Here is an example,

{
  \time 3/4
  \relative { c'2 e4 g2. }
  \addlyrics { play the game }
}

[image of music]

More stanzas can be added by adding more \addlyrics sections:

{
  \time 3/4
  \relative { c'2 e4 g2. }
  \addlyrics { play the game }
  \addlyrics { speel het spel }
  \addlyrics { joue le jeu }
}

[image of music]

The command \addlyrics cannot handle polyphonic settings. Also, it cannot be used to associate lyrics to a TabVoice. For these cases one should use \lyricsto.

Using associatedVoice

The melody to which the lyrics are being aligned can be changed by setting the associatedVoice property,

\set associatedVoice = "lala"

The value of the property (here: "lala") should be the name of a Voice context. For technical reasons, the \set command must be placed one syllable before the one to which the change in voice is to apply.

Here is an example demonstrating its use:

<<
  \new Staff <<
    \time 2/4
    \new Voice = "one" \relative {
      \voiceOne
      c''4 b8. a16 g4. r8 a4 ( b ) c2
    }
    \new Voice = "two" \relative {
      \voiceTwo
       s2 s4. f'8 e8 d4. c2
    }
  >>
% takes durations and alignment from notes in "one" initially
% then switches to "two"
  \new Lyrics \lyricsto "one" {
    No more let
    \set associatedVoice = "two"  % must be set one syllable early
    sins and sor -- rows grow.
  }
>>

[image of music]

See also

Notation Reference: Extenders and hyphens, Keeping contexts alive, Placing lyrics vertically.


LilyPond Notation Reference v2.25.21 (development-branch).