Communitcating via send/recieve with #0bpatchers

Jan 14, 2008 at 11:46pm

Communitcating via send/recieve with #0bpatchers

I have several copies of a bpatcher in my patch and each have several parameters that I would like to be able to change via a send/recieve from the mother patch. The problem is, since I have several copies of the same bpatcher I would have to use [recieve #0param] in order to keep my recieves unique. The question is, how do I make it so the mother patch knows the unique identifier name generated for each of the bpatchers so that I can send messages using something that might end up looking like [send 09123084param] from the main patch into the bpatchers?

Any help would be much appreciated. My solutions so far of getting the unique ID number generated and setting it as the [send] name in in the main patch have been pretty sloppy, I have a feeling there is a better way to do this…

Thanks for your help,

Kevin

#35376
Jan 14, 2008 at 11:54pm

Typically, you’d have each patcher send its unique #0_ symbol back to a receive in the the main patch when it loads, and store all those in a coll.

Then to communicate with receives in the patchers, dump the coll through [sprintf send %sreceivename], which will append specific receive names to each ID, connect that to [forward], and send your message for each coll output.

#120506
Jan 14, 2008 at 11:56pm

hi !

the way to do this is to make a little referencing procedure, you can create in your subatchs a response to a “who” request, they will return their id, then you can store ids into a coll or a menu to select the one you want to communicate with…

cheers

g

#120507
Jan 15, 2008 at 12:35am

aha thank you, using forward with coll would be a nice solution

#120508
Jan 16, 2008 at 10:25am

kevin schrieb:
> I have several copies of a bpatcher in my patch and each have several
> parameters that I would like to be able to change via a send/recieve
> from the mother patch. The problem is, since I have several copies of
> the same bpatcher I would have to use [recieve #0param] in order to
> keep my recieves unique.

I would make my life simpler by using a parameter and a #1 or #9 as you
like to distinguish between the bpatchers. #0 is usefull for internal
references, its more like a local variable which isn’t easily visible
outside. (Too much hassel to send it outside or place it into a coll for
my taste…)

But…

I have a js based object in my abhaXions/St.ools which could also use
the name of the bpatcher as reference. I give the bpatcher a name like
“MyBPatcher[1]” and the mynamber object will extract the “1″ of it. If I
duplicate this bpatcher it will automatically have the name
“MyBPatcher[2]“…
I use this number to script receive objects/buffers or whatever…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#120509

You must be logged in to reply to this topic.