Forums > MaxMSP

pv & pattr

November 13, 2006 | 10:15 pm

Hello

I would like to save a list with a preset slot with pattrstorage, and
have it banged out when slots are changed, yet I cant bind pv to a
pattr object. Is there an easy way to get lists into a pattrstorage
slot?

Thanks,

v a d e //

http://www.vade.info
abstrakt.vade.info


November 13, 2006 | 10:27 pm

ubumenu, textedit, pattr…

jb

Am 13.11.2006 um 23:15 schrieb vade:

> Hello
>
> I would like to save a list with a preset slot with pattrstorage,
> and have it banged out when slots are changed, yet I cant bind pv
> to a pattr object. Is there an easy way to get lists into a
> pattrstorage slot?
>
> Thanks,
>
>
> v a d e //
>
> http://www.vade.info
> abstrakt.vade.info
>
>
>


November 13, 2006 | 11:18 pm

Hrm – youve got a point, although I should have been more specific. I
want to be able to store arbitrary (read, I dont know what they will
be before hand) lists in a shitload (read quite a few) subpatchers,
in no particular/expected order, coming from "the outside world",

ubumenu I could set with prepend append, and then prepend symbol to
set the item, but it seems wasteful to keep populating ubumenu that
way (see the attached patch)

But I get the feeling I am having a brainfart and am missing
something very obvious, and will be slightly humbled by missing it.
Let me post an example patch anyway, so you can all chuckle at me

Heres an issue : if I use setitem on a ubumenu bound to a
pattr/pattrstorage system, pattrstorage doesnt update the data. Only
if I switch slots – which means I have to keep adding to the ubumenu.

pv and value and all those objects would be great to have working
with pattr, as you could set, store and recall arbitrary data with
them. Are there any ‘cleaner’ ways of doing this?

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 204 50 142 196617 somedisplayname -100 100 f;
#P comment 107 310 263 196617 note this ubu gets very large after
using for a while.;
#P message 279 446 75 196617 storagewindow;
#P message 189 446 68 196617 clientwindow;
#P window linecount 5;
#P comment 445 212 263 196617 note that setitem doesnt update the
contents/data of the pattrstorage in the client window or storage
window , and wont work with the recall system. This would be the
easier way rather than using append/symbol , and nullify the size
issue.;
#P window linecount 1;
#P newex 114 222 80 196617 prepend symbol;
#P newex 198 222 78 196617 prepend append;
#P comment 112 482 263 196617 < -I would love if pv would work , it
would be so simple…;
#P newex 216 282 89 196617 pattr ubu ubupat2;
#X prestore 1 0 "somedisplayname -100 100 f";
#P objectname ubu[2];
#P user ubumenu 113 281 100 196617 0 1 1 0;
#X add;
#X add integer 0 10 i;
#X add floating -1. 3. f;
#X add integer 0 10 i;
#X add toggle 0 10 t;
#X add integer 0 10 i;
#X add floating -1. 3. f;
#X add integer 0 10 i;
#X add toggle 0 10 t;
#X add integer 0 10 i;
#X add floating -1. 3. f;
#X add integer 0 10 i;
#X add integer 0 10 i;
#X add floating -1. 3. f;
#X add integer 0 10 i;
#X add toggle 0 10 t;
#X add floating -1. 3. f;
#X add somedisplayname -100 100 f;
#X add somedisplayname -100 100 f;
#X add somedisplayname -100 100 f;
#X add somedisplayname -100 100 f;
#X add somedisplayname -100 100 f;
#X add somedisplayname -100 100 f;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P objectname ubupat2;
#P number 400 234 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 154 416 32 196617 print;
#P objectname ubu[1];
#P message 168 367 43 196617 store 2;
#P message 217 367 14 196617 2;
#P message 218 347 14 196617 1;
#P message 169 347 43 196617 store 1;
#P newex 155 391 107 196617 pattrstorage example;
#X client_rect 42 44 682 284;
#X storage_rect 23 248 663 488;
#P objectname example;
#P newex 453 282 89 196617 pattr ubu ubupat1;
#X prestore 1 0 3;
#P objectname ubu;
#P window linecount 6;
#P comment 552 28 100 196617 pv is great because it (would) only hold
‘one’ state for ‘one’ slot , rather than a large list of items like
ubu;
#P window linecount 1;
#N vpatcher 40 104 640 504;
#P outlet 164 158 15 0;
#P inlet 165 98 15 0;
#P connect 0 0 1 0;
#P pop;
#P newobj 121 94 55 196617 p;
#P newex 334 209 91 196617 prepend setitem 0;
#P user ubumenu 332 282 100 196617 0 1 1 0;
#X add somedisplayname -100 100 f;
#X add 2;
#X add 3;
#X add 4;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P objectname ubupat1;
#P button 16 39 15 0;
#P message 205 31 68 196617 toggle 0 10 t;
#P message 131 31 72 196617 integer 0 10 i;
#P message 49 31 80 196617 floating -1. 3. f;
#P newex 16 516 32 196617 print;
#P newex 16 478 88 196617 pv slidermessage;
#P objectname vsliderMessage;
#P window linecount 10;
#P comment 362 28 187 196617 these lists set the state of other
objects in my system. They are sent by modules to initialize a
dynamic user interface. There will be many many many of them sent
during the running of the patch , and many of these items
instantiated. If I use prepend append and prepend symbol to set the
ubumenu to store these items , I fear the ubumenu and pattr will get
very bloated very quickly;
#P connect 28 0 9 0;
#P connect 9 0 1 0;
#P connect 9 0 23 0;
#P connect 9 0 22 0;
#P connect 9 0 8 0;
#P connect 25 0 12 0;
#P connect 26 0 12 0;
#P connect 22 0 19 0;
#P connect 23 0 19 0;
#P connect 18 0 7 0;
#P connect 14 0 12 0;
#P connect 15 0 12 0;
#P connect 13 0 12 0;
#P connect 16 0 12 0;
#P connect 12 0 17 0;
#P connect 8 0 7 0;
#P connect 5 0 9 0;
#P connect 4 0 9 0;
#P connect 3 0 9 0;
#P connect 6 0 1 0;
#P connect 1 0 2 0;
#P window clipboard copycount 29;

