Dear LilyPond Community,

I’m currently working on a simple melody layout using a single-staff score,
and I’m quite happy with how the system breaks look overall. However, I’m
trying to improve the visual balance of the final line.

As shown in the attached example, I would like the final line—containing
only two measures—to visually align with the positions of the first two
bars from the previous systems. This would result in a more balanced and
elegant appearance across the three systems.

The most intuitive solution I can think of is to “declare” a fixed number
of bars in the final line (e.g., four), even if only two bars are musically
present. The remaining space would then be automatically distributed to
preserve alignment.

My question is:
Is there a simple and elegant way in LilyPond to achieve this kind of
visual alignment?
Can I manually or programmatically control how many measures a line
“pretends” to contain for layout purposes, even if only part of it is
filled?

Any suggestions, best practices, or pointers to relevant documentation
would be greatly appreciated!

Warm regards,
Peter

[image: image.png]
```
\version "2.24.4"

#(set-global-staff-size 13)

\header {
title = "Demo Melody"

}

\paper {
line-width = 150\mm
ragged-last = ##t
}

\layout {
indent = 0.0
\context {
\Score
\override SpacingSpanner.uniform-stretching = ##t
}
}

melody = {
\key c \major
\time 3/4

\tempo 4 = 100


| a4 g c'
| b2 g8. g16
| a4 g d'
| c'2 g8. g16 \break
| g'4 e' c'
| b a f'8. f'16
| e'4 c' e'
| d'2 g8. g16 \break
| e'4 c' d'
| c'2
\bar "|."
}

\score {
\new Staff {
\melody
}
}


```

Reply via email to