Centered measure numbers (obsolete in 2.23): Difference between revisions
Appearance
Import snippet from LSR |
m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series |
||
| Line 3: | Line 3: | ||
This snippet presents a legacy method: starting from LilyPond 2.23.3, <code>\set Score.centerBarNumbers = ##t</code> is enough. | This snippet presents a legacy method: starting from LilyPond 2.23.3, <code>\set Score.centerBarNumbers = ##t</code> is enough. | ||
<lilypond version="2.24 | <lilypond version="2.24"> | ||
\layout { | \layout { | ||
\context { | \context { | ||
Revision as of 18:57, 16 November 2025
Scores of large ensemble works often have bar numbers placed beneath the system, centered horizontally on the measure's extent. This snippet shows how the Measure_counter_engraver may be used to simulate this notational practice. Here, the engraver has been added to a Dynamics context.
This snippet presents a legacy method: starting from LilyPond 2.23.3, \set Score.centerBarNumbers = ##t is enough.
\version "2.24"
\layout {
\context {
\Dynamics
\consists #Measure_counter_engraver
\override MeasureCounter.direction = #DOWN
\override MeasureCounter.font-encoding = #'latin1
\override MeasureCounter.font-shape = #'italic
% to control the distance of the Dynamics context from the staff:
\override VerticalAxisGroup.nonstaff-relatedstaff-spacing.padding = #2
}
\context {
\Score
\remove "Bar_number_engraver"
}
}
pattern = \repeat unfold 7 { c'4 d' e' f' }
\new StaffGroup <<
\new Staff {
\pattern
}
\new Staff {
\pattern
}
\new Dynamics {
\startMeasureCount
s1*7
\stopMeasureCount
}
>>