From: Heikki Junes Date: Fri, 13 Dec 2002 23:12:13 +0000 (+0000) Subject: add modulo-bar-number-visible X-Git-Tag: release/1.7.10~19 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f90897243891bac39651927da24efaa085de197b;p=lilypond.git add modulo-bar-number-visible --- diff --git a/ChangeLog b/ChangeLog index 8f7915c3ed..f54aa5180f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-12-14 Heikki Junes + + * scm/output-lib.scm (modulo-bar-number-visible): add function. + + * Documentation/user/refman.itely: add modulo-bar-number-visible. + 2002-12-10 Heikki Junes * lilypond-mode.el: add shortcut for 2midi diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index ae3c3897d8..003aee82f6 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -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 diff --git a/scm/output-lib.scm b/scm/output-lib.scm index b0ad0fccff..d58fd45dca 100644 --- a/scm/output-lib.scm +++ b/scm/output-lib.scm @@ -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_