Repeating bpatcher elements as individual instances?

Feb 1, 2011 at 10:07am

Repeating bpatcher elements as individual instances?

I have an interface I’m working on. It is basically a synth voice that I want to repeat 16 times as individually controllable GUIs. So I built the main synth patch and made a perf view for it. Then I made a new patcher and opened the synth in a bpatcher. Next I simply copied the bpatcher 15 more times.

The first thing I noticed is that the entire patcher responds to input as a group. The dials and some other controls change individually – but [buffer~] for instance seems to globally change all 16 voices to the same file rather than individually. Some other functions like MIDI input range also change globally.

So I guess my question is this: How can I repeat bpatchers so that each one is individually contained and behaves on its own?

thanks,

speedo

#54712
Feb 1, 2011 at 10:24am

You should probably make the buffer names dynamic (different names per bpatcher). If they share the same name they share the same spot in memory.

#197063
Feb 1, 2011 at 6:44pm

Take a look at the patcherargs object – this will help you with assigning unique buffer names by using arguments you’ve entered in the bpatcher inspector.

#197064
Feb 1, 2011 at 7:36pm

use #0 in front of any name like “#0_mybuffer” to generate a unique random number inside an abstraction/bp.

otherwise go with what Jesse said. Although you don’t necessarily need the patcherargs obect. #1, #2, #3 etc. will do the trick as well ;)

#197065
Feb 1, 2011 at 8:44pm

you can give arguments in the bpatcher’s info window, look for the “arguments” tab. place the #1, #2, #3… where your arguments need to show in the original instance.

#197066
Feb 2, 2011 at 1:42am

Having a little trouble figuring this out. If my buffer is inside a subpatcher can/should I add #0 to the subpatcher name? Is this all documented somewhere?

#197067
Feb 2, 2011 at 1:50am

You add it to the name of the buffer in each subpatcher.

#197068
Feb 2, 2011 at 4:06am

I found the documentation for this in the encapsulation section. I think I want to make it as dynamic as possible. I don’t want to have to add fixed attributes or variables to each individual bpatcher element as the whole point is that it be reusable in any number of instances. Still a little hazy on this, but will try to figure it out – thanks.

#197069
Feb 2, 2011 at 5:24am

Ha! I think I figured out the problem and it’s not directly related to the buffer~. It’s the send and receive objects conflicting with my hierarchy.

My original patch has a number of send and receive objects in it. So when it is multiplied within the bpatcher ALL of the send and receives are responding to the same messages rather to the individual subpatchers.

The subpatcher has like 30 send and receive objects. Is there a way to make them respond only to their level without completely reassigning objects?

#197070
Feb 2, 2011 at 8:25am

Prefix all your send and receive names with #0 for example #0_my_name. The #0 will be replaced with a unique number per instance.

#197071
Feb 2, 2011 at 12:16pm

Oh, so it works with those objects too? Wow, what a trick this #0 thing. It should be documented somewhere. Maybe it is and i just didn’t see it.

Thanks all!

#197072
Feb 2, 2011 at 6:05pm

I’m sure that it’s it the doc, but I couldn’t find it with a couple searches. Looking for stuff like this was much easier when the doc was a .pdf file.

#197073
Feb 4, 2011 at 11:53am

One problem I’m having now. It seems that the random number generated changes between a patcher and poly~. So I cannot get the send objects in the parent patcher to communicate with the receive objects in the poly~ as their numbers are different.

#197074
Feb 4, 2011 at 7:10pm

It’s unique for each patch, and poly~ makes new patches. You’ll have to pass in #0 into poly~

#197075

You must be logged in to reply to this topic.