lilypond-user
[Top][All Lists]
Advanced

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

Re: Measure counter


From: David Nalesnik
Subject: Re: Measure counter
Date: Tue, 8 Jan 2013 08:52:05 -0600

Hi David,

On Mon, Jan 7, 2013 at 5:25 PM, David G <address@hidden> wrote:
I'm currently using code based on the snippet in http://www.lilypond.org/doc/v2.16/Documentation/snippets/repeats#repeats-measure-counter to create numbers above bars where they are repeated. However this starts with a number 2 above the second bar, and I would like a 1 above the first bar.

What's the best way to achieve this in 2.16? I couldn't work out a way to change the numbers generated by the PercentRepeatCounter. Alternatively if there is an easy way to manually insert a number 1 centred on the first bar at the correct height, that would be fine. I tried using markup above the invisible rest but this was not centred.

You could do it by creating a full-measure rest in the first measure of the count, changing the property `restNumberThreshold' to zero (so that a number will be printed on a rest lasting a single bar), hiding the rest, and then altering properties of the number to match the ones from the percent repeat count.  (I forget where I learned of this trick.)

Here's what I come up with:

\new Staff <<
  \context Voice = "foo" {
    \clef bass
    c4 r g r
    c4 r g r
    c4 r g r
    c4 r g r
  }
  \context Voice = "foo" {
    \set countPercentRepeats = ##t
    \override PercentRepeat #'transparent = ##t
    \override PercentRepeatCounter #'staff-padding = #1
    \repeat percent 4 { s1 }
  }
  \context Voice = "firstnum" {
    \set restNumberThreshold = #0
    \override MultiMeasureRest #'transparent = ##t
    \override MultiMeasureRestNumber #'staff-padding = #1
    \override MultiMeasureRestNumber #'font-size = #-2
    R1
  }
>>

-David

reply via email to

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