> ---------- Forwarded message ----------
> From: Jogchum Reitsma <[email protected]>
> To: lilypond-user <[email protected]>
> Cc:
> Bcc:
> Date: Sat, 16 May 2026 21:05:40 +0200
> Subject: Using \set associatedVoice in just 1 polyphonic bar
>
> Hi,
>
> A few days ago Kieren helped me out with a problem placing lyrics beneath
> an accidental polyphonic bar ("Sub optimal placing of lyrics in accidental
> polyphonic bars", 7th of May in this list).
> While this works as a charm with quite a few such instances, I seem to
> have a problem when there is just 1  polyphonic bar:
>
> In bars 2 and 3 the placement is correct, but after bar 6 no lyrics are
> rendered. Regarding "\set associatedVoice"  the documentation remarks
>
> "*Note:* The \set associatedVoice command must be placed one syllable
> *before* the one at which the switch to the new voice is to occur."
>
> But it somehow does not work here.
>
> I fiddled around a bit with the syllables surrounding the two voice parts,
> but I can't get a good result.
>
> Anyone who can spot my error here?
>
> Thanks again in advance!
>
> regards, Jogchum
>
> %%% Start snippet
>
> \version "2.25.32"
>
> \paper {
>   % Add space for instrument names
>   indent = 18\mm
>   short-indent = 10\mm
> }
>
> global = {
>   \key g \major
>   \time 3/4
> }
>
> alto = \relative c'' {
>   \global
>  r2 g4 ^\mf \time 4/4
> <<    {  \voiceOne b2(a4)a
>                                   a2(g)
>         }
>     \\
>     \new Voice = "alto1" {  \voiceTwo g2. g4
>                                                                        g1
>                                              }
>   >>
> \oneVoice
>
> g2 \tuplet 3/2 { g2 g4 }
> g4 g2 g4 ^\f
>
> <<     { \voiceOne b2(a4) a
>           }
>     \\
>            \new Voice = "alto1" { \voiceTwo g2. g4
>                                                      }
> >>
>   \oneVoice
>
> a2(g)
> <g e> \tuplet 3/2 { <g~ es(>4 <g d)> <g c,> } \time 3/4
> <a d,><g d>2
> R2.*2
> r4 g ^\mp g fis
> fis(e8)g~~g2 \fermata
> }
>
>
> altoVerse = \lyricmode {
>
> \set associatedVoice = "alto1"Mag -- ni -- fi --
> \set associatedVoice = "alto" cat a -- ni -- ma me -- a,
> \set associatedVoice = "alto1"Mag ni --
> \set associatedVoice = "alto "fi -- cat a -- ni -- ma me -- a,
> an cil -- lae su -- ae.
> }
>
> choirPart = \new ChoirStaff <<
>
>   \new Staff \with {
>     midiInstrument = "choir aahs"
>     instrumentName = "Alt"
>     shortInstrumentName = "A."
>   } \new Voice = "alto" \alto
>   \new Lyrics \with {
>     \override VerticalAxisGroup.staff-affinity = #CENTER
>   } \lyricsto "alto" \altoVerse
> >>
>
> \score {
>   <<
>     \choirPart
>   >>
>   \layout {\override Score.BarNumber.break-visibility =
> #end-of-line-invisible
>                 }
> }
>
> %%%% End snippet
>
>
> _______________________________________________
> lilypond-user mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/lilypond-user



I'm not sure what you have invested in this approach, but I would suggest
what seems simpler: aligning to a NullVoice.

I also took the liberty of converting your global into a more typical
parallel usage.


%%% Start snippet

\version "2.24.0"

\paper {
  % Add space for instrument names
  indent = 18\mm
  short-indent = 10\mm
}

global = {
  \key g \major
  \time 3/4
  s2.
  \time 4/4
  s1*7
  \time 3/4
  s2.*6
}

alto = \relative c'' {
 r2 g4 ^\mf \time 4/4
 << {
      \voiceOne b2(a4)a |a2(g)
    } \\
    \new Voice = "alto1" {
      \voiceTwo g2. g4 | g1
    }
  >> |
  \oneVoice

  g2 \tuplet 3/2 { g2 g4 } |
  g4 g2 g4 ^\f |

  << { \voiceOne b2(a4) a
     } \\
     \new Voice = "alto1" {
       \voiceTwo g2. g4
     }
  >>
  \oneVoice

  a2(g)
  <g e> \tuplet 3/2 { <g~ es(>4 <g d)> <g c,> } \time 3/4
  <a d,><g d>2
  R2.*2
  r4 g ^\mp g fis
  fis(e8)g~~g2 \fermata
}

altoAligner = \relative c'' {
  r2 g4 ||
  b2(a4)a | a2(g) |
  g2 \tuplet 3/2 { g2 g4 } |
  g4 g2 g4 |
  b2(a4) a | a2(g) |
  g2 \tuplet 3/2 { g4 ~ 4 4 }
  a4 g2 |
  R2.*2 |
  r4 g g fis
  fis(e8)g ~ g2
}

altoVerse = \lyricmode {
    Mag -- ni -- fi --
    cat a -- ni -- ma me -- a,
    Mag ni --
    fi -- cat a -- ni -- ma me -- a,
    an cil -- lae su -- ae.
}

choirPart = \new ChoirStaff <<
  \new Staff \with {
    midiInstrument = "choir aahs"
    instrumentName = "Alt"
    shortInstrumentName = "A."
  } <<

    \new Voice = "alto" <<
      \global
      \alto
    >>
    \new NullVoice = "aligner" \altoAligner
    \new Lyrics \with {
      \override VerticalAxisGroup.staff-affinity = #CENTER
    } \lyricsto "aligner" \altoVerse
  >>
>>

\score {
  <<
    \choirPart
  >>
  \layout {\override Score.BarNumber.break-visibility =
#end-of-line-invisible
                }
}

%%%% End snippet


 HTH,

Elaine

Reply via email to