lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

printing bar numbers on every odd measure


From: Lia Zito
Subject: printing bar numbers on every odd measure
Date: Tue, 21 Sep 2010 10:19:32 -0800

Hello,

I'm trying to get bar numbers to print on every odd measure: 1,3,5 etc.

The   \set Score.barNumberVisibility = #(first-and-every-nth-bar-number-visible 2) command puts out even numbered bar numbers every time.  I even used the directions on how to print the 1st and every nth bar number (see below) and lilypond reverts right back to even numbers whenever the value is 2 (or 4, etc.).

I tried inserting an invisible measure at the beginning, then resetting the bar number to 1 at the 2nd measure - and that \set Score.barNumberVisibility function went and skipped ahead a measure to display only the even numbers again!  

I tried the barnum music function (see below) even though I don't understand it at all - but it did the same thing. I get 1, 2, 4, 6, etc.  

Does anybody know how to get it to print just the odd numbered bar numbers?  With or without the 1st bar number, that doesn't matter so much, I just want to see 3, 5, 7, 9 etc. on the page.  

I'm using Lilypond 2.12.3-1 with OLy 0.4 and OpenOffice 3.2.1 on OS X 10.6.


Thank you!

Lia Zito

Here's the email with the directions I tried:  

http://lists.gnu.org/archive/html/lilypond-user/2008-09/msg00403.html

From: Trevor Daniels
Subject: Printing first and every n bar numbers
Date: Fri, 12 Sep 2008 14:21:54 +0100

Valentin

Are these worth a snippet (or two?) for Rhythms?

\relative c'' {
 % Print the first and every fifth bar numbers
 \set Score.barNumberVisibility = #(every-nth-bar-number-visible 1)
 \override Score.BarNumber #'break-visibility = #all-visible
 \bar ""
 c1
 \set Score.barNumberVisibility = #(every-nth-bar-number-visible 5)
 \repeat unfold 9 { c1 }
}

The alternative is Neil's music function:

#(define ((first-and-every-nth-bar-number-visible n) barnum)
         (or
           (= 1 barnum)
           (= 0 (modulo barnum n))))

\relative c'' {
\override Score.BarNumber #'break-visibility = #end-of-line-invisible
\set Score.barNumberVisibility = #(first-and-every-nth-bar-number-visible 5)
\bar ""
\repeat unfold 10 { c1 }
}


Trevor


reply via email to

[Prev in Thread] Current Thread [Next in Thread]