5

I want to put text in a \repeat unfold in LilyPond without repeating the text, so that it only shows up on the first instance of the phrase.

I can't put it on the previous note because the repeat phrase is the start of the piece.
When I put it on a note in the repeat expression, the text appears above both instances of the note.
I've also tried using a spacing rest, but the duration of the invisible rest is added to the already full measure and causes other problems.

Is there a way to make the text not repeat with the note?

2 Answers 2

4

You can make the text into a parallel music passage that doesn't use \repeat, for example

{ \new Staff {
  << { \repeat unfold 3 { c''4 d'' } }
     { s4^"foo" s4^"bar" }
  >>
  e'' f''
} }

It doesn't matter that the parallel passages are different lengths, as the example demonstrates.

enter image description here

2

Since LilyPond version 2.23, there are a new some new commands for repeats. The \volta command goes inside of a \repeat (unfold, volta, or segno) and specifies a musical expression that is applied to a particular iteration of the repeat loop.

To have only-markup as the musical expression, the trick is to attach the markup to a spacer with zero duration:

\repeat unfold 3 {
    \volta 1 { s1*0^\markup "text" }
    c'4 d' e' f'
}

See: 1.4.1 Long repeats - Other variation in repeated sections for more detail.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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