address@hidden writes:
>http://codereview.appspot.com/4777044/diff/7001/input/regression/glissando-stem.ly
> File input/regression/glissando-stem.ly (right):
>
>http://codereview.appspot.com/4777044/diff/7001/input/regression/glissando-stem.ly#newcode10
> input/regression/glissando-stem.ly:10: \xenakisStem #(ly:make-duration
> 3) #32
> This should be a music function, possibly incorporating the \glissando
> for the initial note.
Well, putting aside the issue at point (where an interesting solution
accepting music in a reasonably natural manner has been proposed), I
find it excruciatingly ugly to specify arguments as #(ly:make-duration
... or #(ly:make-pitch ...
So I tried out a patch that will accept pitches (via signature
ly:pitch?) and durations (signature ly:duration?) as music function
arguments. Durations are not accepted everywhere since that would lead
to an awful number of shift/reduce conflicts. There _are_ combinations
of music arguments and durations that can't be resolved otherwise (since
durations are often optional at the end of music), so there is a reason
for it. Nevertheless, there is no error recovery built in right now, so
if you really cook up a forbidden music function signature (say
ly:music? ly:duration?) and call the respective function, Lilypond will
barf out with something like
/tmp/test.ly:4:5: error: syntax error, unexpected EXPECT_DURATION
Apart from the error recovery problem for bad music/duration
combinations in the signature, the patch would appear to work as
expected. I am not sure whether the current situation is not already
susceptible to imprudent signatures triggering syntax errors.
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.
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.