When I start this piece with a grace note, it messes up formatting:
Code:
\version "2.18.2"
\header {
title = "Sonata in D Major"
composer = "Joseph Haydn"
opus = "Hob. XVI/37"
}
\language "english"
upper = \relative c'' {
\clef treble
\key d \major
\time 4/4
r4 r8 <cs a'> <d gs>( <cs a'>) <d gs>( <cs a'>) %m1
}
lower = \relative c {
\clef treble
\key d \major
\time 4/4
\grace gs''8( a-!) a,-! a-! a-! b(\trill a) b(\trill a)
}
\score {
\new PianoStaff <<
\set PianoStaff.instrumentName = #"Piano "
\new Staff = "upper" \upper
\new Staff = "lower" \lower
>>
\layout { }
\midi { }
}
If I remove the \grace
indication, it works (but of course, without the grace note):
How can I use this grace note while keeping the correct formatting? Is this a bug with Lilypond?
This is a knnown problem but there is a workaround: just add a spacer grace note ( \grace s8
) at the upper staff, before the r4
rest.
\grace s8 r4 r8 <cs a'> % etc
A fix for the problem is proposed to be investigated this summer during Google GSoC, see http://lilypond.org/google-summer-of-code.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With