lilypond-learning: The staff-position property

 
 The ‘staff-position’ property
 .............................
 
 Multimeasure 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:
 
      << { c4 c c c } \\ { R1 } >>
      [image src="" alt="[image of music]" text="image of music"]
 
    The best solution here is to move the multimeasure rest down, since
 the rest is in voice two.  The default in ‘\voiceTwo’ (i.e.  in the
 second voice of a ‘<<{...} \\ {...}>>’ construct) is that
 ‘staff-position’ is set to -4 for MultiMeasureRest, so we need to move
 it, say, four half-staff spaces down to ‘-8’.
 
      <<
        { c4 c c c }
        \\
        \override MultiMeasureRest.staff-position = #-8
        { R1 }
      >>
      [image src="" alt="[image of music]" text="image of music"]
 
    This is better than using, for example, ‘extra-offset’, because the
 ledger line above the rest is inserted automatically.