Forums > MaxMSP

ubumenu and pattrstorage

March 27, 2006 | 5:04 am

Hi guys/girls…

I’m fairly new to the workings of Pattrstorage and its associated objects and am running into a problem getting it to function how I would like with ubumenu.

I am using ubumenu to store a list of file paths in several seperate patchers. Instead of having to manually save each ubumenu file I would like to do it in one fell swoop which will probably entail pattrstorage. Ideally I would like pattrstorage to represent exactly what is in my ubumenus, that is if I remove or add an index or clear the an entire list of items within ubumenu pattrstorage will represent this change. But… pattr seems to only "see" the value of the current index and not the others in the ubemenu and therefore can only be updated one item at a time. This is a pain and makes it difficult to sync the two objects…

Can I get around this and achieve my desired result? Do I have to resort to all sorts of data manipulation chaos at the hands of coll? Am I missing or misunderstanding something? HELP!


March 27, 2006 | 8:37 am

Maybe I’m misunderstanding the problem, but you want pattrstorage to
remember _all_ of the values in the ubumenu? Or you want pattrstorage to
remember the item in the ubumenu based on its name, rather than on its
index. If the latter, send the message "pattrmode 1" to ubumenu. If the
former, you’ll need to use a coll or something to back up the contents
of your menu. pattrstorage won’t do what you want here.

jb


March 27, 2006 | 4:08 pm

I was trying to describe the 1st situation you mentioned…

I was affraid that is what the answer would be. Any idea of whether pattrstorage will ever be able to store data structures or lists or things of that sort or is coll the dedicated alternative?? Would this be too much to ask computationally speaking?

Thanks Jeremy!


March 27, 2006 | 8:22 pm

It has nothing to do with pattrstorage’s storage capabilities, but
rather with this abstract notion of "value". The "value" of an ubumenu
is not the list, but the item in the list (whether by index, in the case
of a static list, or by name, in the case of a more dynamic one). If
someone were to make a menu object, for which the "value" were defined
as the list itself, pattr/storage could handle it.

For now, I would make friends with coll.

jb


March 27, 2006 | 11:42 pm

Gotcha…coll it is!


March 28, 2006 | 4:15 pm

Here is one idea….. haven’t finished it completely, but it could easily be made functional…. it remembers only the items in the menu at this point….

you could make the last item in the array ‘the currently selected item’….then it would do what you wan’t (i guess:-)

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 91 83 49 196617 border 1;
#P newex 284 300 32 196617 print;
#N vpatcher 602 211 1172 819;
#P window setfont "Sans Serif" 9.;
#P window linecount 2;
#P comment 74 551 100 196617 to ubumenu;
#P comment 92 46 100 196617 evaluated item selected from menu (middle outlet);
#P outlet 226 546 15 0;
#P window linecount 1;
#P message 343 402 33 196617 clear;
#P newex 375 353 58 196617 sel ___not;
#P objectname u153000012[1];
#P newex 135 414 62 196617 prepend set;
#P newex 135 388 36 196617 zl reg;
#P newex 314 425 78 196617 prepend append;
#P newex 244 435 50 196617 deferlow;
#P newex 244 468 66 196617 gate;
#P newex 314 378 39 196617 t l b;
#P objectname u153000012;
#P newex 314 402 25 196617 iter;
#P button 50 89 15 0;
#P newex 375 331 106 196617 pattr @autorestore 0;
#X prestore 1 0 0;
#P objectname u903000020;
#P newex 314 292 67 196617 zl group 256;
#P message 143 207 14 196617 1;
#P newex 194 112 106 196617 t b 2 ___not 0;
#P newex 226 266 47 196617 gate 2 1;
#P newex 160 208 27 196617 – 1;
#P newex 118 158 44 196617 uzi 256;
#P inlet 76 46 15 0;
#P inlet 263 246 15 0;
#P outlet 76 534 15 0;
#P comment 383 291 100 196617 make an array from the items in ubumenu;
#P window linecount 0;
#P comment 243 546 100 196617 evaluated item selected from menu;
#P connect 4 0 12 0;
#P connect 4 0 2 0;
#P connect 15 0 2 0;
#P connect 6 0 2 0;
#P connect 19 0 2 0;
#P connect 8 0 5 0;
#P connect 5 1 18 0;
#P connect 18 0 19 0;
#P connect 5 1 9 0;
#P connect 5 2 6 0;
#P connect 7 0 18 1;
#P connect 12 0 8 0;
#P connect 9 0 7 0;
#P connect 8 1 7 0;
#P connect 7 0 22 0;
#P connect 9 0 16 0;
#P connect 16 0 15 0;
#P connect 8 3 15 0;
#P connect 3 0 7 1;
#P connect 17 0 15 1;
#P connect 21 0 15 1;
#P connect 5 1 10 0;
#P connect 7 1 10 0;
#P fasten 20 1 14 0 428 373 319 373;
#P connect 14 0 13 0;
#P connect 13 0 17 0;
#P connect 14 1 21 0;
#P connect 20 0 21 0;
#P connect 8 2 11 0;
#P connect 10 0 11 0;
#P connect 11 0 20 0;
#P pop;
#P newobj 235 265 59 196617 p pattr ubu;
#P objectname "sub patch";
#P message 172 187 33 196617 clear;
#P newex 91 161 51 196617 strippath;
#P newex 91 185 78 196617 prepend append;
#P message 527 283 42 196617 store 3;
#B color 2;
#P message 390 327 14 196617 3;
#B color 9;
#P message 371 327 14 196617 2;
#B color 9;
#P message 352 327 14 196617 1;
#B color 9;
#P message 479 283 42 196617 store 2;
#B color 2;
#P message 432 283 42 196617 store 1;
#B color 2;
#P newex 338 378 168 196617 pattrstorage storage @savemode 0;
#B color 5;
#X client_rect 50 44 986 172;
#X storage_rect 0 0 640 240;
#P objectname storage;
#P user ubumenu 229 228 121 196617 0 1 1 0;
#X add "plipper 02.wav";
#X add "plipper 01.wav";
#X add PlatiSD#05.11Mono.wav;
#X add PlatiSD#02.3Mono.wav;
#X add PlatiSD#02.3.wav;
#X prefix_set 0 0 0;
#P user dropfile 91 104 200 152 1;
#P connect 14 0 0 0;
#P connect 12 1 13 0;
#P fasten 12 0 1 0 240 286 216 286 216 218 234 218;
#P connect 11 0 12 0;
#P connect 9 0 12 0;
#P connect 1 1 12 1;
#P connect 10 0 9 0;
#P connect 0 0 10 0;
#P fasten 3 0 2 0 437 303 343 303;
#P fasten 4 0 2 0 484 303 343 303;
#P fasten 6 0 2 0 376 353 343 353;
#P fasten 5 0 2 0 357 353 343 353;
#P fasten 7 0 2 0 395 353 343 353;
#P fasten 8 0 2 0 532 303 343 303;
#P window clipboard copycount 15;


March 28, 2006 | 10:08 pm

looks interesting, but I couldn’t get your text into a patcher.


March 29, 2006 | 12:23 am

Just copy the text…. goto the maxMSP menubar and select ‘New From Clipboard’……


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