Hi Kieren,
On 11/01/2016 08:32 PM, Kieren MacMillan wrote:
I'm not sure how to write a function that accepts an arbitrary
number of music expressions.
Couldn’t the function “look forward” the number of entries in the udududud list?
I don't think that can work, because the function has to be called (with
however many arguments it takes) before it has access to its first
argument, which is the udud list or string. So a chicken and egg thing.
that seems to call for a "list of music expressions”,
but I'm not sure to what extent that would make the syntax unwieldy.
How does \alternative do it? Can something be learned from that?
So \alternative takes just one argument, a single music expression
wrapped in {}, with one or more music expressions nested inside. So
that approach might work, say with a function that took two arguments:
\split udd {{...} {...} {...}}
Although, I don't know how \alternative gets the sub-expressions out of
the top-level one... and after a brief cursory look at the source code
it looks like \alternative is handled by the parser (as opposed to being
just a scheme/music/etc function)... so I'm not sure how or even
whether this kind of thing can be done in user space (at least not with
existing functions like map-some-music).
Cheers,
-Paul
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user