Forums > MaxMSP

pattrstorage too greedy?

May 15, 2006 | 12:07 pm

Greetings,

According to the reference manual, attribute greedy should behave like this: "When disabled, the pattrstorage object can see pattrstorage objects in a child patch, but no other objects at that level or below in the patcher hierarchy." I am experiencing a slightly different behavior, namely that greed limitation is contingent on the presence of a pattrstorage object in the child patch. If it’s not there, even with greedy set to 0, all exposed objects in the child patch are seen by the parent pattrstorage object. Hopefully the patch below demonstrates this. Please let me know if this is expected behavior.

Thanks,
Eric

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#N vpatcher 424 252 867 494;
#P window setfont "Sans Serif" 9.;
#N vpatcher 10 59 610 459;
#P window setfont "Sans Serif" 9.;
#P newex 76 81 101 196617 autopattr garbo3sub;
#X prestore greed-has-no-limits 1 0 0;
#P objectname garbo3sub;
#P user hslider 77 44 18 128 128 1 0 0;
#P objectname greed-has-no-limits;
#P pop;
#P newobj 85 110 75 196617 p garbo3below;
#P objectname garbo3below;
#P newex 88 29 98 196617 pattr i-am-exposed;
#X prestore 1 0 88;
#P objectname i-am-exposed;
#P user hslider 132 56 18 128 128 1 0 0;
#P objectname garbo3-slider;
#P comment 39 84 100 196617 same deal with pattr;
#P connect 2 1 1 0;
#P pop;
#P newobj 175 138 49 196617 p garbo3;
#P objectname garbo3;
#N vpatcher 334 293 699 509;
#P window setfont "Sans Serif" 9.;
#P newex 18 70 86 196617 autopattr garbo2;
#X prestore i-want-to-be-alone 1 0 61;
#P objectname garbo2;
#P user hslider 18 44 18 128 128 1 0 0;
#P objectname i-want-to-be-alone;
#P comment 18 99 114 196617 no pattrstorage , named object is exposed to top irrespective of greed.;
#P pop;
#P newobj 117 138 49 196617 p garbo2;
#P objectname garbo2;
#N vpatcher 109 220 386 425;
#P window setfont "Sans Serif" 9.;
#P newex 125 84 106 196617 pattrstorage garbo1a;
#X client_rect 0 0 640 240;
#X storage_rect 0 0 640 240;
#P objectname garbo1a;
#P newex 36 84 86 196617 autopattr garbo1;
#X prestore i-am-alone 1 0 0;
#P objectname garbo1;
#P user hslider 33 46 18 128 128 1 0 0;
#P objectname i-am-alone;
#P comment 35 111 123 196617 expected greedy behaviour observed here;
#P pop;
#P newobj 59 138 49 196617 p garbo1;
#P objectname garbo1;
#P toggle 259 67 15 0;
#P message 259 87 56 196617 greedy $1;
#P newex 259 111 110 196617 pattrstorage breeders;
#X client_rect 316 99 956 339;
#X storage_rect 0 0 640 240;
#P objectname breeders;
#P newex 259 133 100 196617 autopattr greedhead;
#P objectname greedhead;
#P window linecount 5;
#P comment 48 60 187 196617 greed limitation appears contingent on presence of pattrstorage objects (or pattrhub?) in subpatches. Look at client window with greedy on and off , and check respective patchers.;
#P connect 3 0 2 0;
#P connect 4 0 3 0;
#P window clipboard copycount 8;


May 16, 2006 | 11:00 am

it is the behavoir I’d expect, if this was not so, making an abstraction tap into the pattrstorage system would be impossible !

which would be very sad ;)

you’ll have to use the active message on the name of the subpatchers you wan’t to exclude.


May 16, 2006 | 11:21 am

I’m not sure this is so. Recall that with the "greedy" attribute enabled pattrstorage does "see everything" as advertised, which as you point out is sometimes desirable. However, my example patch above addresses the fact that when "greedy" is turned off, pattrstorage still sees some things which, if I understood it correctly, the documentation suggests that it should not see.

Of course it’s possible to make anything inaccessible with the "active" message, and placing a pattrstorage in every subpatch apparently also solves the problem. But the documentation is not clear on this point, and the interaction of multiple pattrstorage objects at different levels might be worth learning more about.

I should mention that I’m using 4.5.7 on OSX 10.4.6.

Eric


June 10, 2006 | 8:21 am

Eric -

greedy is working as advertised. I’m not entirely sure what the
problem is.

greedy 0: pattrstorage looks downwards. if it encounters another
pattrstorage object, it sees that object, but nothing else at the
patcher level or below of that 2nd object.
greedy 1: pattrstorage looks downwards. regardless of what objects it
encounters, it sees everything, as far down the patcher hierarchy as
it can.
greedy 2: pattrstorage looks in its own patch, and nowhere else.

jb


June 10, 2006 | 5:21 pm

Thanks, Jeremy.

My documentation was out of date and the behavior of pattrstorage has since changed. It make a lot more sense with mode 2 added.

Eric


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