Printing bar numbers using modulo-bar-number-visible: Difference between revisions
Appearance
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 |
No edit summary |
||
| Line 26: | Line 26: | ||
[[Category:Rhythms]] | [[Category:Rhythms]] | ||
[[Category:Included in the official documentation]] | [[Category:Included in the official documentation]][[Category:Snippet]] | ||
Revision as of 22:58, 21 November 2025
If the remainder of the division of the current BarNumber by the first argument of modulo-bar-number-visible equals its second argument print the BarNumber.
Useful to print the BarNumber at certain distances, p.e.:
(modulo-bar-number-visible 3 2)-> prints 2,5,8(modulo-bar-number-visible 4 2)-> prints 2,6,10(modulo-bar-number-visible 3 1)-> prints 3,5,7(modulo-bar-number-visible 5 2)-> prints 2,7,12
\version "2.24"
\layout {
\context {
\Score
\override BarNumber.break-visibility = ##(#f #t #t)
barNumberVisibility = #(modulo-bar-number-visible 3 2)
}
}
\relative c' {
c1 | d | e | f \break
g1 | e | d | c
}
\paper { tagline = ##f }