Re: What’s up with this snippet?
Werner LEMBERG <[email protected]>
| Newsgroups | gmane.comp.gnu.lilypond.general |
|---|---|
| Message-ID | <[email protected]> |
> I was pointed to this official Lilypond snippet for a sharp on a turn:
>
> https://lilypond.org/doc/v2.26/Documentation/snippets/expressive-marks-_002d-creating-a-delayed-turn[1]
>
> What this snippet is doing is to place the turn on a hidden note
> featuring the accidental and then using suggestAccidentals with a
> ton of overrides to get the sharp under the turn.
>
> This is not only obviously quite a fickle way to get this done, it
> also adds issues such as Lilypond handling this as a regular
> accidental. Guess the only advantage is that this handles change of
> accidentals on transposition (but there are better solutions to
> that).
>
> The reasonable way to do this would of course be something like
>
> \relative c'' {
> \after 2*2/3 \turn c2( d4) r |
> \after 4 \turn c4.( d8)
> \after 4
> -\tweak stencil
> #(grob-transformer
> 'stencil
> (lambda (grob orig)
> (ly:stencil-combine-at-edge
> orig Y DOWN
> (grob-interpret-markup grob (markup #:center-align #:fontsize -5 #:sharp))
> 0.2)))
> -\turn
> d4.( e8)
> }
>
> which is the clean way that is properly extensible to similar such
> applications (accidentals above turn, accidentals on other
> ornaments, ...).
>
> Is there any reason for having this snippet?
This snippet is in the NR; it would be thus better to provide an
improved version. Please go to
https://wiki.lilypond.community/wiki/Creating_a_delayed_turn
and update the code; it will be then imported into LilyPond
eventually.
Werner