lilypond-devel
[Top][All Lists]
Advanced

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

Re: Music functions with pitch and duration arguments


From: David Kastrup
Subject: Re: Music functions with pitch and duration arguments
Date: Fri, 22 Jul 2011 08:32:39 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Han-Wen Nienhuys <address@hidden> writes:

> On Thu, Jul 21, 2011 at 10:01 PM, David Kastrup <address@hidden> wrote:
>> Anyway, this is not particularly complex either.  Could possibly pave
>> the way for a nicer function for setting up strings for tabulatures.
>> Also stuff like \transpose can be implemented by users with a
>> straightforward syntax accepting just pitches where pitches are asked
>> for, without the user needing to disassemble music in order to get at
>> the pitch somewhere in the center of the mess.
>
> It would be awesome to implement \transpose (and relative, for that
> matter) as a music function.

Not likely a speed gain.  But it might be nice to have this available
for other user-defined material.

>> What do people think?  I've not yet bothered with markup, though things
>> like \note would be better off taking a duration argument rather than an
>> integer.
>
> The patch looks neat. I don't see any obvious problems, but are you
> sure it compiles?

Yes.  The error message I quoted for a bad signature was not invented.

> It seems to be missing the init for the _proc variables you added,
> though.

No.  They are created by the existing calls of IMPLEMENT_TYPE_P in
pitch.cc and duration.cc and initialized there.

> Can you use ly_lily_module_constant?  It memoizes, so it is efficient.

Where is the point?  The respective variables _are_ initialized and set
with the pristine values of the type checking functions.  Memoization
can't be faster than that, I should think.

It could conceivably make a difference when the user masks the
definitions of ly:pitch?  or ly:duration? (merely setting them to
different values should not be a problem) but that's not really
something I want to think about too much.

-- 
David Kastrup



reply via email to

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