2

Following Lilypond: Single bar, multiple repeat, I want this for a multi measure repeat.

I'm converted (./.) to (.//.) with

percperc = \markup\concat{
  \raise #0.5 \musicglyph #"dots.dot"
  \hspace #-0.75
  \lower #1 \slash #2 #1 #0.98
  \hspace #-1.5
  \lower #1 \slash #2 #1 #0.98
  \hspace #-0.75
  \lower #0.5 \musicglyph #"dots.dot"
}

Now I need to get the measure bar (vertical line) in the middle. I can't find this bar in the documentation, how can I insert it?

My goal is to shorten my music to be used in my marching booklet. I don't have to have all measures with repeats written out, but just | notes | .//. | with the number above.

2
  • 1
    Please clarify what it is you actually want to achieve, if possible with an image.
    – Lazy
    Commented Oct 7, 2023 at 14:54
  • I'm trying to achieve what is written in the mentioned thread. The two measure repeat: i.sstatic.net/JuuHs.png
    – Fortissimo
    Commented Oct 7, 2023 at 22:38

1 Answer 1

0

Here is a way to get visually reasonable output without having to draw everything by hand. It won't produce correct MIDI output. LilyPond thinks it's just two measures long, so you have to fix the bar number afterwards.

\version "2.24.2"

doublePercentWithCount =
  #(define-music-function (length count) (ly:duration? number?)
     (make-music 'DoublePercentEvent
                 'length (ly:duration-length length)
                 'repeat-count count ))

{
  c'1 1

  \set countPercentRepeats = ##t
  \after 1 \once \omit Score.BarNumber  % suppress bogus bar number in the middle of the repeat
  \doublePercentWithCount 1*2 999       % length 1*2 (two measures), with "999" printed over it
  \set Score.currentBarNumber = 2001

  d'1 1
}

doublePercentWithCount is adapted from makePercent in the LilyPond documentation.

1
  • This is a very nice, and small way of doing it. And this can be made for 1 measure repeat also. PercentWithCount = #(define-music-function (length count) (ly:duration? number?) (make-music 'PercentEvent 'length (ly:duration-length length) 'repeat-count count )) { c'1 1 \set countPercentRepeats = ##t \doublePercentWithCount 1 999 % length 1*2 (two measures), with "999" printed over it \set Score.currentBarNumber = 2001 d'1 1 }
    – Fortissimo
    Commented Oct 8, 2023 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.