Jump to content

Printing bar numbers with changing regular intervals: Difference between revisions

From LilyPond wiki
No edit summary
m New category
Line 15: Line 15:
[[Category:Rhythms]]
[[Category:Rhythms]]
[[Category:Text]]
[[Category:Text]]
[[Category:Included in the official documentation]][[Category:Snippet]]
[[Category:Included in the official documentation]]
[[Category:Snippet]]

Revision as of 23:32, 21 November 2025

Using the set-bar-number-visibility context function, bar number intervals can be changed.

\version "2.24"

\relative c' {
  \override Score.BarNumber.break-visibility = #end-of-line-invisible
  \context Score \applyContext #(set-bar-number-visibility 4)
  \repeat unfold 10 c'1
  \context Score \applyContext #(set-bar-number-visibility 2)
  \repeat unfold 10 c
}

\paper { tagline = ##f }