pvar across patcher hierarchy

Cycling '74's icon

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.

jln's icon
Cycling '74's icon

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?

Jeremy's icon

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

jb

Jeremy's icon

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]], ...

jln's icon
Cycling '74's icon

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.

Adam Murray's icon

>
> 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.