confused about pattr

Feb 10, 2006 at 5:55am

confused about pattr

I’m working on a concerto for max/msp-processed violin & orchestra. It looks like pattr objects will make the patch much easier to interact with, but I’m having trouble wrapping my head around the whole pattr system. Here are some specifics, and any help or direction would be greatly appreciated. I’ve read help files, tutorials and references, but feel like I still don’t get it.

Basically, I want to be able to have a series of pre-sets which direct a pedal played by the vln to various control variables & set other variables to various levels in the patch & sub-patchers. As far as i can tell, pattrstorage lets me set up presets like this, and to edit them as text in XML files. Cool.

pattrhub seems to be the way to send messages to named objects, but maybe autopattr is the way to do that?? Not clear why I’d use one over the other.

And I thought autopattr and pattrhub were supposed to see all named objects, which would then be reflected in clientwindow and storagewindow of pattrstorage … but that doesn’t seem to work as I expect … some named objects show up, and some don’t.

I seem to be able to enable an object for pattr if I attach an explicit “pattr @bindto name” to an object … but I also thought that that was what autopattr did. However, I find that autopattr adds really strange names to objects I don’t anticipate it will see … and which take me quite a bit of time to search the patch for … so that I’ve turned off the @autonaming feature in autopattr, and taken to just naming object mnemonically if I want to access them via pattr.

Finally … in the examples of pattrhub & autopattr and pattrstorage (I think) these three objects all have arguments which look like buffer names, or file names … or maybe just random arguments to be cute??? I have a feeling these are meaningful, but I can’t seem to grock it.

Sorry to be so dense, but I think that if I can understand this, I’ll be home free. Of course, I can just go back the the way I’ve done this in the past and make a zillion send/receive combinations … but it looks like pattr stuff is more elegant, if I could just get a handle on it … and the ability to examine and edit the XML files looks really useful.

Thanks,
– Neil

#24364
Feb 10, 2006 at 8:41am

It’s not so difficult.

I just started playing with pattrstorage and autopattr and they are brilliant! And offer Lot’s of easy GRM style preset interpolated fun. Though interpolation on menus may not be what you want (see my patch).

As the name suggests ‘pattrstorage’ is in charge of storing and recalling information.

and ‘autopattr’ can be used to automatically name objects in the patcher.

Look at this example where some objects are excluded from the reach of ‘autopattr’. the use of ‘@autoname 1′ as the first argument to ‘autopattr’ makes it auto-name exposed objects (surprise surprise). The use of ‘yournamehere’ as the second argument refers the named objects to the pattrstorage object with the argument ‘yournamehere’.

