lilypond-user
[Top][All Lists]
Advanced

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

Re: Function for tweaks


From: Lukas-Fabian Moser
Subject: Re: Function for tweaks
Date: Sat, 6 Oct 2018 12:32:23 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Hi Helge,

I want to save typing and it's tedious to write the complete tweak each
time. But the Y size must be adapted each time. Therefore a function is
necessary to change the current required value that is 6 in the example.

I've experimented with define-markup-command and define-music-function
by GUILE always outputs errors.
makeSpace = #(define-event-function (size) (number?)
               #{
                 -\tweak #'stencil #(ly:make-stencil '() '(0 . 0.1) `(0 . ,size) ) _""
               #}
               )

upper = \relative c'' {
    c1 \makeSpace 10
}

The two man points being:
- use define-event-function instead of define-music-function
- use a quasiquote ` instead of the quote ' for the pair (0 . [size]), since size must be evaluated, hence unquoted by a comma (,size).

Best
Lukas



reply via email to

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