Small problem with Preset

May 11, 2007 at 4:34pm

Small problem with Preset

I was throwing something together this morning that was more visually driven than my former projects and ran into a problem with the Preset object.

I’m using it with the Waveform Display object and was trying to set loop points in a sample, which would be fed out to a groove~ object.
Everytime I set a loop point and store it in a cell, however, when I return to it from another cell, at times, it will not correctly trigger the right position without having to hit it twice.

It’s done this on Windows XP & Mac OSX, so I’m thinking this is a universal malady that I’m ignorant about and overlooking on these forums.

Any insight, or more efficient method, would be appreciated.

Here’s a small example to give a better idea of the problem.
You’ll, of course, have to make your own Presets.

#N vpreset 7;
#X append 1 1 6 301 150 flonum float 3839.977539 ; 5 301 77 flonum float 2773.310791 ;;
#X append 2 1 6 301 150 flonum float 1439.977417 ; 5 301 77 flonum float 266.644012 ;;
#X append 3 1 6 301 150 flonum float 2773.310791 ; 5 301 77 flonum float 1866.598755 ;;
#X append 5 1 6 301 150 flonum float 3839.977539 ; 5 301 77 flonum float 2773.310791 ;;
#X append 7 1 6 301 150 flonum float 2773.310791 ; 5 301 77 flonum float 1866.598755 ;;
#P preset 163 198 47 27;
#P window setfont Arial 10.;
#P window linecount 1;
#P hidden message 259 226 39 131137546 set $1;
#P hidden message 219 226 39 131137546 set $1;
#P flonum 150 301 58 10 0 0 0 2001 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 77 301 72 10 0 0 0 2001 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 77 316 90 131137546 groove~ example;
#P hidden message 152 226 66 131137546 set example;
#P window setfont “Sans Serif” 9.;
#P user waveform~ 77 226 200 74 3 9;
#W mode select;
#W mouseoutput continuous;
#W unit ms;
#W grid 1000.;
#W ticks 1;
#W labels 0;
#W vlabels 0;
#W vticks 0;
#W bpm 120. 4.;
#W frgb 33 0 0;
#W brgb 60 178 173;
#W rgb2 0 95 255;
#W rgb3 0 0 0;
#W rgb4 0 0 0;
#W rgb5 190 137 255;
#W rgb6 100 100 100;
#W rgb7 100 100 100;
#P window setfont Arial 10.;
#P message 77 192 31 131137546 read;
#P newex 77 208 85 131137546 buffer~ example;
#P hidden connect 6 0 4 2;
#P hidden connect 6 0 8 0;
#P hidden connect 5 0 4 1;
#P hidden connect 5 0 7 0;
#P hidden connect 9 0 5 0;
#P hidden connect 9 0 6 0;
#P hidden connect 8 0 2 3;
#P hidden connect 7 0 2 2;
#P hidden connect 2 2 5 0;
#P hidden connect 2 3 6 0;
#P hidden connect 0 1 3 0;
#P hidden connect 3 0 2 0;
#P connect 1 0 0 0;
#P window clipboard copycount 10;

#31867
May 11, 2007 at 5:01pm

Quote: daniel miller wrote on Fri, 11 May 2007 10:34
—————————————————-
> I was throwing something together …and ran into a problem with the Preset object.

I think that this would be as good a time as any to learn some
pattr. It’s not hard, and you’ll thank me later.

max v2;
#N vpatcher 41 68 873 793;
#P window setfont “Sans Serif” 18.;
#P window linecount 1;
#P comment 296 408 357 196626 interpolates between any two presets;
#P comment 170 408 131 196626 recalls stuff;
#P number 174 443 66 18 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 49 444 66 18 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 463 443 68 18 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 382 444 69 18 1 3 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 301 444 69 18 0 100 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 301 509 142 196626 prepend recall;
#P newex 301 477 173 196626 pak 1 1 0.;
#P message 174 479 86 196626 recall $1;
#P message 49 479 87 196626 store $1;
#P comment 44 408 131 196626 stores stuff;
#P window linecount 4;
#P comment 495 137 287 196626 3. Drop an autopattr object into your patch , and now you can double-click the pattrstorage to see its contents!;
#P window linecount 2;
#P comment 126 40 452 196626 1. Name any UI objects whose state you want to recall by choosing Name…. from the Object menu;
#P window linecount 1;
#P newex 493 242 124 196626 autopattr;
#X prestore float_value 1 0 24.;
#X prestore int_value 1 0 365;
#P objectname u515000001;
#P newex 46 189 227 196626 pattrstorage saveme;
#X client_rect 20 74 660 314;
#X storage_rect 0 0 640 240;
#P objectname saveme;
#P flonum 47 80 66 18 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname float_value;
#P number 47 40 66 18 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname int_value;
#P comment 145 151 287 196626 2. Add a pattrstorage object.;
#P fasten 11 0 3 0 237 591 29 591 29 173 51 173;
#P fasten 9 0 3 0 179 521 29 571 29 174 51 174;
#P fasten 8 0 3 0 54 530 29 524 29 174 51 174;
#P connect 15 0 8 0;
#P connect 16 0 9 0;
#P connect 12 0 10 0;
#P connect 10 0 11 0;
#P connect 13 0 10 1;
#P connect 14 0 10 2;
#P pop;

#104021
May 13, 2007 at 11:34am

Thanks Gregory.

The book I’m using is pre-pattr and I’m sure I abandoned the tutorials before the scripting lessons.
Guess I got too eager to get into MSP.
Now that I’ve used the pattr family I’m not sure how I ever possibly lived without them.

#104022

You must be logged in to reply to this topic.