4

Lilypond's "\repeat percent" construct enables you to express a repeating musical snippet by writing the first occurrence in full then using a symbol as a sort of "ditto" mark for the later ones. Lilypond puts this symbol vertically in the middle of the stave. This is not good if other music in the stave collides with it. How can I raise or lower the symbols? I know of \raise #y t where y is an amount of vertical shift and t is some markup, but this applies only to markup, and doesn't work with the percent symbol.

\version "2.18.2"
\include "english.ly"

notes =
{
    \numericTimeSignature
    \time 4/4
    \clef bass
    <<
        \repeat percent 4 { a16 b c'b }
    \\
        { c4 d e d }
    >>
}

\score
{
    \new Staff \notes
    \layout {}
}

the awful effect of the above Lilypond

4

You can use the override: \override RepeatSlash.Y-offset = #3 in the layout block.

\score
{
    \new Staff \notes
    \layout 
    {       
        \override RepeatSlash.Y-offset = #3
    }
}

raise repeat slashes


NB Lilypond uses objects of 4 different types to engrave the symbol, so what sort of repeating figure determines which type-name you need to use in the override command:

  • RepeatSlash for a slash or multiple slashes, when the repeating figure is less than a full bar, and the notes are the same length
  • DoubleRepeatSlash for a symbol like .//., when the repeating figure is less than a full bar, and the notes are not the same length
  • PercentRepeat for a symbol like ./., when the repeating figure is exactly one bar
  • DoublePercentRepeat for a symbol like .//. straddling the barline, when the repeating figure is exactly two bars

For example, for a one-bar repeating figure you might use this command:

\override PercentRepeat.Y-offset = #3

The default value is #0 which puts the symbol in the middle of the stave. The unit of measurement is the distance between lines in a stave. So to lower the symbol so that its top is on the bottom line, use e.g. \override PercentRepeat.Y-offset = #-3.

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.