[ I have reposted this from the LilyPond bug mailing list.  Elmo, be sure
to post to lilypond-user@gnu.org in the future. ]

On Sat, Apr 19, 2025 at 5:33 PM Elmo Todurov via bug-lilypond <
bug-lilyp...@gnu.org> wrote:

> Hi folks, I found a case where an appoggiatura requires the preceding
> note to be long enough.
>
> Making the preceding note longer fixes the issue.
> Making the appoggiatura shorter (2 notes instead of 3) fixes the issue.
> Writing the music on the same staff using << {} \\ {} >> fixes the issue.
> Adding some grace notes to the bottom staff fixes the issue (but not
> grace rests/skips, these don't fix it).
>
> I found this 18 year old task that appears to be somewhat relevant:
> https://gitlab.com/lilypond/lilypond/-/issues/34
>
> Do you have suggestions how I could typeset my music so it'd sound good
> in MIDI?
>
> \version "2.25.24"
> \score {
>    <<
>      {
>        \partial 16
>        f'16 | % Shorter than 1/4 * appoggiatura?
>        \appoggiatura { e'8 e'8 e'8} % Longer than 1/4 * preceding note?
>        e'1 |
>        % Desync. Looks fine but sounds horrible.
>        e'8 e' e' e' e' e' e' e' |
>      }
>      {
>        \partial 16
>        c'16 |
>        % fixes the desync, but I don't want these notes:
>        % \grace { c8 c8 c8 }
>        % does not fix the desync: \grace { s8 s8 s8  }
>        c'1 |
>        c'8 c' c' c' c' c' c' c' | % Desync
>      }
>    >>
>    \layout {}
>    \midi {}
> }
>

You can have the MIDI in sync and the output looking good by "scaling" the
durations.  I used 8*1/2 but you can use any exponent of two as the
denominator that creates a valid duration.

%%%
\version "2.25.24"
\score {
   <<
     {
       \partial 16
       f'16 |
       % shorten the duration by multiplying by a fraction
       \appoggiatura { e'8*1/2 e' e' }
       e'1 |
       e'8 e' e' e' e' e' e' e' |
     }
     {
       \partial 16
       c'16 |
       % \grace { s8*1/2 s s } % Surprisingly, doesn't seem necessary
       c'1 |
       c'8 c' c' c' c' c' c' c' |
     }
   >>
   \layout {}
   \midi {}
}
%%%

--
Knute Snortum

Reply via email to