lilypond-user
[Top][All Lists]
Advanced

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

Re: Parameterizing a LilyPond function


From: David Kastrup
Subject: Re: Parameterizing a LilyPond function
Date: Sun, 02 Dec 2012 22:04:12 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

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.

-- 
David Kastrup




reply via email to

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