Thanks for the response!

Following (without /\glissando/) works now:

   #{ \afterGrace #starttone { \once \hide Stem \parenthesize #endtone } #}





Unfortunately, as soon as I insert the /\glissando/ between /#starttone/
and /{/, it seems to ignore both /\afterGrace/ and /\glissando/,
shifting back all the following music.



How can I correct this?

Greetings,
Jonathan


Am 23.02.2024 um 14:27 schrieb David Kastrup:
[email protected]  writes:

Good day,

following snippet I need very frequently (with different notes instead
of c4 and e4):

    \afterGrace c4 \glissando {\once \hide Stem \parenthesize e4}


That's why I wanted to create a music function to shorten the
expression. My previous attempt:

    graceGliss =
    #(define-music-function
       (starttone endtone)
       (ly:music? ly:music?)
       #{
         \afterGrace #starttone \glissando {\once \hide Stem
    \parenthesize #endtone}
       #})


doesn't work, Return Code 1.

In order to test the general functioning of define-music-function, I tried:

    graceGliss =
    #(define-music-function
       (starttone endtone)
       (ly:music? ly:music?)
       #{
         \afterGrace #starttone #endtone
       #})


which works, what leads me to believe that the error must have something
to do with the curly brackets {} …


For some help I'd be very grateful!
Kind of stupid, but Scheme syntax is very simplistic (almost anything
except for parentheses needs to be space-separated) and your problem
here is that # goes into Scheme.

So you call upon one Scheme variable endtone} which does not exist.  Put
a space before the closing brace.

Reply via email to