Forums > MaxMSP

Better bucket

November 29, 2006 | 4:25 am

Say that 3 times fast!

Tired of remaking my bucket/pack combos to creating "moving" lists (lists of a specified length where the newest value kicks out the oldest value in a list), I made a little abstraction using varies flavors of zl. Thought I’d share it with the group. It’s meant to be an abstraction…argument specifies the size of the list (the size of your bucket). Reset message clears the list. Connect to mean, minimum, maximum, any of the great Lobjects…whatever you like :)

Best,
David

max v2;
#N vpatcher 117 122 500 520;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 62 65 48 196617 t zlclear;
#P newex 62 45 61 196617 route reset;
#P newex 198 238 44 196617 zl rot 1;
#P newex 198 265 51 196617 zl slice 1;
#N comlet the list;
#P outlet 130 325 15 0;
#N comlet number to add to list;
#P inlet 62 24 15 0;
#P newex 113 87 58 196617 zl join;
#P newex 130 298 27 196617 t l l;
#P newex 130 190 27 196617 + 1;
#P newex 130 214 78 196617 gate 2;
#P newex 130 169 65 196617 > $1;
#P newex 130 144 34 196617 zl len;
#P newex 113 122 27 196617 t l l;
#P connect 7 0 11 0;
#P connect 11 0 12 0;
#P fasten 12 0 6 0 67 85 118 85;
#P connect 11 1 6 0;
#P connect 6 0 0 0;
#P connect 0 1 1 0;
#P connect 1 0 2 0;
#P connect 2 0 4 0;
#P connect 4 0 3 0;
#P fasten 9 1 5 0 244 290 135 290;
#P connect 3 0 5 0;
#P connect 5 0 8 0;
#P fasten 5 1 6 1 152 325 214 325 214 83 166 83;
#P fasten 0 0 3 1 118 210 203 210;
#P connect 3 1 10 0;
#P connect 10 0 9 0;
#P pop;


December 1, 2006 | 1:41 pm

here’s the abstraction i made while developing my [streamlist] external.
i find it interesting to compare patching styles…

cheers

/*j

On 29 Nov 2006, at 05:25, David Beaudry wrote:
>
> Say that 3 times fast!
>
> Tired of remaking my bucket/pack combos…..

save as circbuf.mxb

max v2;
#N vpatcher 397 107 859 585;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 196 57 97 196617 max 256 , default 0;
#B frgb 134 134 134;
#P comment 63 57 129 196617 argument: length of buffer;
#B frgb 134 134 134;
#P comment 37 41 224 196617 circular buffer for ints , floats ,
lists , anythings;
#B frgb 134 134 134;
#P comment 332 416 85 196617 jasch 20061201;
#B frgb 134 134 134;
#N comlet circular buffer output;
#P outlet 143 381 15 0;
#P newex 143 206 121 196617 gate 2 1;
#P newex 120 206 21 196617 t 2;
#P newex 143 171 57 196617 t 1 zlclear;
#P newex 199 234 22 196617 b 1;
#P newex 190 265 36 196617 zl reg;
#P newex 143 133 122 196617 route reset length bang;
#N comlet , ,

, -> msg: reset ,
length #1;
#P inlet 143 100 15 0;
#P newex 143 323 127 196617 zl slice $1;
#P newex 190 293 79 196617 prepend ;
#P newex 254 266 62 196617 prepend set;
#P connect 9 0 8 0;
#P connect 3 0 4 0;
#P connect 4 0 7 0;
#P connect 7 0 9 0;
#P connect 8 0 9 0;
#P connect 9 0 2 0;
#P connect 4 2 2 0;
#P connect 1 0 2 0;
#P connect 2 0 10 0;
#P connect 7 1 5 0;
#P connect 6 0 5 0;
#P connect 0 0 1 0;
#P connect 5 0 1 0;
#P connect 9 1 6 0;
#P fasten 2 0 5 1 148 354 339 354 339 253 221 253;
#P connect 4 3 9 1;
#P connect 9 1 0 0;
#P fasten 4 1 2 1 185 159 326 159 326 319 265 319;
#P pop;

save as circbuf.help

max v2;
#N vpatcher 253 70 846 605;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 201 62 97 196617 max 256 , default 0;
#B frgb 134 134 134;
#P comment 68 62 129 196617 argument: length of buffer;
#B frgb 134 134 134;
#P comment 42 46 224 196617 circular buffer for ints , floats ,
lists , anythings;
#B frgb 134 134 134;
#P comment 431 46 85 196617 jasch 20061201;
#B frgb 134 134 134;
#N vpatcher 10 59 610 459;
#P window setfont "Sans Serif" 9.;
#P newex 50 107 65 196617 * 3.141593;
#P newex 50 126 23 196617 cos;
#P newex 50 88 40 196617 / 127.;
#P newex 50 50 51 196617 metro 20;
#N counter 0 256;
#X flags 0 0;
#P newobj 50 69 74 196617 counter 0 256;
#P inlet 50 30 15 0;
#P outlet 50 148 15 0;
#P connect 1 0 3 0;
#P connect 3 0 2 0;
#P connect 2 0 4 0;
#P connect 4 0 6 0;
#P connect 6 0 5 0;
#P connect 5 0 0 0;
#P pop;
#P newobj 64 107 53 196617 p animate;
#P user multiSlider 64 234 453 225 -1.05 1.05 16 2681 0 0 0 2 0 20 1;
#M frgb 75 255 86;
#M brgb 210 91 4;
#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 toggle 48 108 15 0;
#P number 161 166 40 9 1 256 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 161 182 52 196617 length $1;
#P message 126 182 34 196617 reset;
#P flonum 64 136 38 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 77 156 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 64 204 51 196617 circbuf 8;
#P button 89 173 15 0;
#P connect 7 0 9 0;
#P connect 9 0 3 0;
#P connect 0 0 1 0;
#P connect 2 0 1 0;
#P connect 3 0 1 0;
#P fasten 5 0 1 0 166 200 69 200;
#P fasten 4 0 1 0 131 200 69 200;
#P connect 1 0 8 0;
#P connect 6 0 5 0;
#P pop;


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