200 ui objects… And I don't want 200 pvar's.

Mar 4, 2008 at 7:10pm

200 ui objects… And I don't want 200 pvar's.

Hello,

Is it possible to avoid creating 200 pvar’s (one for each UI object)…

I definitely don’t want the max 5 solution either in case you mention that. In fact I don’t want any “corresponding” object at all.

but rather instead…

Is it possible that I could simply receive from the whole group of objects, all at the same time? ..receive a message from any of them which comes out of a single objects outlet? Which I could then route…

Such as:

[objectclass] [objectname] [message]

so, ie,

toggle foo_Mp_blues 1
button arg_9_check bang

At the moment I had to create 200 pvar’s like so:

pvar foo
|
prepend foo

It’s annoying…

Hope someone can help!
This would really really simplify every single one of my UI’s in max… I simply want MESSAGES I can route.. not a zillion pvars.

I’d like to be able to select different bunches of objects and assign them each to individual ‘scopes’ so that their route messages all come out of a certain outlet or are associated with a particular prepended symbol which I can then route…

- Glot

#36183
Mar 4, 2008 at 7:33pm

yes.
pattrstorage with autopattr.

set output mode to 1.

#124005
Mar 4, 2008 at 7:51pm

Rob,

damn… that was ALMOST a really good solution.
Unfortunately it’s not working with any of my UI objects.
They are buttons and ksliders… What can be done?

Thanks,
- Glot

#124006
Mar 4, 2008 at 8:24pm

It will work just fine!

#P window setfont “Sans Serif” 9.;
#P flonum 533 93 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user led 77 100 17 17 0 150;
#P objectname led;
#P user led 3 100 17 17 0 150;
#P objectname led[3];
#P user led 27 100 17 17 0 150;
#P objectname led[2];
#P user led 52 100 17 17 0 150;
#P objectname led[1];
#P window linecount 1;
#P newex 101 50 53 196617 autopattr;
#X prestore Kone 8 0 40 38 55 31 69 17 76 10;
#X prestore led 1 0 0;
#X prestore led[1] 1 0 0;
#X prestore led[2] 1 0 0;
#X prestore led[3] 1 0 1;
#P objectname u403000002;
#P number 496 93 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname number[1];
#P number 442 93 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname number;
#P message 496 126 51 196617 recall $1;
#P message 442 126 49 196617 store $1;
#P newex 442 161 67 196617 pattrstorage;
#X client_rect 20 74 660 314;
#X storage_rect 0 0 640 240;
#P objectname u061000001;
#P user kslider 101 92 54 0 36 48 31 12 1 128 128 128 128 128 128 255 255 255 0 0 0 0 0 0;
#P objectname Kone;
#P hidden fasten 6 1 4 0 120 80 447 80;
#P hidden fasten 6 1 5 0 120 80 501 80;
#P fasten 11 0 3 0 538 117 501 117;
#P connect 5 0 3 0;
#P connect 4 0 2 0;
#P fasten 3 0 1 0 501 154 447 154;
#P connect 2 0 1 0;
#P window clipboard copycount 12;

#124007
Mar 4, 2008 at 8:35pm

Mr. Leafcutter,

The kslider doesn’t recall orshow up at all in clientwindow,

The LED’s work, though.

- G

#124008
Mar 4, 2008 at 8:54pm

#124009
Mar 4, 2008 at 9:07pm

On Mar 4, 2008, at 12:35 PM, Glot wrote:
> The kslider doesn’t recall orshow up at all in clientwindow,

Works for me.

Chris Muir
cbm@well.com

#124010
Mar 4, 2008 at 9:27pm

How can I access the Buttons remotely? Regular old buttons…
So it’s working for everything except those, and it feels very odd to have the whole patch using a pattr system, but then make a special case scenario and add a ton of pvars for the Buttons only…

#124011
Mar 4, 2008 at 9:34pm

On 4 mars 08, at 22:27, Glot wrote:

> How can I access the Buttons remotely? Regular old buttons…
> So it’s working for everything except those, and it feels very odd
> to have the whole patch using a pattr system, but then make a
> special case scenario and add a ton of pvars for the Buttons only…

Could you post a small example of what you want to achieve?

ej

#124012
Mar 4, 2008 at 9:43pm

EJ,

It should be simple to describe:

I have a UI, with:
buttons, check boxes, numboxes
Each element on the UI is a named object.

Rather than make a ton of pvars, Rob posted a good solution. I can use @outputmode with pattrstorage and autopattr. This allows me to get a message from pattrstorage with the name of the object and its value.

Extending this, I have put “classnames” in front of thte object names, like naming something: group1_foo. I then use jasch’s strcut and strstr to detect the “group1_” part, remove it, and then route the message appropriately based upon its group. So it routes it based upon the start of the symbol.

