Forums > MaxMSP

Interp individual pattrstorage elements

December 20, 2007 | 8:11 am

Is it possible to interpolate between presets, but only grabbing individual values?

getstoredvalue only gets exact preset values.

I’m using pattrstorage to initialize a bunch of values and lists, but then I want to interpolate only one of those elements (a big list) without affecting the other values. I could use a preset object to initialize the other data, but that seems a bit inelegant…


December 20, 2007 | 10:06 am

Quote: arne wrote on Thu, 20 December 2007 00:11
—————————————————-
> Is it possible to interpolate between presets, but only grabbing individual values?
>

Two options are to use pattrstorage’s active message, or to divide up the values into subpatchers which each have their own pattrstorage that can interpolate independently. The active message approach seems cleaner.

Here’s an idea of how things would work with the active message. If it’s managing a lot of values it could use an abstraction or javascript to help manage things.

-Adam

#P button 152 62 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 152 39 48 196617 loadbang;
#P comment 270 171 106 196617 interpolate group 2;
#P comment 259 121 97 196617 interpolate group 1;
#P message 250 191 161 196617 active int[3] $1 , active int[4] $1;
#P message 237 144 161 196617 active int[1] $1 , active int[2] $1;
#P toggle 250 168 15 0;
#P toggle 237 119 15 0;
#P comment 296 244 51 196617 group 2;
#P flonum 135 160 35 9 1. 2. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 2;
#P message 200 75 235 196617 int[1] 0 , int[2] 0 , int[3] 0 , int[4] 0 , store 1 , int[1] 10 , int[2] 20 , int[3] 30 , int[4] 40 , store 2;
#P window linecount 1;
#P newex 341 35 53 196617 autopattr;
#X prestore int[1] 1 0 10;
#X prestore int[2] 1 0 20;
#X prestore int[3] 1 0 30;
#X prestore int[4] 1 0 40;
#P objectname u783000046;
#P newex 200 222 67 196617 pattrstorage;
#X client_rect 20 74 660 314;
#X storage_rect 0 0 640 240;
#P objectname u443000045;
#P number 327 268 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname int[4];
#P number 282 268 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname int[3];
#P number 174 268 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname int[2];
#P number 128 268 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname int[1];
#P comment 135 240 51 196617 group 1;
#P comment 65 161 62 196617 interpolate:;
#P window linecount 3;
#P comment 52 40 91 196617 click to initialize if pasting into a patcher window:;
#P connect 18 0 19 0;
#P connect 19 0 9 0;
#P connect 9 0 7 0;
#P connect 10 0 7 0;
#P connect 14 0 7 0;
#P connect 15 0 7 0;
#P connect 19 0 12 0;
#P connect 12 0 14 0;
#P connect 19 0 13 0;
#P connect 13 0 15 0;
#P window clipboard copycount 20;



jln
December 20, 2007 | 10:14 am


December 20, 2007 | 10:20 am

Quote: jln wrote on Thu, 20 December 2007 02:14
—————————————————-
> Indeed this would be inelegant to say the least. The ‘recall’ message
> can take a symbol as argument specifying a client name. From
> Pattrstorage help :
>

Rereading Arne’s post, this is clearly a better suggestion. I use the active message for interpolation of arbitrary subsets of values. I don’t think there’s a single pattrstorage message that can do that, right?

-Adam



jln
December 20, 2007 | 10:56 am


December 20, 2007 | 6:00 pm

Quote: jln wrote on Thu, 20 December 2007 02:56
—————————————————-
> My guess is that activate/de-activate
> groups of objects will potentially introduce errors more easily than
> sending ‘recall object’ for each member of a group when managing
> different groups with an external controler for example. At least, if
> interpolation messages are to interfere each other, errors should be
> less noticeable when using "recall object". But this is only
> speculation. How fine does the "activate option" work for you ?
>

I’ve only experimented with it briefly and haven’t used this approach in any big patches so I can’t say for sure.

I want to have a bunch of independent interpolation for various groups of values in my patch. Using my approach, each interpolation control would need to send an active on/off message for every value each time it is changed (or at least each time it is changed after a different interpolation control is changed). It seems much easier to send the correct sequence of recall messages like you were thinking. This isn’t much different than Arne’s original question, it just uses multiple recall messages.

My example patch above is actually a different use case – when you want to turn on and off interpolation groups on the fly. I’m not sure where I would actually want to use that capability though.

Patches speak louder than words. Compare this with the other patch I posted. I like this much better:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 246 165 157 196617 recall int[3] $1 , recall int[4] $1;
#P flonum 246 138 35 9 1. 2. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 2;
#P comment 290 135 62 196617 interpolate group 2;
#P window linecount 1;
#P message 31 156 157 196617 recall int[1] $1 , recall int[2] $1;
#P button 200 52 15 0;
#P newex 200 29 48 196617 loadbang;
#P comment 332 249 51 196617 group 2;
#P flonum 31 130 35 9 1. 2. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 2;
#P message 200 75 235 196617 int[1] 0 , int[2] 0 , int[3] 0 , int[4] 0 , store 1 , int[1] 10 , int[2] 20 , int[3] 30 , int[4] 40 , store 2;
#P window linecount 1;
#P newex 341 35 53 196617 autopattr;
#X prestore int[1] 1 0 0;
#X prestore int[2] 1 0 0;
#X prestore int[3] 1 0 0;
#X prestore int[4] 1 0 0;
#P objectname u337000002;
#P newex 200 222 67 196617 pattrstorage;
#X client_rect 20 74 660 314;
#X storage_rect 0 0 640 240;
#P objectname u857000001;
#P number 363 273 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname int[4];
#P number 318 273 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname int[3];
#P number 118 270 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname int[2];
#P number 72 270 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname int[1];
#P comment 79 242 51 196617 group 1;
#P window linecount 2;
#P comment 71 129 62 196617 interpolate group 1;
#P window linecount 3;
#P comment 100 30 91 196617 click to initialize if pasting into a patcher window:;
#P connect 10 0 14 0;
#P connect 12 0 13 0;
#P connect 13 0 9 0;
#P connect 17 0 7 0;
#P connect 14 0 7 0;
#P connect 9 0 7 0;
#P connect 16 0 17 0;
#P window clipboard copycount 18;

-Adam


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