]> git.donarmstrong.com Git - lilypond.git/commitdiff
set-bar-number-visibility
authorRune Zedeler <rune@lilypond.org>
Sat, 14 Dec 2002 00:33:10 +0000 (00:33 +0000)
committerRune Zedeler <rune@lilypond.org>
Sat, 14 Dec 2002 00:33:10 +0000 (00:33 +0000)
ChangeLog
Documentation/user/refman.itely
aclocal.m4
scm/output-lib.scm

index f54aa5180fea00822dfb78e135fa5e72c1748cfc..ce7a2bbd00ba79b81672f5a662af0d495bc3e41b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+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.
index 003aee82f693b962ab6604f1e05710d7aac908f9..b978b6d0ba3da9e11ec76b1fd7b68239d579c3ff 100644 (file)
@@ -3527,11 +3527,40 @@ adds a box around the bar numbers:
 }
 @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}.
 
index 133034bd8c96007ed72e5e33c12fe4b1d94a6f88..5dbbe94ae14c88c8036a8dec1399c2a8c10b27a9 100644 (file)
@@ -1,4 +1,7 @@
 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
 
 
index d58fd45dcaca6bdeb8cce8861be00164a24f7e5e..3845138d35c7309e0cf14b62505dcb9530c343c8 100644 (file)
@@ -209,6 +209,11 @@ centered, X==1 is at the right, X == -1 is at the left."
 
 (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_