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.
From: "Geoff Horton" <address@hidden>
Date: Thu, 6 Apr 2006 11:57:44 -0400
To: "Lilypond mailing list" <address@hidden>
Subject: Macro pre-processing?
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.)
Geoff
_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user