Printing bar numbers using modulo-bar-number-visible: 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 8: | Line 8: | ||
* <code>(modulo-bar-number-visible 5 2)</code> -> prints 2,7,12 | * <code>(modulo-bar-number-visible 5 2)</code> -> prints 2,7,12 | ||
<lilypond version="2.24 | <lilypond version="2.24" full> | ||
\layout { | \layout { | ||
\context { | \context { | ||
Revision as of 18:57, 16 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 }