v a d e //

http://www.vade.info
abstrakt.vade.info

On Nov 13, 2006, at 5:27 PM, Jeremy Bernstein wrote:

> ubumenu, textedit, pattr…
>
> jb
>
> Am 13.11.2006 um 23:15 schrieb vade:
>
>> Hello
>>
>> I would like to save a list with a preset slot with pattrstorage,
>> and have it banged out when slots are changed, yet I cant bind pv
>> to a pattr object. Is there an easy way to get lists into a
>> pattrstorage slot?
>>
>> Thanks,
>>
>>
>> v a d e //
>>
>> http://www.vade.info
>> abstrakt.vade.info
>>
>>
>>
>


November 13, 2006 | 11:30 pm

Am 14.11.2006 um 00:18 schrieb vade:

> Heres an issue : if I use setitem on a ubumenu bound to
> a pattr/pattrstorage system, pattrstorage doesnt update the data.
> Only if I switch slots – which means I have to keep adding to the
> ubumenu.

That sounds like a bug. Will investigate.

> pv and value and all those objects would be great to have working
> with pattr, as you could set, store and recall arbitrary data with
> them. Are there any ‘cleaner’ ways of doing this?

Just use an unbound pattr object. It’s all that you need, unless I am
catastophically misunderstanding your problem.

jb


November 13, 2006 | 11:53 pm

Remember how I said I thought I was missing the obvious? I was.
Thanks Jeremy. Brilliant. All is well with the cosmos now :)

v a d e //

http://www.vade.info
abstrakt.vade.info

On Nov 13, 2006, at 6:30 PM, Jeremy Bernstein wrote:

> Just use an unbound pattr object. It’s all that you need, unless I
> am catastophically misunderstanding your problem.


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