lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mysterious behavior in music function


From: David Kastrup
Subject: Re: Mysterious behavior in music function
Date: Mon, 05 Aug 2019 15:27:57 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Thomas Morley <address@hidden> writes:

> Hi Marc,
>
> two Problems:
> (1)
> A postevent can't be attached to a music-variable, this feature will
> be likely be available with next stable.

Well, next unstable anyway but I think I'll pull this one into the
stable branch since it otherwise is too much of a candidate for the
"experienced user gives advice to less experienced user and did not
realise it doesn't work with stable" kind.  And there's been no
complaint about it for the people using/testing master.

> (2)
> afterGrace expects _two_ musical arguments.
> Your code
>>     #{
>>       \afterGrace
>>       $firstNote
>>       \glissando
>>       \once \override Stem.stencil = ##f
>>       \once \override Flag.stencil = ##f
>>       \parenthesize $secondNote
>>     #}
>
> provides $firstNote as first argument  and \glissando as the second.
> (And there is an optional argument for the `fraction´)

This one will not be affected by the post-event sweep-up that should
help with point 1.

> You will want to have a first-note-with-starting-glissando as first argument 
> and
> a parenthesize-second-note-with-overrides as second. Thus use brackets:
>
> bendDown =
> #(define-music-function
>    (parser location firstNote secondNote)
>    (ly:music? ly:music?)
>     #{
>       \afterGrace 15/16
>       {
>         <>\glissando
>         $firstNote
>       }
>
>       {
>         \once \override Stem.stencil = ##f
>         \once \override Flag.stencil = ##f
>         \parenthesize $secondNote
>       }
>     #}
>   )

Not a fan of using overrides in such situations since they might affect
unrelated notes/constructs.  I prefer tweaks here, like

    \parenthesize \single \omit Stem \single \omit Flag $secondNote
    
All the best

-- 
David Kastrup



reply via email to

[Prev in Thread] Current Thread [Next in Thread]