lilypond-learning: The force-hshift property

 
 The ‘force-hshift’ property
 ...........................
 
 We can now see how to apply the final corrections to the Chopin example
 introduced at the end of SeeI'm hearing Voices, which was left
 looking like this:
 
      \new Staff \relative c'' {
        \key aes \major
        <<
          { c2 aes4. bes8 }
          \\
          { <ees, c>2 des }
          \\
          \\
          { aes'2 f4 fes }
        >> |
        <c ees aes c>1 |
      }
      [image src="" alt="[image of music]" text="image of music"]
 
 The inner note of the first chord (i.e.  the A-flat in the fourth Voice)
 need not be shifted away from the note column of the higher note.  We
 might expect to correct this by using ‘\shiftOff’, but this will cause
 warnings about clashing note columns.  Instead, we set ‘force-hshift’,
 which is a property of ‘NoteColumn’, of this note to zero.
 
    In the second chord we prefer the F to line up with the A-flat and
 the lowest note to be positioned slightly right to avoid a collision of
 stems.  We achieve this by setting ‘force-hshift’ in the ‘NoteColumn’ of
 the low D-flat to move it to the right by half a staff-space, and
 setting ‘force-hshift’ for the F to zero.  Note that we use ‘\once’ to
 avoid the settings propagating beyond the immediate musical moment,
 although in this small example the ‘\once’ and the second ‘\override’ in
 Voice four could be omitted.  This would not be good practice.
 
    Here’s the final result:
 
      \new Staff \relative c'' {
        \key aes \major
        <<
          { c2 aes4. bes8 }
          \\
          { <ees, c>2 \once \override NoteColumn.force-hshift = 0.5 des }
          \\
          \\
          { \once \override NoteColumn.force-hshift = 0 aes'2
            \once \override NoteColumn.force-hshift = 0 f4 fes }
        >> |
        <c ees aes c>1 |
      }
      [image src="" alt="[image of music]" text="image of music"]