The staff-position property

Multi-measure rests in one voice can collide with notes in another. Since these rests are typeset centered between the bar lines, it would require significant effort for LilyPond to figure out which other notes might collide with it, since all the current collision handling between notes and between notes and rests is done only for notes and rests that occur at the same time. Here’s an example of a collision of this type:

<< \relative { c'4 c c c } \\ { R1 } >>

[image of music]

The best solution here is to move the multi-measure rest down, since the rest is in the lower voice. The default in \voiceTwo (i.e., in the second voice of a <<{…} \\ {…}>> construct) is that staff-position is set to -6 for MultiMeasureRest, so we need to move it, say, four half-staff spaces down to -10.

<<
  \relative { c'4 c c c }
  \\
  \override MultiMeasureRest.staff-position = -10
  { R1 }
>>

[image of music]

This is better than using, for example, extra-offset, because the ledger line above the rest is inserted automatically.

Note that there is a peculiarity with this property if applied to a Tie grob: LilyPond distinguishes between exact numbers (like integers and fractions) and inexact numbers (like numbers with a decimal point). See engraving ties manually for the difference between exact and inexact values.


LilyPond Learning Manual v2.25.20 (development-branch).