Appoggiatura or grace note before a bar line: Difference between revisions
Appearance
Import snippet from LSR |
Extend example to cover multi-staff situation. |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
By default, appoggiaturas and grace notes that occur on the first beat of a measure are printed after the 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. | ||
<lilypond version="2.24 | 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 <code>\afterGrace</code> command with setting <code>afterGraceFraction</code> appropriately. | ||
<lilypond version="2.24"> | |||
<< | |||
{ | |||
\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 } | |||
>> | |||
</lilypond> | </lilypond> | ||
| Line 14: | Line 27: | ||
[[Category:Workaround]] | [[Category:Workaround]] | ||
[[Category:Included in the official documentation]] | [[Category:Included in the official documentation]] | ||
[[Category:Snippet]] | |||
Latest revision as of 07:12, 30 November 2025
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.
\version "2.24"
<<
{
\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 }
>>