On Fri, Oct 29, 2010 at 12:46 PM, David Kastrup <[email protected]> wrote:
>
> Are there good reasons left for not allowing music functions to take
> pitches as arguments? That would allow implementing something like
> \transpose as a music function. The alternative, letting it take a
> music event and not checking its duration and hoping that it is a single
> note, seems quite less elegant.
Music functions *can* take a ly:pitch as argument:
toto =
#(define-music-function (parser location pitch) (ly:pitch?)
(make-music 'NoteEvent
'duration (ly:make-duration 2 0 1 1)
'pitch pitch))
{ a \toto #(ly:make-pitch 0 0 0) b }
However, having to type #(ly:make-pitch x x x) is hardly convenient
from a user point of view.
> Since argument signatures of music functions and markup functions are by
> now processed as lists instead of fixed combinations, adding new
> argument types does not seem to have significant drawbacks.
I may be totally wrong, but it seems to me that what you're suggesting
amounts to actually create a new type, that would be a one-note
ly:music type whose duration is disregarded. (I'm not saying it would
be a bad idea, though.)
Cheers,
Valentin.
_______________________________________________
lilypond-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-devel