----- Original Message ----- From: "David Kastrup" <[email protected]>
To: <[email protected]>
Sent: Wednesday, June 26, 2013 11:09 AM
Subject: Re: Subtracting one from the measure number


"Phil Holmes" <[email protected]> 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).

--
Phil Holmes

<<attachment: HiddenBar.png>>

_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to