If somehow you find an answer to this and it doesn't make the list, I wish you'd post it. I can think of a million uses for being able to pass a variable to a function on the fly, and never have figured out how to do it without having a second variable that is actual notes included and putting the whole thing around curly brackets. Just to be able to pass a padding parameter to a user-written function for spacing, say, rehearsal marks would be a great timesaver.
I guess I should start by explaining what I want to do. I have a lot
of notes in chords whose noteheads need to be individually \tweak-ed
to be smaller. Always on the lookout to reduce typing (and thus
typos), I tried:
organ = { \tweak "'font-size #-2 }
But LilyPond wants an argument right then and there. I strongly
suspect I could do a Scheme macro if I knew enough about Scheme and
LilyPond internals, but that seems overkill when all I really want is
the equivalent of a C compilers macro expansion capability.
I could write such a utility easily enough in Perl, and I suspect it's
simple enough that I could learn enough Python to write it without too
much trouble (thereby not introducing a fourth language into the mix),
but I'm wondering if there already exists a simple way to do text
substitutions that I don't know about. (I'd also like to use this for
a more general conditional interpretation facility than the tags
supply.)