pvar across patcher hierarchy

Dec 10, 2008 at 2:09pm

pvar across patcher hierarchy

I like using pattrforward to send messages to any object.

I want to be able to receive message from any object in the same way. [pvar] works, but only in the same patch ‘level’. I want something that works like [pvar parent::foo] for example.

pattr sort of works, but does something I don’t understand with data. For example I can do what I want to do with a simple number, but anything else and pattr doesn’t work or does odd things.

#41282
Dec 10, 2008 at 2:46pm

#146880
Dec 10, 2008 at 3:07pm

OK, illustrates my problem with pattr. The three float boxes in your example work, but the list coming out of the left outlet is garbled?

#146881
Dec 10, 2008 at 3:26pm

#146882
Dec 10, 2008 at 3:43pm

This looks more like a problem with filtergraph~. I’ll check it out.

jb

#146883
Dec 10, 2008 at 3:48pm

Quote: Jeremy Bernstein wrote on Wed, 10 December 2008 16:43
—————————————————-
> This looks more like a problem with filtergraph~. I’ll check it out.
>
> jb
>
>
—————————————————-

I spoke too soon. The assumption that filtergraph~s value matches the left-outlet output of filtergraph~ is wrong. The value is:

[num filters] [[filterno.] [filtertype] [gainmode] [analog] [displaydot] [centerfreq] [gain] [q]], …

#146884
Dec 10, 2008 at 3:56pm

#146885
Dec 10, 2008 at 4:35pm

Quote: Jeremy Bernstein wrote on Wed, 10 December 2008 15:48
—————————————————-
> Quote: Jeremy Bernstein wrote on Wed, 10 December 2008 16:43
> —————————————————-
> > This looks more like a problem with filtergraph~. I’ll check it out.
> >
> > jb
> >
> >
> —————————————————-
>
> I spoke too soon. The assumption that filtergraph~s value matches the left-outlet output of filtergraph~ is wrong. The value is:
>
> [num filters] [[filterno.] [filtertype] [gainmode] [analog] [displaydot] [centerfreq] [gain] [q]], …
—————————————————-

OK, here’s my problem. I want to get the output of an object, like pvar.

#146886
Dec 10, 2008 at 7:15pm

>
> OK, here’s my problem. I want to get the output of an object, like pvar.
—————————————————-

Currently I think there’s two reasonable ways to do this with the built-in objects if you don’t want to connect things with patch chords:

1. Use send/receive. This has the downside that you can’t run multiple copies of your patch side by side. If that doesn’t matter to you, then this is the easiest approach.

2. Send the object’s output to a [pattr] and then elsewhere in your patch bindto that pattr and it will receive all the output too.

I use option 2 a lot. You need to name the pattr receiving the object’s output, say [pattr myobject] and then the other pattr would be [pattr @bindto parent::parent::subpatch::myobject] or whatever.

I recommend looking into the pattrmarker object so you can do something like [pattr @bindto ::subpatch::myobject] by naming that subpatch with a pattrmarker. This is important if you rearrange your patches, and encapsulate things later, it would break a path like parent::parent::etc. And in Max 5 you can set the pattrmarker name in the patcher inspector which is nice.

In Max 5 you probably would also want to use the attribute “@default_active 0″ for these pattrs, since they are being used for communication and not for storing preset state. This doesn’t matter if you aren’t doing presets with a pattrstorage.

Hope that made sense. I can put together an example later if you can’t figure it out.

#146887
Dec 11, 2008 at 11:14pm

#146888

You must be logged in to reply to this topic.