is there any scope for scoped identifiers in pd?
because all identifiers are (or seem to be?) global, using sends, receives, arrays and delays in abstractions is problematic. if you make an abstraction that uses a delay line, and then you want to use two of them in a patch, you get behaviour other than what you expected because both abstraction are using the same delayline, rather than a copy.
i know you can get around this (a little) by handing in a parameter to the abstraction and using that as the name of the delay buffer, but if you want more than one delay, it starts getting ugly.
[this is where it starts getting a little less articulate...]
it would be nice if the names of delays and send/recieve busses could be contructed using strings which contained parameters, say "send $1_blah" and "receive $1_blah".. this doesn't seem to work tho. if it did, there could be a magic parameter ($0?) which contained some unique identifier for the current instantiation of an abstraction, and handing in the parameter would be unnecessary - as any identifier containing $0 would be guaranteed to be local to the current instantiation..
alternatively, this is already possible, and i'm about to find out how in a gazillion flaming emails.. which is not so bad either :)
pix.
|[this is where it starts getting a little less articulate...] | |it would be nice if the names of delays and send/recieve busses could be contructed |using strings which contained parameters, say "send $1_blah" and "receive $1_blah".. |this doesn't seem to work tho. if it did, there could be a magic parameter ($0?) |which contained some unique identifier for the current instantiation of an abstraction, |and handing in the parameter would be unnecessary - as any identifier containing |$0 would be guaranteed to be local to the current instantiation.. | |alternatively, this is already possible, and i'm about to find out how in a |gazillion flaming emails.. which is not so bad either :)
yeah, but thats known issue or so. the $1 $2 mechanism works, but not too consistently, i.e. it does for tables,delbufs, but e.g. not for the 'data' stuff, if i remem right (plis correkt if bullshit)
at the mom i m using stuff like $ for bla in 1 2 3 4 ; do perl repro.pl template.pd $bla >template-$bla.pd; done
and the perl looking like: #!/usr/bin/perl open TMPL, $ARGV[0] or die $!; while(<TMPL>) { s/patternx(.*)\b/pattern$ARGV[1]$1/g; print; }
or do the loop in perl whatever, to generate many abstractions with distinguished sends/receives and buffernames.
!¼¼|__..t<>o<>o##¯ 8450059999t··>->-