Forums > MaxMSP

How do I get the following pattern of numbers into coll using a variant of this patch?

February 12, 2008 | 5:02 pm

I’m after this pattern which will be then fed into the multislider object in order to drive a re-trigger type effect.

The pattern im after will start at 1 and jump in stages of 4 creating groups of the same number up to the number selected at the top.

E.g Press 16 and I get

1,1,1,1 5,5,5,5 9,9,9,9 13,13,13,13 16,16,16,16

Therefore there will be 16 individual numbers but equally grouped in increments 4.

I hope this makes sense:

max v2;
#N vpatcher 24 74 636 632;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 172 231 124 196617 if $i1 == $i2 then $i1;
#P newex 172 355 97 196617 v RetriggerCounter;
#P newex 172 257 40 196617 t i b i;
#P newex 172 328 40 196617 uzi 4;
#P message 126 391 33 196617 clear;
#N coll ;
#P newobj 172 416 53 196617 coll;
#P newex 171 145 38 196617 del 10;
#P newex 171 114 128 196617 t b b i i i 1;
#P message 206 59 31 196617 256.;
#P message 125 60 31 196617 128.;
#P message 92 60 23 196617 64.;
#P button 214 182 15 0;
#P newex 172 390 46 196617 zl group;
#P newex 172 185 40 196617 uzi 512;
#P newex 219 258 27 196617 + 4;
#P button 172 164 15 0;
#P message 60 60 23 196617 32.;
#N counter 1 512;
#X flags 0 0;
#P newobj 172 205 95 196617 counter 1 512;
#P window linecount 3;
#P comment 224 419 335 196617 I’m after 1111… 5555…. 9999… 13131313… 17171717 etc (up to number picked at the top where the group size should be determined by the uzi above the v RetriggerCounter object);
#P connect 10 0 11 0;
#P connect 9 0 11 0;
#P connect 8 0 11 0;
#P connect 2 0 11 0;
#P connect 11 0 12 0;
#P connect 12 0 3 0;
#P connect 3 0 5 0;
#P connect 5 0 1 0;
#P connect 1 0 18 0;
#P connect 18 0 16 0;
#P fasten 16 1 15 0 192 306 177 306;
#P connect 15 0 17 0;
#P fasten 16 2 17 0 207 317 217 317 217 351 177 351;
#P connect 17 0 6 0;
#P connect 6 0 13 0;
#P connect 14 0 13 0;
#P fasten 11 4 5 1 268 173 207 173;
#P fasten 11 3 6 1 245 154 274 154 274 380 213 380;
#P fasten 11 1 7 0 199 138 219 138;
#P connect 7 0 1 2;
#P fasten 16 0 4 0 177 292 255 292 255 252 224 252;
#P fasten 11 2 1 4 222 142 261 142;
#P connect 11 5 18 1;
#P fasten 4 0 18 1 224 282 266 282 266 228 291 228;
#P pop;

Thanks,

Rhys


February 12, 2008 | 7:38 pm

Do you have Peter Elsea’s list objects?

On 2/12/08 12:02 PM, "Rhys Perkins" wrote:

>
> I’m after this pattern which will be then fed into the multislider object in
> order to drive a re-trigger type effect.
>
> The pattern im after will start at 1 and jump in stages of 4 creating groups
> of the same number up to the number selected at the top.
>
> E.g Press 16 and I get
>
> 1,1,1,1 5,5,5,5 9,9,9,9 13,13,13,13 16,16,16,16
>
> Therefore there will be 16 individual numbers but equally grouped in
> increments 4.
>
> I hope this makes sense:
>
> max v2;
> #N vpatcher 24 74 636 632;
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P newex 172 231 124 196617 if $i1 == $i2 then $i1;
> #P newex 172 355 97 196617 v RetriggerCounter;
> #P newex 172 257 40 196617 t i b i;
> #P newex 172 328 40 196617 uzi 4;
> #P message 126 391 33 196617 clear;
> #N coll ;
> #P newobj 172 416 53 196617 coll;
> #P newex 171 145 38 196617 del 10;
> #P newex 171 114 128 196617 t b b i i i 1;
> #P message 206 59 31 196617 256.;
> #P message 125 60 31 196617 128.;
> #P message 92 60 23 196617 64.;
> #P button 214 182 15 0;
> #P newex 172 390 46 196617 zl group;
> #P newex 172 185 40 196617 uzi 512;
> #P newex 219 258 27 196617 + 4;
> #P button 172 164 15 0;
> #P message 60 60 23 196617 32.;
> #N counter 1 512;
> #X flags 0 0;
> #P newobj 172 205 95 196617 counter 1 512;
> #P window linecount 3;
> #P comment 224 419 335 196617 I’m after 1111… 5555…. 9999… 13131313…
> 17171717 etc (up to number picked at the top where the group size should be
> determined by the uzi above the v RetriggerCounter object);
> #P connect 10 0 11 0;
> #P connect 9 0 11 0;
> #P connect 8 0 11 0;
> #P connect 2 0 11 0;
> #P connect 11 0 12 0;
> #P connect 12 0 3 0;
> #P connect 3 0 5 0;
> #P connect 5 0 1 0;
> #P connect 1 0 18 0;
> #P connect 18 0 16 0;
> #P fasten 16 1 15 0 192 306 177 306;
> #P connect 15 0 17 0;
> #P fasten 16 2 17 0 207 317 217 317 217 351 177 351;
> #P connect 17 0 6 0;
> #P connect 6 0 13 0;
> #P connect 14 0 13 0;
> #P fasten 11 4 5 1 268 173 207 173;
> #P fasten 11 3 6 1 245 154 274 154 274 380 213 380;
> #P fasten 11 1 7 0 199 138 219 138;
> #P connect 7 0 1 2;
> #P fasten 16 0 4 0 177 292 255 292 255 252 224 252;
> #P fasten 11 2 1 4 222 142 261 142;
> #P connect 11 5 18 1;
> #P fasten 4 0 18 1 224 282 266 282 266 228 291 228;
> #P pop;
>
> Thanks,
>
> Rhys

