Klaus Blum <[email protected]> writes:

> Hi David,
>
> That's perfect, thanks a lot!
> Cool to know that this doesn't require complicated tweaks and hacks...

If you think this isn't a complicated hack, you haven't looked at the
source code of make-relative...

Its three arguments, by the way, are a list of variables, an expression
containing the variables that is passed through \relative and modifies
the variables according to their occurence in the expression, and
finally the expression you _actually_ want calculated.

So if you have three arguments of music expression that should be
relativised after another, you can say

(define-music-function (a b c) (ly:music? ly:music? ly:music?)
  (a b c) #{ #a #b #c #}
  #{ ....... #})

And regardless of how often and in which order you use which argument
inside of your actual music function body, the effect of \relative on
them will be instead as if they had appeared only in #{ #a #b #c #} .

-- 
David Kastrup

Reply via email to