Hello Antescofers.
First of all, I want to thank the team for this amazing piece of software, and the forum members for being so active and encouraging.
I’m having a small issue concerning text-expansion macros which I’m hoping that you all might have some ideas for. The answer is likely obvious to others, but is not to me. In short, it involves a macro to expand a TAB into a properly-formatted NIM definition.
Because of the way I use Antescofo at the moment (I’m open to new ideas, thanks to this group!), I use a LOT of NIMs in the course of a piece. And I use them almost always in the same way, as a number of evenly-spaced breakpoints as an argument to a process call. To give an example:
;==A Process==:
@proc_def myproc ($note, $vel, $length, $cutoffNIM)
{
group myproc {
$midinote := [$note, $vel]
$midioff := [$note, 0]
midipair-myproc $midinote
curve cutoff @grain = 0.1 @action {cutoff-myproc $cutoff-myproc}
{cutoff-myproc : $cutoffNIM}
$length midipair-myproc $midioff
}}
I would currently call this thus:
NOTE 66.5 1/2 “event10”
{group myprocnote {
$length := 3 ;three beats
$CutoffNIM := NIM {0 5000, ($length/3) 10000 “sine_in”,
($length/3) 22000 “cubic_in”,
($length/3) 4000 “cubic_out”}
::myproc (65.2, 100, $CutoffNIM)
}}
A macro (let’s call it MrsFrizbee) to perform the text expansion of the NIM, might do something like this:
Take a TAB of the form: [a, b, c, d, …]
or even of the form: [a, [b, @opt shape1], [c, @opt shape2], [d, @opt shape3], …]
and the $length variable in the process call, expanding into something like:
let $tabdelta := ($length/(@size TAB) - 1)
NIM {0 a, $tabdelta b {shape1 if provided},
$tabdelta c {shape2 if provided},
$tabdelta d {shape3 if provided},
…
}}
returning the NIM.
The looping constructs provided don’t provide an obvious answer inside a text-expansion macro of this type; however I am also not the brightest programmer in the room. Also, it occurs to me that this might be impossible, because the $length variable is unavailable to the macro at expansion time, or for other—more arcane—reasons. (?) Maybe better done with a function?
The resulting process call, with the macro, might look something like this:
NOTE 66.5 1/2 “event10”
{group myprocnote {
$length := 3
$CutoffNIM := @MrsFrizbee([5000, [10000 “sine_in”], [22000 “cubic_in”], [4000, “cubic_out”])
::myproc (65.2, 100, $CutoffNIM)
}}
(or possibly this:NOTE 66.5 1/2 “event10”
{group myprocnote {
$length := 3
$MrsFriz := @MrsFrizbee([5000, [10000 “sine_in”], [22000 “cubic_in”], [4000, “cubic_out”])
$CutoffNIM := $MrsFriz
::myproc (65.2, 100, $CutoffNIM)
}}
)
This is mostly out of laziness, rather than any grand compositional scheme that can be realised no other way; but given that I use perhaps 200 NIMs of this type in a 10min piece, many of which have 5<breakpoints<30, this could really speed me up.
Thanks in advance,
Nicholas R. Nelson
City University of New York
Brooklyn College Center for Computer Music