lilypond-user
[Top][All Lists]
Advanced

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

Re: Subtracting one from the measure number


From: Phil Holmes
Subject: Re: Subtracting one from the measure number
Date: Fri, 28 Jun 2013 16:40:37 +0100

----- Original Message ----- From: "David Kastrup" <address@hidden>
To: "Phil Holmes" <address@hidden>
Cc: <address@hidden>
Sent: Wednesday, June 26, 2013 5:23 PM
Subject: Re: Subtracting one from the measure number


"Phil Holmes" <address@hidden> writes:

"David Kastrup" <address@hidden> wrote:


"Phil Holmes" <address@hidden> writes:

I've got a piece of music that has a dotted bar and a (hidden) time
signature change at a place where the bar number is not incremented.
I know I could explicitly set the bar number to the new correct number
(calculated number minus one) but is there a way of subtracting one
from the existing bar number?

Probably less than pretty, but here you go:

{ \repeat unfold 40 c4
 \applyContext #(lambda (c)
  (set! (ly:context-property
(ly:context-find c 'Timing)
'currentBarNumber)
   (1- (ly:context-property c 'currentBarNumber))))
 \repeat unfold 40 c4
}


Thanks David.  Took me a while to work out why it was taking 4 off my
measure numbers, but then I realised it must be done once per score,
not once per staff.  (I'm autogenerating the lilypond code and so it
was putting the decrement code into each staff's output - I've fixed
this, as you can see).

Well, judging from your picture, you have the magic of changing the
meter silently pat.  So instead of making a real mess in order to get
two bars of \time 4/4 count as one, why don't you just make a single bar
of \compoundTime #'((4 4) (4 4)) instead and manually place the \bar ";"
(or what it was) in the middle?  Because frankly: having two bar numbers
"4" right after another is not looking good to me, either.  You might
need to look at the beaming exceptions to use, but that looks saner to
me than rewinding the bar counter.

--
David Kastrup


My real piece of music doesn't have bar numbers every bar, and the place where I want to not count a bar number is a change from 4/4 time to 3/4 time, so in the real case, subtracting one from the bar number looks perfectly good and reproduces the original piece of music exactly.

--
Phil Holmes



reply via email to

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