Cheers,
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


February 12, 2008 | 7:50 pm

If they’re the free ones that he created, then yes, I do.

Rhys


February 12, 2008 | 8:03 pm

Then try these…

#P window setfont "Sans Serif" 9.;
#P number 180 118 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 369 127 49 196617 Lchunk 2;
#P newex 369 153 45 196617 unpack;
#P newex 369 184 45 196617 Lrepeat;
#P newex 306 213 73 196617 Lbuild;
#P newex 306 92 137 196617 t b l clear;
#P message 306 68 109 196617 1 3 5 7 9 2 13 4 16 5;
#P newex 306 237 32 196617 print;
#P newex 44 207 103 196617 Lbuild;
#P newex 44 92 196 196617 t b l clear;
#P newex 137 117 25 196617 iter;
#P message 44 68 64 196617 1 5 9 13 16;
#P newex 44 234 32 196617 print;
#P newex 137 141 53 196617 Lrepeat 4;
#P comment 44 49 166 196617 list with fixed repetiotion number;
#P comment 306 47 119 196617 list of pairs – val/rep#;
#P connect 13 1 12 1;
#P connect 12 0 11 1;
#P connect 13 0 12 0;
#P connect 14 0 13 0;
#P connect 10 1 14 0;
#P connect 11 0 8 0;
#P connect 10 0 11 0;
#P fasten 10 2 11 0 437 119 311 119;
#P connect 9 0 10 0;
#P connect 15 0 2 1;
#P connect 2 0 7 1;
#P connect 5 0 2 0;
#P connect 6 1 5 0;
#P connect 7 0 3 0;
#P fasten 6 2 7 0 235 181 49 181;
#P connect 6 0 7 0;
#P connect 4 0 6 0;
#P window clipboard copycount 16;

Cheers,
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson

On 2/12/08 2:50 PM, "Rhys Perkins" wrote:

>
> If they’re the free ones that he created, then yes, I do.
>
> Rhys


February 13, 2008 | 12:59 am

Thanks very much…that worked a treat!


February 22, 2008 | 10:11 pm

Sounds like you have it solved, but it was an interesting problem to tinker with, and could come in handy since it’s a flexible system — different numbers can get selected, and there could be a different number of repeated elements in each coll index. Nice for (say) repeated notes, or maybe matrix cell data.

Here’s another solution:

————————

