lilypond-devel
[Top][All Lists]
Advanced

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

Re: music function refactoring


From: Erik Sandberg
Subject: Re: music function refactoring
Date: Wed, 1 Feb 2006 14:12:53 +0100
User-agent: KMail/1.8.3

On Wednesday 01 February 2006 13.43, Han-Wen Nienhuys wrote:
> Erik Sandberg wrote:
> > I have a feeling that \relative hacks is something very relevant (I
> > believe that shorthands such as the \interpolate{} thing can be very
> > valuable in the hands of an experienced lily user). The important thing
> > is that \relative should recurse into the parameters, not the return
> > value, of a function.
>
> the problem I have with this is that every other construct (eg. \times,
> \transpose) works directly. We can have "delayed" evaluation of music
> functions, but then every other construct needs to be done lazily too.
>
> Can you see a way to achieve that?

Yes, just represent those commands as music functions internally. E.g., 
\transpose creates a MusicFunction expression, with a list of two pitches and 
one Music as its 'elements (or 'arguments, I haven't decided yet), and 
'to-music-callback is set to ly:music-transpose (or rather, to a wrapper 
around that function).

-- 
Erik




reply via email to

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