Hi David,

On Mon, Jan 7, 2013 at 5:25 PM, David G <[email protected]> wrote:

> I'm currently using code based on the snippet in
> http://www.lilypond.org/doc/v2.16/Documentation/snippets/repeats#repeats-measure-counterto
>  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
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to