]> git.donarmstrong.com Git - lilypond.git/commitdiff
add modulo-bar-number-visible
authorHeikki Junes <heikki.junes@hut.fi>
Fri, 13 Dec 2002 23:12:13 +0000 (23:12 +0000)
committerHeikki Junes <heikki.junes@hut.fi>
Fri, 13 Dec 2002 23:12:13 +0000 (23:12 +0000)
ChangeLog
Documentation/user/refman.itely
scm/output-lib.scm

index 8f7915c3ed74c8dee6c14153daf992ce7642e173..f54aa5180fea00822dfb78e135fa5e72c1748cfc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-12-14  Heikki Junes <hjunes@cc.hut.fi>
+
+       * scm/output-lib.scm (modulo-bar-number-visible): add function.
+
+       * Documentation/user/refman.itely: add modulo-bar-number-visible.
+
 2002-12-10  Heikki Junes <hjunes@cc.hut.fi>
 
        * lilypond-mode.el: add shortcut for 2midi
index ae3c3897d8855a0c0f220c5b689dc5bf5dc733a7..003aee82f693b962ab6604f1e05710d7aac908f9 100644 (file)
@@ -3527,6 +3527,12 @@ 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.
+
 See also @seeinternals{BarNumber}.
 
 @refbugs
index b0ad0fccff93bb1fd5ddf7efe0e8fc768546c27d..d58fd45dcaca6bdeb8cce8861be00164a24f7e5e 100644 (file)
@@ -207,6 +207,8 @@ centered, X==1 is at the right, X == -1 is at the left."
 
 (define-public ((every-nth-bar-number-visible n) barnum) (= 0 (modulo barnum n)))
 
+(define-public ((modulo-bar-number-visible n m) barnum) (and (> barnum 1) (= m (modulo barnum n))))
+
 (define-public (default-bar-number-visibility barnum) (> barnum 1))
 
 ;; See documentation of Item::visibility_lambda_