#P window setfont "Sans Serif" 12.;
#P window linecount 1;
#P comment 379 272 100 9109516 arbitrary limit;
#P window setfont "Sans Serif" 10.;
#P window linecount 2;
#P comment 371 214 214 9109514 could have ($i1 % $i2 == $i3) also , for different modulus;
#P window setfont Impact 18.;
#P number 125 203 46 18 1 99 3 179 255 255 255 0 0 0 222 222 222 0 0 0;
#P number 350 147 46 18 1 0 1 179 255 255 255 0 0 0 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 214 104 72 9109513 speedlim 20;
#P hidden newex 67 116 43 9109513 t b 1 4;
#P window setfont "Sans Serif" 18.;
#P comment 111 71 65 9109522 INIT;
#P button 67 67 39 0;
#P window setfont "Sans Serif" 10.;
#P window linecount 2;
#P comment 62 171 140 9109514 change to alter how many are stored in each index;
#P comment 371 178 140 9109514 change to alter pattern of accepted numbers;
#P window setfont "Sans Serif" 12.;
#P window linecount 1;
#P comment 210 48 301 9109516 max approx. 4000 (counter max * 4);
#P window setfont "Sans Serif" 10.;
#P window linecount 2;
#P comment 468 76 100 9109514 anyone know what this does for uzi?;
#P window setfont "Sans Serif" 18.;
#P window linecount 1;
#P message 340 422 80 9109522 wclose;
#P message 254 422 69 9109522 open;
#P window setfont "Sans Serif" 12.;
#P comment 282 306 254 9109516 coll data — groups of this number;
#P window setfont "Sans Serif" 18.;
#P message 230 299 45 9109522 165;
#P window setfont "Sans Serif" 9.;
#P message 230 271 41 9109513 set $1;
#P message 254 369 41 9109513 set $1;
#P newex 230 392 61 9109513 prepend 1;
#N counter 1 999;
#X flags 0 0;
#P newobj 291 271 82 9109513 counter 1 999;
#P newex 198 342 59 9109513 zl group 4;
#P message 420 108 40 9109513 in1 $1;
#P window setfont Impact 18.;
#P number 418 77 46 18 1 0 1 179 255 255 255 0 0 0 222 222 222 0 0 0;
#P window setfont "Sans Serif" 18.;
#P message 127 422 70 9109522 clear;
#N coll ;
#P newobj 225 461 75 9109522 coll;
#P window setfont "Sans Serif" 9.;
#P newex 215 204 40 9109513 t b i b;
#P newex 177 237 40 9109513 uzi 4;
#P newex 215 179 150 9109513 if ($i1 % $i2 == 1) then $i1;
#P newex 214 128 53 9109513 t b i b b;
#P newex 214 153 40 9109513 uzi 1;
#P window setfont Impact 18.;
#P number 214 74 67 18 1 0 1 179 255 255 255 0 0 0 222 222 222 0 0 0;
#P window setfont "Sans Serif" 12.;
#P comment 303 368 100 9109516 coll index;
#P hidden connect 24 0 26 0;
#P hidden connect 26 2 29 0;
#P fasten 3 3 8 0 38 147;
#P hidden connect 26 0 8 0;
#P connect 6 0 5 0;
#P connect 16 0 11 0;
#P connect 29 0 5 1;
#P lcolor 2;
#P hidden connect 26 1 1 0;
#P connect 1 0 27 0;
#P connect 27 0 3 0;
#P connect 3 0 2 0;
#P connect 2 2 4 0;
#P connect 4 0 6 0;
#P connect 8 0 7 0;
#P connect 13 0 7 0;
#P connect 18 0 7 0;
#P connect 19 0 7 0;
#P connect 6 1 15 0;
#P connect 15 0 16 0;
#P connect 5 0 16 0;
#P connect 14 0 13 0;
#P connect 11 0 13 0;
#P connect 3 1 2 1;
#P connect 29 0 11 1;
#P lcolor 2;
#P connect 12 0 14 0;
#P connect 6 2 12 0;
#P connect 3 2 12 2;
#P hidden connect 26 2 28 0;
#P connect 28 0 4 1;
#P connect 9 0 10 0;
#P window clipboard copycount 32;


February 22, 2008 | 10:32 pm

I posted too hasty ;)

This is much better, give it a try… offsets, scalar, etc. Could be useful.

