Dear all,

is there a way to consistently position lyrics (vertically) with SATB
two-staff layout with varying homophonic and polyphonic lyric passages?
I am trying to achieve the standard look:

- When the passage is homophonic and all singers sing the same lyrics,
  there is only one lyric line centered between the staves
- When the upper and lower staff have different lyrics, the lyrics
  lines are positioned around the center line between the staves.
- (Optionally, there can also be additional lyrics lines right next to
  the staff coexisting with the centered lyrics line; see syllable
  "Kun" in the lower right in the following example.)

Here is an example of the layout I am after:
https://mkouhia.iki.fi/attachments/2026-07-22_lilypond-lyrics-vertical-alignment/divisi-lyrics.jpg

I have tried many alternatives for the lyrics definitions, and have
found the following example to work in most occasions. However, the
position of lyrics below the upper (SA) staff and above the lower (TB)
staff vary depending on whether there are lyrics on the common, centered
lyrics line on the same system. In the compiled example, on second
system (without centered lyrics) the divisi lyrics are next to
respective staves, and on third system (with centered lyrics) the divisi
lyrics are attached to the centered lyrics:

    \version "2.26"

    \new ChoirStaff \with {
      \override VerticalAxisGroup.staff-staff-spacing.basic-distance = #24
    } <<
      \new Staff <<
        {
          \textMark "centered lyrics, as expected" s1 \break
          \textMark "divisi lyrics are next to staves" s1 \break
          \textMark "divisi lyrics are near the centered lyrics" s1
        }
        \new Voice = "upper" \repeat unfold 12 { a'4 }
      >>
      \new Lyrics = "lyricsSABelow"

      \new Lyrics = "lyricsCommon" \with {
        \override VerticalAxisGroup.staff-affinity = #CENTER
      }

      \new Lyrics = "lyricsTBAbove" \with {
        \override VerticalAxisGroup.staff-affinity = #DOWN
      }

      \new Staff <<
        \clef bass
        \new Voice = "lower" \repeat unfold 12 { f4 }
      >>


      \context Lyrics = "lyricsSABelow" \lyricsto "upper" { \lyricmode {
        \repeat unfold 4 { \skip 1 }
        e f g h
        i j
      }}
      \context Lyrics = "lyricsCommon" \lyricsto "upper" {\lyricmode {
        a b c d
        \repeat unfold 4 { \skip 1 }
        \skip1 \skip1 k l
      }}
      \context Lyrics = "lyricsTBAbove" \lyricsto "lower" {\lyricmode {
        \repeat unfold 4 { \skip 1 }
        e f g h
        i j
      }}

    >>

    \layout {
      \context {
        \Lyrics
          \override VerticalAxisGroup
              .nonstaff-nonstaff-spacing.minimum-distance = #1.6
      }
    }

Here is the resulting pdf:
https://mkouhia.iki.fi/attachments/2026-07-22_lilypond-lyrics-vertical-alignment/mwe.pdf

This is even more visible when I place the lyrics lines closer to each
other, to allow the divisi lyrics occupy the same vertical space as the
centered lyrics (on the 3rd system):

    \layout {
      \context {
        \Lyrics
          \override VerticalAxisGroup
              .nonstaff-nonstaff-spacing.minimum-distance = #1.6
      }
    }

Is there a way to define the behaviour consistently, so that the divisi
lyrics are placed regardless of the existence of the centered lyrics
line, either a. placed next to the respective staves b. placed near the
centered position?

If possible, it would be nice to have solutions for the both styles.


I am familiar with vocal ensembles templates [1] and vocal music
documentation, [2] but they offer no help. The vertical spacing
documentation [3] offers to center lyrics with

    \new Lyrics \with {
      \override VerticalAxisGroup
                .nonstaff-relatedstaff-spacing.padding = 5
      \override VerticalAxisGroup
                .nonstaff-unrelatedstaff-spacing.padding = 5
    }

but this does not solve the problem at hand:
- it sort-of-works on the first system (centered lyrics only)
- it does not work on the third system: the centered lyrics are now
  glued to the top divisi lyrics. However, the divisi lyrics are now
  placed near the respective staves, which is expected behaviour
- it does not actually center the lyrics with respect to the staves,
  but sets the minimum distance to notes protruding the most to the
  space between the staves. On many occasions, this puts the common
  lyrics too much to either side and requires manual editing.


Has anyone solved this prior, or is this a bug in Lilypond? I think this
style of lyrics placement is quite common for two-staff choral music
with occasional polyphonic passages.


[1]: 
https://lilypond.org/doc/v2.26/Documentation/learning/vocal-ensembles-templates
[2]: https://lilypond.org/doc/v2.26/Documentation/notation/vocal-music
[3]: https://lilypond.org/doc/v2.26/Documentation/learning/vertical-spacing

-- 
Mikko Kouhia




Reply via email to