lilypond-user
[Top][All Lists]
Advanced

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

Re: Current octave in relative mode


From: David Kastrup
Subject: Re: Current octave in relative mode
Date: Fri, 15 May 2020 14:04:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Klaus Blum <address@hidden> 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

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