——————————–

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P hidden newex 364 273 27 9109513 b;
#P window setfont "Sans Serif" 18.;
#P message 396 269 59 9109522 reset;
#P window setfont "Sans Serif" 12.;
#P comment 385 204 166 9109516 after changes , re-bang;
#P comment 311 402 254 9109516 read-only , forced into integer values;
#P window setfont "Sans Serif" 18.;
#P number 231 384 69 18 0 0 160 139 255 255 255 99 99 99 222 222 222 0 0 0;
#P noclick;
#P flonum 268 300 59 18 0 0 0 139 255 255 255 0 0 0 222 222 222 0 0 0;
#P window setfont "Sans Serif" 12.;
#P comment 359 307 112 9109516 multiplier;
#P window setfont "Sans Serif" 18.;
#P message 334 300 20 9109522 1;
#P window setfont "Sans Serif" 9.;
#P newex 236 304 27 9109513 * 1.;
#P window setfont "Sans Serif" 18.;
#P message 336 233 20 9109522 0;
#P window setfont "Sans Serif" 12.;
#P comment 359 240 112 9109516 additive offset;
#P window setfont "Sans Serif" 18.;
#P number 268 235 59 18 0 0 0 139 255 255 255 0 0 0 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#P newex 236 241 27 9109513 + 0;
#P button 214 30 39 0;
#P window setfont "Sans Serif" 10.;
#P comment 386 347 100 9109514 arbitrary limit;
#P window setfont "Sans Serif" 18.;
#P number 125 203 46 18 1 64 3 139 255 255 255 0 0 0 222 222 222 0 0 0;
#P number 350 147 46 18 1 0 1 139 255 255 255 0 0 0 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#P newex 214 108 72 9109513 speedlim 20;
#P hidden newex 67 116 43 9109513 t b 1 4;
#P window setfont "Sans Serif" 18.;
#P comment 111 71 65 9109522 INIT;
#P button 67 67 39 0;
#P window setfont "Sans Serif" 10.;
#P window linecount 2;
#P comment 69 168 140 9109514 change to alter how many are stored in each index;
#P comment 406 146 140 9109514 change to alter pattern of accepted numbers;
#P window setfont "Sans Serif" 12.;
#P window linecount 1;
#P comment 292 81 193 9109516 max 4000 (counter max * 4);
#P window setfont "Sans Serif" 10.;
#P window linecount 2;
#P comment 499 37 100 9109514 anyone know what this does for uzi?;
#P window setfont "Sans Serif" 18.;
#P window linecount 1;
#P message 340 497 80 9109522 wclose;
#P message 254 497 69 9109522 open;
#P window setfont "Sans Serif" 12.;
#P comment 311 381 254 9109516 coll data — groups of this number;
#P window setfont "Sans Serif" 9.;
#P message 230 346 41 9109513 set $1;
#P message 254 444 41 9109513 set $1;
#P newex 230 467 61 9109513 prepend 1;
#N counter 1 1000;
#X flags 0 0;
#P newobj 291 346 88 9109513 counter 1 1000;
#P newex 178 420 59 9109513 zl group 4;
#P message 520 103 40 9109513 in1 $1;
#P window setfont "Sans Serif" 18.;
#P number 518 72 46 18 1 0 1 139 255 255 255 0 0 0 222 222 222 0 0 0;
#P message 127 497 70 9109522 clear;
#N coll ;
#P newobj 225 536 75 9109522 coll;
#P window setfont "Sans Serif" 9.;
#P newex 215 204 40 9109513 t b i b;
#P newex 177 237 40 9109513 uzi 4;
#P newex 215 179 150 9109513 if ($i1 % $i2 == 0) then $i1;
#P newex 214 129 53 9109513 t b i b b;
#P newex 214 153 40 9109513 uzi 1;
#P window setfont "Sans Serif" 24.;
#P number 214 74 74 24 1 4000 3 139 255 255 255 0 0 0 222 222 222 0 0 0;
#P window setfont "Sans Serif" 12.;
#P comment 303 443 100 9109516 coll index;
#P hidden connect 23 0 25 0;
#P hidden connect 25 2 28 0;
#P hidden connect 25 0 8 0;
#P fasten 3 3 8 0 38 147;
#P connect 6 0 5 0;
#P connect 39 0 11 0;
#P connect 28 0 5 1;
#P lcolor 2;
#P hidden connect 25 1 1 0;
#P connect 30 0 1 0;
#P connect 1 0 26 0;
#P connect 26 0 3 0;
#P connect 3 0 2 0;
#P connect 2 2 4 0;
#P connect 4 0 6 0;
#P connect 8 0 7 0;
#P connect 13 0 7 0;
#P connect 17 0 7 0;
#P connect 18 0 7 0;
#P connect 28 0 11 1;
#P lcolor 2;
#P connect 35 0 15 0;
#P connect 14 0 13 0;
#P connect 11 0 13 0;
#P connect 5 0 39 0;
#P connect 15 0 39 0;
#P connect 6 1 31 0;
#P connect 31 0 35 0;
#P connect 3 1 2 1;
#P connect 32 0 31 1;
#P connect 38 0 35 1;
#P connect 12 0 14 0;
#P fasten 34 0 32 0 328 230 273 230;
#P fasten 36 0 38 0 326 294 273 294;
#P connect 6 2 12 0;
#P fasten 3 2 12 2 334 148;
#P hidden connect 43 0 36 0;
#P hidden connect 25 0 36 0;
#P hidden connect 43 0 34 0;
#P hidden connect 25 0 34 0;
#P hidden connect 25 2 27 0;
#P connect 27 0 4 1;
#P hidden connect 42 0 43 0;
#P connect 9 0 10 0;
#P window clipboard copycount 44;


February 23, 2008 | 1:07 am

Thanks very much.

In answer to your question, I have no clue as to what the in1 command for the uzi object does but I’m sure some kind soul here might enlighten us both.

Rhys


February 24, 2008 | 4:46 pm

Rhys Perkins schrieb:
> In answer to your question, I have no clue as to what the in1 command
> for the uzi object does but I’m sure some kind soul here might
> enlighten us both.

It will pass the argument to the inlet 1, which is the right inlet to
uzi… Usually you only need that with pattrforward to send to a
different than the first (in0) inlet…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


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