The problem is that while everything is working, I can’t get messages from pattrstorage @outputmode for any of the bang buttons, because pattrstorage doesn’t support those. It makes the whole routing thing very uneven.

Hope this explains it,

- Glot

#124013
Mar 4, 2008 at 9:51pm

On Mar 4, 2008, at 1:27 PM, Glot wrote:
> How can I access the Buttons remotely? Regular old buttons…

pattr was designed to save state, and buttons don’t have a state, so I
think you’re out of luck.

Chris Muir
cbm@well.com

#124014
Mar 4, 2008 at 10:09pm

On 4 mars 08, at 22:51, Chris Muir wrote:

> pattr was designed to save state, and buttons don’t have a state, so
> I think you’re out of luck.

Exactly. If you can convert button to a state, you can make it.

ej

#P window setfont “Sans Serif” 9.;
#P number 135 253 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 188 253 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 188 288 49 196617 store $1;
#P newex 188 316 84 196617 pattrstorage titi;
#X client_rect 0 0 640 240;
#X storage_rect 0 0 640 240;
#P objectname titi;
#P newex 83 69 282 196617 spray 16;
#P message 353 124 14 196617 1;
#P message 335 124 14 196617 1;
#P message 317 124 14 196617 1;
#P message 299 124 14 196617 1;
#P message 281 124 14 196617 1;
#P message 263 124 14 196617 1;
#P message 245 124 14 196617 1;
#P message 227 124 14 196617 1;
#P message 209 124 14 196617 1;
#P message 191 124 14 196617 1;
#P message 173 124 14 196617 1;
#P message 155 124 14 196617 1;
#P message 137 124 14 196617 1;
#P message 119 124 14 196617 1;
#P message 101 124 14 196617 1;
#P message 83 124 14 196617 1;
#P newex 18 109 54 196617 pattr toto;
#X prestore 2 0 5 1;
#P objectname toto;
#P button 353 100 15 0;
#P objectname button[16];
#P button 335 100 15 0;
#P objectname button[15];
#P button 317 100 15 0;
#P objectname button[14];
#P newex 83 144 282 196617 funnel 16;
#P button 299 100 15 0;
#P objectname button[13];
#P button 281 100 15 0;
#P objectname button[12];
#P button 263 100 15 0;
#P objectname button[11];
#P button 245 100 15 0;
#P objectname button[10];
#P button 227 100 15 0;
#P objectname button[9];
#P button 209 100 15 0;
#P objectname button[8];
#P button 191 100 15 0;
#P objectname button[7];
#P button 173 100 15 0;
#P objectname button[6];
#P button 155 100 15 0;
#P objectname button[5];
#P button 137 100 15 0;
#P objectname button[4];
#P button 119 100 15 0;
#P objectname button[3];
#P button 101 100 15 0;
#P objectname button[2];
#P button 83 100 15 0;
#P objectname button[1];
#P connect 38 0 35 0;
#P connect 37 0 36 0;
#P connect 36 0 35 0;
#P connect 17 0 34 0;
#P connect 13 0 17 0;
#P connect 34 15 16 0;
#P connect 34 14 15 0;
#P connect 34 13 14 0;
#P connect 34 12 12 0;
#P connect 34 11 11 0;
#P connect 34 10 10 0;
#P connect 34 9 9 0;
#P connect 34 8 8 0;
#P connect 34 7 7 0;
#P connect 34 6 6 0;
#P connect 34 5 5 0;
#P connect 34 4 4 0;
#P connect 34 3 3 0;
#P connect 34 2 2 0;
#P connect 34 1 1 0;
#P connect 34 0 0 0;
#P connect 33 0 13 15;
#P connect 32 0 13 14;
#P connect 31 0 13 13;
#P connect 30 0 13 12;
#P connect 29 0 13 11;
#P connect 28 0 13 10;
#P connect 27 0 13 9;
#P connect 26 0 13 8;
#P connect 25 0 13 7;
#P connect 24 0 13 6;
#P connect 23 0 13 5;
#P connect 22 0 13 4;
#P connect 21 0 13 3;
#P connect 20 0 13 2;
#P connect 19 0 13 1;
#P connect 18 0 13 0;
#P connect 16 0 33 0;
#P connect 15 0 32 0;
#P connect 14 0 31 0;
#P connect 12 0 30 0;
#P connect 11 0 29 0;
#P connect 10 0 28 0;
#P connect 9 0 27 0;
#P connect 8 0 26 0;
#P connect 7 0 25 0;
#P connect 6 0 24 0;
#P connect 5 0 23 0;
#P connect 4 0 22 0;
#P connect 3 0 21 0;
#P connect 2 0 20 0;
#P connect 1 0 19 0;
#P connect 0 0 18 0;
#P window clipboard copycount 39;

#124015

You must be logged in to reply to this topic.