lilypond-user
[Top][All Lists]
Advanced

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

Re: Parameterizing a LilyPond function


From: PMA
Subject: Re: Parameterizing a LilyPond function
Date: Sun, 02 Dec 2012 18:00:27 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20101227 Iceape/2.0.11

David & David,

Thank you Both!

I'm using the one-param version, as in this score my X & Y offsets always match.
But on exec -- uh oh -- Scheme is yelling:

<string>:2:65: error: GUILE signaled an error for the expression beginning here
       \once \override Glissando #(quote (bound-details left Y)) = #
                                                                 offset
   Unbound variable: offset

Hmm.  The invocation, BTW, was     \glissmove #1.3

Just in case, better tell you my LP Version is still 2.13.32.
If I must upgrade Right Now, well then ok, but I'd almost prefer a cyanide pill.

Pete


David Kastrup wrote:
PMA<address@hidden>  writes:

Hi List.

I would like to alter this function...

glissmove = {
   \once \override Glissando #'(bound-details left Y) = #1.3
   \once \override Glissando #'(bound-details right Y) = #1.3
}

to accept its 1.3 or whatever as an input parameter instead.

I see docs on parameterizing Scheme functions, but not on
doing this in LilyPond directly -- LP's param handing syntax.
Have I overlooked something obvious?

It is not a function but a music constant.  To make a function, write

glissmove =
#(define-music-function (parser location offset) (number?)
   #{
     \once \override Glissando #'(bound-details left Y) = #offset
     \once \override Glissando #'(bound-details right Y) = #offset
   #})

Check the "Extending LilyPond Guide" for define-music-function.





reply via email to

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