The following should get you going, refer to each objects help file to find out more:

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P hidden comment 462 34 208 196617 exclude preset objects or you’ll get trouble!;
#P comment 367 153 82 196617 excluded objects;
#P window setfont “Sans Serif” 14.;
#P comment 664 260 23 196622 2.;
#P window setfont “Sans Serif” 9.;
#P number 812 128 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname number[1];
#P comment 700 131 106 196617 Or store your own >>;
#P newex 812 154 72 196617 prepend store;
#P comment 684 291 149 196617 interpolate between presets!;
#P user multiSlider 684 306 146 21 1. 4. 1 2936 47 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P objectname multiSlider;
#P number 592 320 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname number;
#P message 622 290 14 196617 4;
#B color 9;
#P message 603 290 14 196617 3;
#B color 9;
#P message 584 290 14 196617 2;
#B color 9;
#P message 565 290 14 196617 1;
#B color 9;
#P button 556 125 24 0;
#P newex 556 89 55 196617 loadbang;
#N vpatcher 224 114 824 514;
#P origin -38 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 4 233 72 196617 prepend store;
#P outlet 4 327 15 0;
#P window linecount 0;
#P newex 121 115 40 196617 uzi 4;
#P newex 151 163 92 196617 t i b b b b b b;
#P window linecount 1;
#P newex 235 280 58 196617 random 10;
#P outlet 235 334 15 0;
#P newex 167 280 58 196617 random 10;
#P outlet 167 334 15 0;
#P newex 97 280 58 196617 random 10;
#P outlet 97 334 15 0;
#P newex 447 281 64 196617 random 128;
#P outlet 447 335 15 0;
#P newex 379 281 64 196617 random 128;
#P outlet 379 335 15 0;
#P window linecount 0;
#P newex 309 281 64 196617 random 128;
#P outlet 309 335 15 0;
#P inlet 121 68 15 0;
#P connect 13 0 16 0;
#P connect 16 0 15 0;
#P connect 13 1 8 0;
#P connect 8 0 7 0;
#P connect 0 0 14 0;
#P connect 14 2 13 0;
#P connect 13 2 10 0;
#P connect 10 0 9 0;
#P connect 13 3 12 0;
#P connect 12 0 11 0;
#P connect 13 4 2 0;
#P connect 2 0 1 0;
#P connect 13 5 4 0;
#P connect 4 0 3 0;
#P connect 13 6 6 0;
#P connect 6 0 5 0;
#P pop;
#P newobj 556 176 100 196617 p automake_presets;
#P user gain~ 425 278 24 100 158 0 1.071519 7.94321 10.;
#P objectname gain~[2];
#P user gain~ 400 278 24 100 158 0 1.071519 7.94321 10.;
#P objectname gain~[1];
#P user gain~ 375 278 24 100 158 0 1.071519 7.94321 10.;
#P objectname gain~;
#P user ubumenu 354 248 111 196617 0 1 1 1;
#X setrgb 255 255 255 116 116 116 0 0 0 4 4 4 141 141 141 112 112 112;
#X add did;
#X add this;
#X add help;
#X add you?;
#X add OK;
#X add now;
#X add buy;
#X add a;
#X add Leafcutter;
#X add Album!;
#X prefix_set 0 0 0;
#P objectname ubumenu[3];
#P user ubumenu 354 224 111 196617 0 1 1 1;
#X setrgb 255 255 255 116 116 116 0 0 0 4 4 4 141 141 141 112 112 112;
#X add did;
#X add this;
#X add help;
#X add you?;
#X add OK;
#X add now;
#X add buy;
#X add a;
#X add Leafcutter;
#X add Album!;
#X prefix_set 0 0
0;
#P objectname ubumenu[4];
#P user ubumenu 354 201 111 196617 0 1 1 1;
#X setrgb 255 255 255 116 116 116 0 0 0 4 4 4 141 141 141 112 112 112;
#X add did;
#X add this;
#X add help;
#X add you?;
#X add OK;
#X add now;
#X add buy;
#X add a;
#X add Leafcutter;
#X add Album!;
#X prefix_set 0 0
0;
#P objectname ubumenu[6];
#P user panel 328 145 168 263;
#X brgb 255 25 25;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user gain~ 255 278 24 100 158 0 1.071519 7.94321 10.;
#P objectname gain~[5];
#P user gain~ 230 278 24 100 158 0 1.071519 7.94321 10.;
#P objectname gain~[4];
#P user gain~ 205 278 24 100 158 0 1.071519 7.94321 10.;
#P objectname gain~[3];
#P user ubumenu 184 248 111 196617 0 1 1 1;
#X setrgb 255 255 255 116 116 116 0 0 0 4 4 4 141 141 141 112 112 112;
#X add did;
#X add this;
#X add help;
#X add you?;
#X add OK;
#X add now;
#X add buy;
#X add a;
#X add Leafcutter;
#X add Album!;
#X prefix_set 0 0
0;
#P objectname ubumenu[2];
#P user ubumenu 184 224 111 196617 0 1 1 1;
#X setrgb 255 255 255 116 116 116 0 0 0 4 4 4 141 141 141 112 112 112;
#X add did;
#X add this;
#X add help;
#X add you?;
#X add OK;
#X add now;
#X add buy;
#X add a;
#X add Leafcutter;
#X add Album!;
#X prefix_set 0 0
0;
#P objectname ubumenu[1];
#P user ubumenu 184 201 111 196617 0 1 1 1;
#X setrgb 255 255 255 116 116 116 0 0 0 4 4 4 141 141 141 112 112 112;
#X add did;
#X add this;
#X add help;
#X add you?;
#X add OK;
#X add now;
#X add buy;
#X add a;
#X add Leafcutter;
#X add Album!;
#X prefix_set 0 0
0;
#P objectname ubumenu[5];
#P newex 592 367 134 196617 pattrstorage yournamehere;
#X client_rect 0 0 640 240;
#X storage_rect 0 0 640 240;
#P objectname yournamehere;
#P newex 48 75 181 196617 autopattr @autoname 1 yournamehere;
#X prestore gain~[3] 1 0 99;
#X prestore gain~[4] 1 0 57;
#X prestore gain~[5] 1 0 116;
#X prestore ubumenu[1] 1 0 0;
#X prestore ubumenu[2] 1 0 5;
#X prestore ubumenu[5] 1 0 4;
#P objectname u708000013;
#P comment 582 131 115 196617 Make 4 random presets;
#P comment 638 291 36 196617 recall;
#P window setfont “Sans Serif” 14.;
#P comment 683 100 23 196622 1.;
#P user panel 505 245 420 163;
#X brgb 255 241 173;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 504 79 420 163;
#X brgb 255 241 173;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P window setfont “Sans Serif” 9.;
#P comment 201 153 82 196617 included objects;
#P user panel 158 145 168 263;
#X brgb 97 255 25;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P fasten 32 0 8 0 817 208 877 208 877 352 597 352;
#P connect 34 0 32 0;
#P fasten 30 0 8 0 689 348 597 348;
#P fasten 22 0 8 0 561 358 597 358;
#P connect 29 0 8 0;
#P connect 28 0 29 0;
#P connect 27 0 29 0;
#P connect 26 0 29 0;
#P connect 25 0 29 0;
#P hidden fasten 22 2 10 0 591 194 189 194;
#P hidden fasten 22 2 17 0 591 194 359 194;
#P connect 24 0 22 0;
#P connect 23 0 24 0;
#P hidden fasten 22 6 14 0 651 221 260 221;
#P hidden fasten 22 6 21 0 651 221 430 221;
#P hidden fasten 22 5 13 0 636 221 235 221;
#P hidden fasten 22 5 20 0 636 221 405 221;
#P hidden fasten 22 4 12 0 621 221 210 221;
#P hidden fasten 22 4 19 0 621 221 380 221;
#P hidden fasten 22 3 11 0 606 206 189 206;
#P hidden fasten 22 3 18 0 606 206 359 206;
#P hidden fasten 22 1 9 0 576 201 189 201;
#P hidden fasten 22 1 16 0 576 183 359 183;
#P hidden fasten 7 1 34 0 110 101 484 101 484 56 817 56;
#P hidden fasten 7 1 30 0 110 109 484 109 484 54 689 54;
#P hidden fasten 7 1 29 0 110 111 470 111 470 48 597 48;
#P hidden fasten 7 1 21 0 110 138 430 138;
#P lcolor 6;
#P hidden fasten 7 1 20 0 110 138 405 138;
#P lcolor 6;
#P hidden fasten 7 1 19 0 110 138 380 138;
#P lcolor 6;
#P hidden fasten 7 1 18 0 110 131 359 131;
#P lcolor 6;
#P hidden fasten 7 1 17 0 110 125 359 125;
#P lcolor 6;
#P hidden fasten 7 1 16 0 110 119 359 119;
#P lcolor 6;
#P window clipboard copycount 38;

#70379

You must be logged in to reply to this topic.