lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: organizing pieces with variables - lyrics not aligned


From: Jean Abou Samra
Subject: Re: organizing pieces with variables - lyrics not aligned
Date: Sun, 19 Feb 2023 02:10:17 +0100
User-agent: Evolution 3.46.3 (3.46.3-1.fc37)

Le dimanche 19 février 2023 à 08:57 +0800, Darren Ng a écrit :

In the following sheet,
"Dave" and "Ed" are not on the same line.

How to properly group melodies and their matching lyrics into variables,
while keeping lyrics on the same line?

    \version "2.24.1"
    segmentA = {<<
      { c4 c4 c4 c8 r8 }
      \addlyrics { Alice Bob Cathy Dave }
    >>}
    segmantB = { <<
      { d4 d4 d4 d8 r8 }
      \addlyrics { Ed Fred Greg Howl }
    >>}
    \score {
      \relative c'' {
        \clef "treble" \numericTimeSignature \time 4/4
        \segmentA
        \segmantB
      }
      \layout { }
    }

You need to name the contexts when you create them in order to continue them afterwards with \context.

\version "2.24.1"

segmentA = <<
  \new Voice = song { c4 c4 c4 c8 r8 }
  \new Lyrics = lyrics \lyricsto song { Alice Bob Cathy Dave }
>>

segmentB = <<
  \context Voice = song { d4 d4 d4 d8 r8 }
  \context Lyrics = lyrics \lyricsto song { Ed Fred Greg Howl }
>>

\score {
  \relative c'' {
    \clef "treble" \numericTimeSignature \time 4/4
    \segmentA
    \segmentB
  }
  \layout { }
}

Alternatively, just make more variables.

\version "2.24.1"

segmentA = { c4 c4 c4 c8 r8 }
segmentB = { d4 d4 d4 d8 r8 }

lyricsA = \lyricmode { Alice Bob Cathy Dave }
lyricsB = \lyricmode { Ed Fred Greg Howl }

\score {
  \relative c'' {
    \clef "treble" \numericTimeSignature \time 4/4
    { \segmentA \segmentB }
    \addlyrics { \lyricsA \lyricsB }
  }
  \layout { }
}

See https://lilypond.org/doc/v2.24/Documentation/notation/common-notation-for-vocal-music#aligning-lyrics-to-a-melody and https://lilypond.org/doc/v2.24/Documentation/notation/creating-and-referencing-contexts.

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]