bug-lilypond
[Top][All Lists]
Advanced

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

Re: Wrong alignment when adding additional lyrics multiple times on the


From: Thomas Morley
Subject: Re: Wrong alignment when adding additional lyrics multiple times on the same line
Date: Mon, 6 Apr 2020 08:48:22 +0200

Am Mo., 6. Apr. 2020 um 00:20 Uhr schrieb Benedikt Wilde <address@hidden>:
>
> Hello,
>
> I believe to have encountered a bug in LilyPond. When one adds
> additional lyrics multiple times on the same line of the resulting sheet
> music using alignBelowContext, the alignment of the first instance is
> shifted down. (It is shifted below the second instance.) If this is
> attempted more than twice on a line, these extra shifts stack up.
> When the two instances are not on the same line in the resulting sheet
> music, this problem does not occur. (This can be observed by removing
> the 'landscape option in the attached file.)
>
> The example I attached is basically taken from the official
> documentation [1], with the last two bars repeated.
>
> Best regards
>
> Benedikt Wilde
>
>
> [1]:
> http://lilypond.org/doc/v2.19/Documentation/notation/techniques-specific-to-lyrics#lyrics-and-repeats

Hi Benedikt,

thanks for your bug-report.
The behaviour you observe is expected, although you may not want it.

The docs say new contexts are always aligned below already existing ones.
Because the first occurrence of \new Lyrics = "secondVerse" is not
immediately continued, it dies. The second  \new Lyrics =
"secondVerse" then initiates a _new_ Lyrics-context aligned below the
first. Actually you created 5 different Lyric-contexts.
Using alignBelowContext obfuscates it a bit, alas it's not suitable to
align those contexts as you wish.

Instead you should initiate the three needed Lyrics right from the
beginning and keep them alive throughout the score. Then let
additional lyrics be distributed to the correct Lyric-context by using
\context Lyrics = "..."
How to keep contexts alive is covered in the docs, as well as the
difference of \new and \context (although not in the section about
lyrics, iirc).

Your example could be done like:

\paper {
  #(set-paper-size "a4" 'landscape)
}

\score {
  <<
    \new Staff {
      \new Voice = "melody" {
        \relative {
          a'4 a a a
          \repeat volta 3 { b4 b b b }
          c4 c c c
          \repeat volta 3 { b4 b b b }
          c4 c c c
        }
      }
    }
    \new Lyrics = "firstVerse" s1*5
    \new Lyrics = "secondVerse" s1*5
    \new Lyrics = "thirdVerse" s1*5
    \context Lyrics = "firstVerse" \lyricsto "melody" {
      Not re -- peat -- ed.
      <<
        { The first time words.    }
        \context Lyrics = "secondVerse"
          \with { alignBelowContext = "firstVerse" }
          {
              \set associatedVoice = "melody"
              Sec -- ond time words.
          }
        \context Lyrics = "thirdVerse"
          \with { alignBelowContext = "secondVerse" }
          {
              \set associatedVoice = "melody"
              The third time words.
          }
      >>
      The end sec -- tion.
      <<
        { The first time words.    }
        \context Lyrics = "secondVerse"
          \with { alignBelowContext = "firstVerse" }
          {
              \set associatedVoice = "melody"
              Sec -- ond time words.
          }
        \context Lyrics = "thirdVerse"
          \with { alignBelowContext = "secondVerse" }
          {
              \set associatedVoice = "melody"
              The third time words.
          }
      >>
      The end sec -- tion.
    }
    \new Voice = "harmony" {
      \relative {
        f'4 f f f
        \repeat volta 2 { g8 g g4 g2 }
        a4 a8. a16 a2
        \repeat volta 2 { g8 g g4 g2 }
        a4 a8. a16 a2
      }
    }
  >>
}

Again, thanks for your report.
No bug, though.

Best,
  Harm



reply via email to

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