+2002-12-14 Rune Zedeler <rz@localhost.localdomain>
+
+ * scm/output-lib.scm (set-bar-number-visibility): Context-function
+ Added.
+
+ * Documentation/user/refman.itely (Bar numbers):
+ set-bar-number-visibility added, modulo-bar-number removed again
+ (sorry).
+
2002-12-14 Heikki Junes <hjunes@cc.hut.fi>
* scm/output-lib.scm (modulo-bar-number-visible): add function.
}
@end lilypond
-By replacing @code{#(every-nth-bar-number-visible 5)} with
-@code{#(modulo-bar-number-visible 4 1)} in the example above,
-every fourth bar counting from the first bar will be numbered.
-To number all bars use @code{#(default-bar-number-visibility)}.
-The first bar, however, is not numbered.
+If you would like the bar numbers to appear at regular intervals, but
+not starting from measure zero, you can use the context function,
+@code{set-bar-number-visibility}, to automatically set
+@code{barNumberVisibility} so that the bar numbers appear at regular
+intervals, starting from the @code{\applycontext}:
+
+@example
+resetBarnum = \context Score \applycontext
+ #(set-bar-number-visibility 4)
+...
+\property Score.BarNumber \override #'break-visibility =
+ #end-of-line-invisible
+\mark "A" \resetBarnum
+\repeat unfold 10 c1
+\mark \default \resetBarnum
+\repeat unfold 8 c
+@end example
+@lilypond[noindent,noquote]
+resetBarnum = \context Score \applycontext
+ #(set-bar-number-visibility 4)
+\score {
+ <
+ \notes \transpose c c'' {
+ \property Score.BarNumber \override #'break-visibility =#end-of-line-invisible
+ \property Score.RehearsalMark \override #'padding = #2.5
+ \mark "A" \resetBarnum
+ \repeat unfold 10 c1
+ \mark \default \resetBarnum
+ \repeat unfold 8 c
+ \bar "|."
+ }
+ >
+}
+@end lilypond
See also @seeinternals{BarNumber}.
dnl aclocal.m4 -*-shell-script-*-
+dnl WARNING WARNING WARNING
+dnl do not edit! this is aclocal.m4, generated from /home/rz/lilypond/lilypond/stepmake/aclocal.m4
+dnl aclocal.m4 -*-shell-script-*-
dnl StepMake subroutines for configure.in
(define-public ((modulo-bar-number-visible n m) barnum) (and (> barnum 1) (= m (modulo barnum n))))
+(define-public ((set-bar-number-visibility n) tr)
+ (let* ((bn (ly:get-context-property tr 'currentBarNumber)))
+ (ly:set-context-property tr 'barNumberVisibility (modulo-bar-number-visible n (modulo bn n))))
+)
+
(define-public (default-bar-number-visibility barnum) (> barnum 1))
;; See documentation of Item::visibility_lambda_