Appoggiatura or grace note before a bar line

By default, appoggiaturas and grace notes that occur on the first beat of a measure are printed after the bar line. A possible solution for single staves to print it before the bar line is to add an invisible bar line and then the visible one.

In multi-staff systems, however, adding an invisible bar line distorts the positioning of full-bar rests in other staves; they are no longer centered but slightly shifted to the left. A better solution for such situations is to use the \afterGrace command with setting afterGraceFraction appropriately.

<<
  {
    \appoggiatura d''8 c''4 r2. |
    \appoggiatura { \bar "" d''8 \bar "|" } |
    c''4 r2.
  }
  { R1 | R1 }
>>

afterGraceFraction = 15/16

<<
  {
    \appoggiatura d''8 c''4 \afterGrace r2. d''8( |
    c''4) r2.
  }
  { R1 | R1 }
>>
[image of music]

LilyPond snippets v2.25.31 (development-branch).