Measure-centered bar numbers: 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 example demonstrates a number of settings: the centered bar numbers are boxed and placed below the staves. | This example demonstrates a number of settings: the centered bar numbers are boxed and placed below the staves. | ||
<lilypond version="2.24 | <lilypond version="2.24"> | ||
\layout { | \layout { | ||
\context { | \context { | ||
Revision as of 18:50, 16 November 2025
For film scores, a common convention is to center bar numbers within their measure. This is achieved through setting the centerBarNumbers context property to true. When this is used, the type of the bar number grobs is CenteredBarNumber rather than BarNumber.
This example demonstrates a number of settings: the centered bar numbers are boxed and placed below the staves.
\version "2.24"
\layout {
\context {
\Score
centerBarNumbers = ##t
barNumberVisibility = #all-bar-numbers-visible
\override CenteredBarNumber.stencil
= #(make-stencil-boxer 0.1 0.25 ly:text-interface::print)
\override CenteredBarNumberLineSpanner.direction = #DOWN
}
}
\new StaffGroup <<
\new Staff \relative c' {
d4-. f8( e d4) bes'-> |
d,-. f8( e d4) cis'-> |
g-. f8( d e4) g-> |
a,1-> |
}
\new Staff \relative c {
\clef bass
d4 f8 e d2~ |
4 f8 e d2~ |
4 4 2 |
a1 |
}
>>