Ah yes, now I get it... PEBKAC indeed. And actually, I think I finally get
calling contexts back... living and learning. Just for sanity sake, I'll
also add another "corrected code" (just called the context again).

%%SOF
\version "2.26.0"
initMelody= \new Voice = "melody" { }
melody = \context Voice = "melody" {
  \tag #'(verse)   { c''1 d'' e'' f'' }
  \tag #'(refrain) { g'1 a' b' }
} % end var & voice
singer = {
  \new Staff {
    \keepWithTag #'(verse) \melody
    \keepWithTag #'(refrain) \melody
  }
}
niceLyrics = \lyricmode { I a e a o o o }
singerAndLyrics = {
  <<
    \singer
    \new Lyrics \lyricsto "melody" { \niceLyrics }
  >>
}
\score { \singerAndLyrics }
%%EOF

Em dom., 31 de mai. de 2026 às 11:38, Lukas-Fabian Moser <[email protected]>
escreveu:

> Hi Lucas,
> Am 31.05.26 um 16:32 schrieb Lucas Pinke:
>
> Which technical limitation do you mean exactly?
>
> Correct me if I'm wrong, but it seems that lyrics can't be added to a
> variable that is chopped up in tags. In the example below (similar to my
> first one), measures 1 to 4 have lyrics but 5 and onwards don't, even using
> the same staff.
>
> I think this comes from the "\new Voice" in the definition of 'melody'. We
> want one continuous voice to which the lyrics can then get attached; it
> seems that starting a *new* voice (albeit with the same name as before)
> in the middle of the piece stops to \lyricsto mechanism from working.
>
> Try:
>
> %%SOF
> \version "2.26.0"
>
> melody = {
>   \tag verse { c''1 d'' e'' f'' }
>   \tag refrain { g'1 a' b' }
> } % end var & voice
>
> singer = {
>   \new Staff \new Voice = melody {
>     \keepWithTag verse \melody
>     \keepWithTag refrain \melody
>   }
> }
>
> niceLyrics = \lyricmode { I a e a o o o }
>
> singerAndLyrics = {
>   <<
>     \singer
>     \new Lyrics \lyricsto melody { \niceLyrics }
>   >>
> }
>
> \score { \singerAndLyrics }
> %%EOF
>
> Lukas
>

Reply via email to