Forums > MaxMSP

bpatcher to parent local send

October 16, 2010 | 3:06 pm

Hi all,

I have a patch containing a bpatcher that will be used in several instances at once, and I am looking for a way to create local send from bpatcher to parent patcher without affecting other instances. I tried #0, but I believe it only works with one patcher level ?? I don’t want to make outlets to send messages or connect with cables, as the contents of the bpatcher are supposed to be variable from a given set of patches, all (hopefully) containing the local bpatcher-to-parent send. Also, it could work as local bpatcher-to-bpatcher, if that is possible.

Hopefully this was clear enough.

Thanks,
Eric



MIB
October 16, 2010 | 8:53 pm

I made a little system that seems to work for me. there are some helpfiles included. ask questions if anything doesn’t make sense. I did this for me, so it might only make sense to me :)

Attachments:
  1. nTb-MRr.zip

October 16, 2010 | 11:13 pm

Hi,

Thanks very much for these objects. I will try working with them tomorrow. From first glance, I am wondering if I either gave a poor explanation or don’t quite understand what they do. It seems as if they are best for generating unique s r pairs for within a single patcher or bpatcher, used in multiple instances. (is this correct?) What I am looking to do is send data from bpatcherA to bpatcherB within a parent patcher, without affecting other instances of the parent patcher. Have you used these objects for this type of application? It seems as though it could be done with some work, but I have a feeling I am making it more complicated than necessary.

Thanks again,
Eric



MIB
October 17, 2010 | 1:00 am

multiple uses of the same bp is what they were designed for, you are right. But if you have two bpatchers and give them both the argument 1, then you can send messages between the two. It might work depending on what you want.
can you be more specific, maybe attach an example?


October 17, 2010 | 6:38 am

I would pass in #0 as an argument to the bpatchers involved. That way, whatever the #0 is in the parent patcher would be available in the bpatchers, so that you can generate whatever you need.


October 17, 2010 | 11:08 am

Okay, I’ve found a way that works, although maybe not the most efficient. I am using a random naming generator for the s and r objects in the bpatchers, being sent to them through scripting when they are being created. I used #1 in the bpatchers to make it global but sending a randomly generated name makes them local to each other. I tried doing it with #0 but ended up constrained within the bpatchers. Chris, I think I didn’t quite understand what you meant so I probably didn’t do it how you meant. Anyway, I was intending for these bpatchers to be created with scripting anyway, so setting a random arg for the s and r works okay, even if it is clunky. Any more efficient solutions would be great, but I am content at this point. Thank you both for your input! Here’s the example. MIB, thanks again for the objects. They seem quite useful!

(please use second attachment, I had to make a slight edit)

Attachments:
  1. working.zip

October 18, 2010 | 3:00 pm

Here is a better example using pv instead. The other way came up with error messages while loading, as the send and receive had args of #1 while waiting to be loaded from the random generator. Still, if anyone knows of any more efficient way than using pv with a metro to get (somewhat)continuous output from pv, please let me know.

Attachments:
  1. better.zip

Viewing 7 posts - 1 through 7 (of 7 total)