Multiple instances of an embedded patcher object

Jan 18, 2012 at 2:04am

Multiple instances of an embedded patcher object

Hello~

I’m working on a pretty massive patch that makes heavy use of a custom database that I wrote. It’s essentially a wrapper around a central [coll] that allows me to query and edit the data in a multitude of patch-specific ways.

The problem I’m running into is that I have multiple instances of this database spread throughout my patch for easy access and querying one outputs out of all instances in the patch which obviously causes issues. I’ve worked around this by gating the output from an instance of the database to only be open for a query to that particular instance, but this is getting increasingly messy as the patch grows and this technique has stopped working reliably.

I feel like there has to be something (obvious?) I’m missing here and any suggestions or insights would be greatly appreciated.

Thanks in advance.

#61301
Jan 18, 2012 at 2:19am

Can you post (part of) your patch to illustrate the problem? All colls that are named the same share their data, so you can query an instance in one place and not have it output in another place.

#221000
Jan 18, 2012 at 2:50am

The patch is a little too big/unwieldy to put up here but I’ll attach an example that demonstrates my problem and see if I can better describe it. I guess my issue is that I’m treating a patcher like I would a coll (where I can have many instances that share data but behave independently) but it’s not really working.

So for example, let’s say I have a database named [databox] that is basically a system wrapped around a coll named [coll databox] that allows me to edit and query the data in the [coll] in desirable ways. Due to the logic of my patch, I have 3 instances of [databox] in my patch that I want to act independently of each other but still share the data in [coll databox].

My problem is that I send to the first instance of [databox], but the output then comes out of all three instances of [databox], rather than only the first instance that I sent it to.

Attachments:
  1. myproblem.maxpat
#221001
Jan 18, 2012 at 2:52am

can you post the dotbox0 patch?

#221002
Jan 18, 2012 at 6:10pm

Appreciate the help on this, but I figured my problem out… there was a send object a few layers deep in [dotbox] that was pinging a receive object in another layer. These there then of course getting sent to all like-named objects across the patch and causing undesirable output in certain cases.

Lesson: Don’t use send/receive in a patch you intend to use multiple instances of in another patch. :P

cheers,

-j

#221003
Jan 18, 2012 at 6:47pm

Or prefix your send/receive name with #0

#221004
Jan 18, 2012 at 7:27pm

Didn’t know that trick… many thanks.

#221005

You must be logged in to reply to this topic.