Forums > MaxMSP

weighted drunk

August 13, 2008 | 4:40 pm

Hi,

Is there any way to make [drunk] weighted? For example:

Total range 1 to 4, but mostly outputs 1 and 2, occasionally wandering to 3 and 4.

Here are two examples, though neither of them really get the job done how I’d like…

#P window setfont "Sans Serif" 9.;
#P number 393 115 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 564 116 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 3;
#P comment 557 259 174 9109513 drunk/split approach: this is good for walking , but it can get stuck in the upper range and output a lot of 3s and 4s;
#P comment 389 259 160 9109513 random/split approach: this is good as far as proportion of output , but it doesn’t ‘walk’ like drunk does;
#P window linecount 1;
#P newex 607 168 19 9109513 t 2;
#P newex 607 146 41 9109513 split 4 7;
#P toggle 564 56 15 0;
#P newex 564 73 50 9109513 metro 300;
#P newex 651 232 26 9109513 print;
#P newex 682 190 19 9109513 t 4;
#P newex 682 168 33 9109513 sel 10;
#P newex 651 168 19 9109513 t 3;
#P newex 651 146 41 9109513 split 8 9;
#P newex 564 168 19 9109513 t 1;
#P newex 564 146 41 9109513 split 0 3;
#P newex 564 94 44 9109513 drunk 10;
#P toggle 393 55 15 0;
#P newex 393 72 50 9109513 metro 300;
#P newex 442 239 26 9109513 print;
#P newex 496 164 19 9109513 t 4;
#P newex 496 142 51 9109513 split 95 99;
#P newex 442 164 19 9109513 t 3;
#P newex 442 142 51 9109513 split 90 94;
#P newex 393 164 19 9109513 t b;
#P newex 393 208 27 9109513 + 1;
#P newex 393 186 47 9109513 random 2;
#P newex 393 142 46 9109513 split 0 89;
#P newex 393 93 57 9109513 random 100;
#P user panel 386 50 166 254;
#X brgb 255 243 224;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 554 50 182 254;
#X brgb 239 252 255;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 29 0 3 0;
#P connect 29 0 7 0;
#P connect 29 0 9 0;
#P connect 2 0 29 0;
#P connect 28 0 15 0;
#P connect 28 0 24 0;
#P connect 28 0 17 0;
#P connect 14 0 28 0;
#P connect 16 0 21 0;
#P connect 25 0 21 0;
#P connect 24 0 25 0;
#P connect 15 0 16 0;
#P connect 17 1 19 0;
#P connect 19 0 20 0;
#P connect 17 0 18 0;
#P connect 22 0 14 0;
#P connect 18 0 21 0;
#P connect 20 0 21 0;
#P connect 23 0 22 0;
#P connect 3 0 6 0;
#P connect 9 0 10 0;
#P connect 7 0 8 0;
#P connect 13 0 12 0;
#P connect 12 0 2 0;
#P connect 10 0 11 0;
#P connect 8 0 11 0;
#P connect 5 0 11 0;
#P connect 6 0 4 0;
#P connect 4 0 5 0;
#P window clipboard copycount 30;


August 13, 2008 | 5:11 pm

Hi there,

I can offer you a verbal description of what you might do…

Why don’t you set it up so that 2 conditions need to be met in order for 3 & 4 to be output? So, if you have 2 drunk objects outputting numbers, and, as long as even one of them is 1 or 2, that’s what the final output is. In order for 3 or 4 to be output, there needs to be two 3′s or two 4′s. Does that make sense? Essentially, if either of the drunk’s creates a 1 or 2, then the final output is 1 or 2. If the first one creates a 3 or 4, MAX would then check the second drunk, and if THAT one ALSO has a 3 (or 4), then the output is 3 or 4. Otherwise, the output is a 1 or 2.

Does that make sense?

I’ll move over to my other computer (which has MAX on it), and I’ll see if I can create a patch that does this.

Cheers,
Joel


August 13, 2008 | 5:19 pm

I think you could achieve this with itable/table. Take a look at Tutorial 17: Data Structures and Probability. Basically you can weight the probability of certain values occurring.


August 13, 2008 | 5:33 pm

Joel,

Yes, this makes sense, and it gives me something to work with. Your suggestion still allows for the possibility that both [drunk]s hang out around 3 and 4 for some amount of time outputting more of these numbers than I want. But I’ll work with this and bring back any further questions.

Jay


August 13, 2008 | 6:48 pm

On Aug 13, 2008, at 9:40 AM, Jay Bodley wrote:

> Is there any way to make [drunk] weighted?

I’m sure Peter Castine will opine on this, but here are a couple of
refinements of your approaches in the mean time. I also added a couple
of statistic visualizers (ok, ok, tables and multisliders, but
still…):

max v2;
#N vpatcher -1 44 429 723;
#P origin 170 0;
#P window setfont "Sans Serif" 9.;
#N vpatcher 935 438 1442 800;
#P origin 0 32;
#P window setfont "Sans Serif" 24.;
#P comment 5 221 21 196632 c;
#P comment 5 306 21 196632 d;
#P comment 5 136 21 196632 b;
#P comment 5 51 21 196632 a;
#P user multiSlider 29 260 453 79 0. 4. 1 3433 15 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 user multiSlider 29 175 453 79 0. 4. 1 3433 15 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 user multiSlider 29 90 453 79 0. 4. 1 3433 15 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 user multiSlider 29 5 453 79 0. 4. 1 3433 15 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 window setfont "Sans Serif" 9.;
#P hidden newex 18 175 50 196617 r c_walk;
#P hidden newex 18 261 50 196617 r d_walk;
#P hidden newex 18 90 50 196617 r b_walk;
#P hidden newex 18 7 50 196617 r a_walk;
#P hidden connect 0 0 4 0;
#P hidden connect 1 0 5 0;
#P hidden connect 3 0 6 0;
#P hidden connect 2 0 7 0;
#P pop 1;
#P newobj 21 596 44 196617 p walks;
#P newex 64 426 50 196617 s c_walk;
#P newex 225 566 50 196617 s d_walk;
#P newex 263 217 50 196617 s b_walk;
#P newex 74 225 50 196617 s a_walk;
#P window linecount 3;
#P comment 17 544 147 196617 Approach a and c are fairly similar ,
and d is pretty much just a refinement of approach b;
#P window setfont "Sans Serif" 24.;
#P window linecount 1;
#P comment 141 404 21 196632 c;
#P comment 365 406 21 196632 d;
#P comment 365 78 21 196632 b;
#P comment 170 78 21 196632 a;
#P window setfont "Sans Serif" 9.;
#P window linecount 4;
#P comment 311 464 57 196617 45% One 45% Two 5% Three 5% Four;
#P window linecount 1;
#P hidden newex 224 398 66 196617 loadmess 20;
#P number 223 417 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 175 12 24 196617 Run;
#P number 183 563 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 277 543 21 196617 t 3;
#P newex 327 564 19 196617 t 4;
#P newex 183 496 21 196617 t 1;
#P newex 227 519 21 196617 t 2;
#P newex 327 542 60 196617 split 95 99;
#P newex 277 521 60 196617 split 90 94;
#P newex 227 497 60 196617 split 45 89;
#P newex 183 474 54 196617 split 0 44;
#N vpatcher 44 461 382 781;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 214 159 27 196617 + 1;
#P comment 230 24 84 196617 from histo count;
#P comment 143 225 44 196617 to table;
#P comment 60 225 44 196617 to histo;
#P message 171 96 26 196617 128;
#P newex 214 140 40 196617 change;
#P newex 214 121 40 196617 peak;
#P newex 214 50 49 196617 t i i;
#P newex 214 90 49 196617 gate;
#P message 127 102 26 196617 128;
#P newex 214 71 36 196617 > 127;
#P message 127 192 62 196617 tabrange $1;
#P message 43 94 33 196617 clear;
#N comlet reset;
#P inlet 43 24 15 0;
#N comlet from histo count;
#P inlet 214 24 15 0;
#N comlet to histo;
#P outlet 43 224 15 0;
#N comlet to table;
#P outlet 127 224 15 0;
#P window linecount 0;
#P comment 60 24 34 196617 reset;
#P connect 4 0 5 0;
#P connect 5 0 2 0;
#P connect 4 0 8 0;
#P connect 8 0 6 0;
#P connect 17 0 6 0;
#P connect 6 0 1 0;
#P connect 5 0 1 0;
#P connect 4 0 13 0;
#P connect 3 0 10 0;
#P connect 10 0 7 0;
#P connect 7 0 9 0;
#P connect 9 0 11 0;
#P connect 11 0 12 0;
#P connect 12 0 17 0;
#P fasten 13 0 11 1 176 116 249 116;
#P connect 10 1 9 1;
#P pop;
#P newobj 240 593 69 196617 p table_scale;
#N vtable 5 818 44 946 900 970017 128 d;
#T set 0 0 0 0 0 0;
#P newobj 183 625 40 196617 table d;
#P newex 183 592 32 196617 histo;
#P window linecount 2;
#P comment 260 414 89 196617 Tune for desired variation;
#P number 183 455 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 183 434 50 196617 drunk 99;
#P comment 254 12 60 196617 reset stats;
#N vpatcher 44 461 382 781;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 214 159 27 196617 + 1;
#P comment 230 24 84 196617 from histo count;
#P comment 143 225 44 196617 to table;
#P comment 60 225 44 196617 to histo;
#P message 171 96 26 196617 128;
#P newex 214 140 40 196617 change;
#P newex 214 121 40 196617 peak;
#P newex 214 50 49 196617 t i i;
#P newex 214 90 49 196617 gate;
#P message 127 102 26 196617 128;
#P newex 214 71 36 196617 > 127;
#P message 127 192 62 196617 tabrange $1;
#P message 43 94 33 196617 clear;
#N comlet reset;
#P inlet 43 24 15 0;
#N comlet from histo count;
#P inlet 214 24 15 0;
#N comlet to histo;
#P outlet 43 224 15 0;
#N comlet to table;
#P outlet 127 224 15 0;
#P window linecount 0;
#P comment 60 24 34 196617 reset;
#P connect 4 0 5 0;
#P connect 5 0 2 0;
#P connect 4 0 8 0;
#P connect 17 0 6 0;
#P connect 8 0 6 0;
#P connect 5 0 1 0;
#P connect 6 0 1 0;
#P connect 4 0 13 0;
#P connect 3 0 10 0;
#P connect 10 0 7 0;
#P connect 7 0 9 0;
#P connect 9 0 11 0;
#P connect 11 0 12 0;
#P connect 12 0 17 0;
#P fasten 13 0 11 1 176 116 249 116;
#P connect 10 1 9 1;
#P pop;
#P newobj 77 448 69 196617 p table_scale;
#N vtable 5 689 44 817 900 970017 128 c;
#T set 0 0 0 0 0 0;
#P newobj 20 480 40 196617 table c;
#P newex 20 447 32 196617 histo;
#P window linecount 2;
#P comment 64 474 89 196617 This also doesn’t walk but is simple.;
#P number 20 425 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#N vtable 5 427 61 912 748 979816 100 odds;
#T set 0 0 45 45 5 5;
#P newobj 20 404 55 196617 table odds;
#P button 238 12 15 0;
#N vpatcher 30 89 375 403;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 214 161 27 196617 + 1;
#P comment 230 24 84 196617 from histo count;
#P comment 143 232 44 196617 to table;
#P comment 42 232 44 196617 to histo;
#P message 171 96 26 196617 128;
#P newex 214 140 40 196617 change;
#P newex 214 121 40 196617 peak;
#P newex 214 50 49 196617 t i i;
#P newex 214 90 49 196617 gate;
#P message 127 102 26 196617 128;
#P newex 214 71 36 196617 > 127;
#P message 127 198 62 196617 tabrange $1;
#P message 25 94 33 196617 clear;
#N comlet reset;
#P inlet 25 24 15 0;
#N comlet from histo count;
#P inlet 214 24 15 0;
#N comlet to histo;
#P outlet 25 231 15 0;
#N comlet to table;
#P outlet 127 231 15 0;
#P window linecount 0;
#P comment 42 24 34 196617 reset;
#P connect 4 0 5 0;
#P connect 5 0 2 0;
#P connect 4 0 8 0;
#P connect 8 0 6 0;
#P connect 17 0 6 0;
#P connect 6 0 1 0;
#P connect 5 0 1 0;
#P connect 4 0 13 0;
#P connect 3 0 10 0;
#P connect 10 0 7 0;
#P connect 7 0 9 0;
#P connect 9 0 11 0;
#P connect 11 0 12 0;
#P connect 12 0 17 0;
#P fasten 13 0 11 1 176 116 249 116;
#P connect 10 1 9 1;
#P pop;
#P newobj 68 322 69 196617 p table_scale;
#N vpatcher 44 461 382 781;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 214 159 27 196617 + 1;
#P comment 230 24 84 196617 from histo count;
#P comment 143 225 44 196617 to table;
#P comment 60 225 44 196617 to histo;
#P message 171 96 26 196617 128;
#P newex 214 140 40 196617 change;
#P newex 214 121 40 196617 peak;
#P newex 214 50 49 196617 t i i;
#P newex 214 90 49 196617 gate;
#P message 127 102 26 196617 128;
#P newex 214 71 36 196617 > 127;
#P message 127 192 62 196617 tabrange $1;
#P message 43 94 33 196617 clear;
#N comlet reset;
#P inlet 43 24 15 0;
#N comlet from histo count;
#P inlet 214 24 15 0;
#N comlet to histo;
#P outlet 43 224 15 0;
#N comlet to table;
#P outlet 127 224 15 0;
#P window linecount 0;
#P comment 60 24 34 196617 reset;
#P connect 4 0 5 0;
#P connect 5 0 2 0;
#P connect 4 0 8 0;
#P connect 8 0 6 0;
#P connect 17 0 6 0;
#P connect 6 0 1 0;
#P connect 5 0 1 0;
#P connect 4 0 13 0;
#P connect 3 0 10 0;
#P connect 10 0 7 0;
#P connect 7 0 9 0;
#P connect 9 0 11 0;
#P connect 11 0 12 0;
#P connect 12 0 17 0;
#P fasten 13 0 11 1 176 116 249 116;
#P connect 10 1 9 1;
#P pop;
#P newobj 275 334 69 196617 p table_scale;
#N vtable 5 431 44 559 900 970017 128 a;
#T set 0 0 0 0 0 0;
#P newobj 18 354 40 196617 table a;
#P newex 18 321 32 196617 histo;
#N vtable 5 560 44 688 900 970017 128 b;
#T set 0 0 0 0 0 0;
#P newobj 218 366 40 196617 table b;
#P newex 218 333 32 196617 histo;
#P number 18 101 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 218 102 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 4;
#P comment 231 240 147 196617 drunk/split approach: this is good for
walking , but it can get stuck in the upper range and output a lot of
3s and 4s;
#P comment 35 245 154 196617 random/split approach: this is good as
far as proportion of output , but it doesn’t ‘walk’ like drunk does;
#P window linecount 1;
#P newex 261 154 19 196617 t 2;
#P newex 261 132 55 196617 split 4 7;
#P toggle 158 12 15 0;
#P newex 158 29 52 196617 metro 30;
#P number 218 218 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 336 176 19 196617 t 4;
#P newex 336 154 33 196617 sel 10;
#P newex 305 154 19 196617 t 3;
#P newex 305 132 55 196617 split 8 9;
#P newex 218 154 19 196617 t 1;
#P newex 218 132 55 196617 split 0 3;
#P newex 218 80 58 196617 drunk 10;
#P number 18 225 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 121 192 19 196617 t 4;
#P newex 121 128 65 196617 split 95 99;
#P newex 67 192 19 196617 t 3;
#P newex 67 128 65 196617 split 90 94;
#P newex 18 150 19 196617 t b;
#P newex 18 194 27 196617 + 1;
#P newex 18 172 47 196617 random 2;
#P newex 18 128 60 196617 split 0 89;
#P newex 18 79 71 196617 random 100;
#P user panel 10 399 158 112;
#X brgb 254 202 192;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P background;
#P user panel 11 75 188 318;
#X brgb 255 243 224;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P background;
#P user panel 209 74 183 318;
#X brgb 239 252 255;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P background;
#P user panel 174 399 218 250;
#X brgb 192 254 228;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P background;
#P button 158 49 15 0;
#P hidden connect 0 0 5 0;
#P connect 5 0 30 0;
#P connect 30 0 6 0;
#P connect 6 0 9 0;
#P connect 9 0 7 0;
#P connect 7 0 8 0;
#P connect 8 0 14 0;
#P connect 11 0 14 0;
#P connect 13 0 14 0;
#P connect 14 0 33 0;
#P connect 36 0 33 0;
#P connect 33 0 34 0;
#P connect 36 1 34 0;
#P hidden connect 0 0 38 0;
#P connect 38 0 39 0;
#P connect 39 0 41 0;
#P connect 43 0 41 0;
#P connect 41 0 42 0;
#P connect 43 1 42 0;
#P connect 33 1 34 1;
#P connect 41 1 42 1;
#P connect 39 0 72 0;
#P connect 30 0 10 0;
#P connect 10 0 11 0;
#P hidden connect 37 0 36 0;
#P connect 14 0 69 0;
#P hidden connect 37 0 43 0;
#P connect 30 0 12 0;
#P connect 12 0 13 0;
#P connect 33 1 36 1;
#P connect 41 1 43 1;
#P connect 24 0 23 0;
#P connect 23 0 0 0;
#P hidden connect 0 0 45 0;
#P connect 45 0 46 0;
#P connect 46 0 51 0;
#P connect 51 0 56 0;
#P connect 57 0 59 0;
#P connect 58 0 59 0;
#P connect 55 0 59 0;
#P connect 56 0 59 0;
#P connect 59 0 48 0;
#P connect 50 0 48 0;
#P connect 48 0 49 0;
#P connect 50 1 49 0;
#P connect 48 1 49 1;
#P hidden connect 0 0 15 0;
#P connect 15 0 29 0;
#P connect 29 0 16 0;
#P connect 16 0 17 0;
#P connect 21 0 22 0;
#P connect 19 0 22 0;
#P connect 26 0 22 0;
#P connect 17 0 22 0;
#P connect 22 0 31 0;
#P connect 35 0 31 0;
#P connect 31 0 32 0;
#P connect 35 1 32 0;
#P hidden connect 62 0 61 0;
#P connect 61 0 45 2;
#P connect 59 0 71 0;
#P connect 51 1 52 0;
#P connect 52 0 55 0;
#P hidden connect 37 0 50 0;
#P connect 31 1 32 1;
#P connect 29 0 25 0;
#P connect 25 0 26 0;
#P connect 22 0 70 0;
#P hidden connect 37 0 35 0;
#P connect 52 1 53 0;
#P connect 53 0 58 0;
#P connect 48 1 50 1;
#P connect 29 0 18 0;
#P connect 18 0 19 0;
#P connect 53 1 54 0;
#P connect 54 0 57 0;
#P connect 31 1 35 1;
#P connect 18 1 20 0;
#P connect 20 0 21 0;
#P pop;

Chris Muir
cbm@well.com

http://www.xfade.com


August 13, 2008 | 6:57 pm

Wow, Chris, thank you. This looks complicated (moreso than I thought it would be). I’ll study it; I’m sure it helps out a lot.


August 13, 2008 | 6:58 pm

Here’s a little patch that I made that contains two methods for achieving what you’re talking about (I think).

The first example works by select 1-4. If a 1 or 2 is chosen, it passes through, if a 3 or 4 is chosen, it chooses again. Then, again, if a 1 or 2 is chosen, it goes through, but if a 3 or 4 is chosen, it choses again, and… once more, but this time, it will pass whatever is chosen. So, ergo… your chances of a 1 or 2 are higher than your chances of a 3 or 4. I used ‘drunk’ to generate numbers for this.

The second one is a bit clunkier, but it would allow for you to control probability of each of the numbers coming up. In the example, I’ve set it so that the chance of a 1 occurring is 2/5, the chance of a 2 occurring is also a 2/5, while the chances of a 3 occurring is 1/10, as is 4. I used ‘random’ to generate numbers for this, but drunk would work as well.

I also included a little counter at the bottom so you can see how many occurrences of each number there are.

I’m sure there are other ways to accomplish this, but here are a few…

Good luck!

-j

———————————————

{
"patcher" : {
"fileversion" : 1,
"rect" : [ 25.0, 69.0, 845.0, 778.0 ],
"bglocked" : 0,
"defrect" : [ 25.0, 69.0, 845.0, 778.0 ],
"openrect" : [ 0.0, 0.0, 0.0, 0.0 ],
"openinpresentation" : 0,
"default_fontsize" : 12.0,
"default_fontface" : 0,
"default_fontname" : "Arial",
"gridonopen" : 0,
"gridsize" : [ 15.0, 15.0 ],
"gridsnaponopen" : 0,
"toolbarvisible" : 1,
"boxanimatetime" : 200,
"imprint" : 0,
"metadata" : [ ],
"boxes" : [ {
"box" : {
"maxclass" : "comment",
"text" : "4's",
"fontname" : "Arial",
"id" : "obj-137",
"numinlets" : 1,
"fontsize" : 12.0,
"presentation_rect" : [ 381.0, 715.0, 0.0, 0.0 ],
"numoutlets" : 0,
"patching_rect" : [ 379.0, 710.0, 28.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "3′s",
"fontname" : "Arial",
"id" : "obj-136",
"numinlets" : 1,
"fontsize" : 12.0,
"presentation_rect" : [ 331.0, 713.0, 0.0, 0.0 ],
"numoutlets" : 0,
"patching_rect" : [ 329.0, 710.0, 28.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "2′s",
"fontname" : "Arial",
"id" : "obj-135",
"numinlets" : 1,
"fontsize" : 12.0,
"presentation_rect" : [ 271.0, 714.0, 0.0, 0.0 ],
"numoutlets" : 0,
"patching_rect" : [ 276.0, 710.0, 28.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "1′s",
"fontname" : "Arial",
"id" : "obj-134",
"numinlets" : 1,
"fontsize" : 12.0,
"numoutlets" : 0,
"patching_rect" : [ 225.0, 710.0, 28.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "How many:",
"fontname" : "Arial",
"id" : "obj-133",
"numinlets" : 1,
"fontsize" : 12.0,
"numoutlets" : 0,
"patching_rect" : [ 147.0, 710.0, 75.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "button",
"id" : "obj-132",
"numinlets" : 1,
"presentation_rect" : [ 476.0, 392.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"patching_rect" : [ 479.0, 385.0, 20.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "number",
"fontname" : "Arial",
"id" : "obj-131",
"numinlets" : 1,
"fontsize" : 12.0,
"numoutlets" : 2,
"outlettype" : [ "int", "bang" ],
"patching_rect" : [ 479.0, 350.0, 50.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "4",
"fontname" : "Arial",
"id" : "obj-129",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 712.0, 219.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 722.0, 217.0, 32.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "4",
"fontname" : "Arial",
"id" : "obj-130",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 688.0, 197.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 699.0, 197.0, 32.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "3",
"fontname" : "Arial",
"id" : "obj-119",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 676.0, 220.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 676.0, 220.0, 32.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "3",
"fontname" : "Arial",
"id" : "obj-120",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 653.0, 198.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 653.0, 197.0, 32.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "2",
"fontname" : "Arial",
"id" : "obj-121",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 632.0, 220.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 632.0, 220.0, 32.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "2",
"fontname" : "Arial",
"id" : "obj-122",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 608.0, 198.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 608.0, 197.0, 32.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "2",
"fontname" : "Arial",
"id" : "obj-123",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 588.0, 220.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 588.0, 220.0, 32.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "2",
"fontname" : "Arial",
"id" : "obj-124",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 564.0, 198.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 564.0, 198.0, 32.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "2",
"fontname" : "Arial",
"id" : "obj-113",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 541.0, 221.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 541.0, 221.0, 32.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "2",
"fontname" : "Arial",
"id" : "obj-114",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 518.0, 199.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 518.0, 199.0, 32.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "2",
"fontname" : "Arial",
"id" : "obj-115",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 497.0, 221.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 497.0, 221.0, 32.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "2",
"fontname" : "Arial",
"id" : "obj-116",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 473.0, 199.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 473.0, 199.0, 32.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "1",
"fontname" : "Arial",
"id" : "obj-117",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 453.0, 221.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 450.0, 221.0, 32.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "1",
"fontname" : "Arial",
"id" : "obj-118",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 429.0, 199.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 428.0, 199.0, 32.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "1",
"fontname" : "Arial",
"id" : "obj-112",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 408.0, 221.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 405.0, 222.0, 32.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "1",
"fontname" : "Arial",
"id" : "obj-111",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 386.0, 200.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 382.0, 200.0, 32.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "1",
"fontname" : "Arial",
"id" : "obj-110",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 361.0, 220.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 361.0, 222.0, 32.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "1",
"fontname" : "Arial",
"id" : "obj-109",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 339.0, 203.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 337.0, 200.0, 32.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "1",
"fontname" : "Arial",
"id" : "obj-108",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 320.0, 222.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 317.0, 222.0, 32.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "1",
"fontname" : "Arial",
"id" : "obj-107",
"numinlets" : 2,
"fontsize" : 12.0,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 293.0, 200.0, 32.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "route 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19",
"fontname" : "Arial",
"id" : "obj-106",
"numinlets" : 1,
"fontsize" : 12.0,
"numoutlets" : 21,
"outlettype" : [ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" ],
"patching_rect" : [ 292.0, 163.0, 494.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "toggle",
"id" : "obj-103",
"numinlets" : 1,
"presentation_rect" : [ 421.0, 28.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "int" ],
"patching_rect" : [ 421.0, 28.0, 20.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "metro 500",
"linecount" : 2,
"fontname" : "Arial",
"id" : "obj-104",
"numinlets" : 2,
"fontsize" : 11.595187,
"presentation_rect" : [ 421.0, 54.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"patching_rect" : [ 421.0, 54.0, 54.0, 33.0 ]
}

}
, {
"box" : {
"maxclass" : "button",
"id" : "obj-105",
"numinlets" : 1,
"presentation_rect" : [ 421.0, 93.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"patching_rect" : [ 421.0, 93.0, 20.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "random 20",
"fontname" : "Arial",
"id" : "obj-102",
"numinlets" : 2,
"fontsize" : 12.0,
"numoutlets" : 1,
"outlettype" : [ "int" ],
"patching_rect" : [ 421.0, 125.0, 100.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "Method 2:",
"fontname" : "Arial",
"id" : "obj-101",
"numinlets" : 1,
"fontsize" : 12.0,
"presentation_rect" : [ 337.0, 66.0, 0.0, 0.0 ],
"numoutlets" : 0,
"patching_rect" : [ 337.0, 66.0, 64.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "< --Counter Resetn",
"linecount" : 2,
"fontname" : "Arial",
"id" : "obj-100",
"numinlets" : 1,
"fontsize" : 12.0,
"numoutlets" : 0,
"patching_rect" : [ 431.0, 489.0, 80.0, 34.0 ]
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "Method 1:",
"fontname" : "Arial",
"id" : "obj-99",
"numinlets" : 1,
"fontsize" : 12.0,
"numoutlets" : 0,
"patching_rect" : [ 66.0, 69.0, 64.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "number",
"fontname" : "Arial",
"id" : "obj-97",
"numinlets" : 1,
"fontsize" : 12.0,
"presentation_rect" : [ 555.0, 607.0, 0.0, 0.0 ],
"numoutlets" : 2,
"outlettype" : [ "int", "bang" ],
"patching_rect" : [ 376.0, 688.0, 36.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "number",
"fontname" : "Arial",
"id" : "obj-96",
"numinlets" : 1,
"fontsize" : 12.0,
"presentation_rect" : [ 511.0, 609.0, 0.0, 0.0 ],
"numoutlets" : 2,
"outlettype" : [ "int", "bang" ],
"patching_rect" : [ 326.0, 688.0, 36.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "number",
"fontname" : "Arial",
"id" : "obj-95",
"numinlets" : 1,
"fontsize" : 12.0,
"presentation_rect" : [ 458.0, 607.0, 0.0, 0.0 ],
"numoutlets" : 2,
"outlettype" : [ "int", "bang" ],
"patching_rect" : [ 273.0, 688.0, 36.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "number",
"fontname" : "Arial",
"id" : "obj-94",
"numinlets" : 1,
"fontsize" : 12.0,
"numoutlets" : 2,
"outlettype" : [ "int", "bang" ],
"patching_rect" : [ 222.0, 688.0, 36.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "counter",
"fontname" : "Arial",
"id" : "obj-93",
"numinlets" : 5,
"fontsize" : 12.0,
"presentation_rect" : [ 550.0, 492.0, 0.0, 0.0 ],
"numoutlets" : 4,
"outlettype" : [ "int", "", "", "int" ],
"patching_rect" : [ 376.0, 632.0, 63.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "counter",
"fontname" : "Arial",
"id" : "obj-92",
"numinlets" : 5,
"fontsize" : 12.0,
"presentation_rect" : [ 508.0, 466.0, 0.0, 0.0 ],
"numoutlets" : 4,
"outlettype" : [ "int", "", "", "int" ],
"patching_rect" : [ 328.0, 606.0, 63.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "counter",
"fontname" : "Arial",
"id" : "obj-91",
"numinlets" : 5,
"fontsize" : 12.0,
"presentation_rect" : [ 452.0, 436.0, 0.0, 0.0 ],
"numoutlets" : 4,
"outlettype" : [ "int", "", "", "int" ],
"patching_rect" : [ 272.0, 576.0, 63.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "0",
"fontname" : "Arial",
"id" : "obj-90",
"numinlets" : 2,
"fontsize" : 12.0,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 381.0, 498.0, 50.0, 18.0 ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "counter",
"fontname" : "Arial",
"id" : "obj-89",
"numinlets" : 5,
"fontsize" : 12.0,
"numoutlets" : 4,
"outlettype" : [ "int", "", "", "int" ],
"patching_rect" : [ 227.0, 550.0, 63.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "route 1 2 3 4",
"fontname" : "Arial",
"id" : "obj-88",
"numinlets" : 1,
"fontsize" : 12.0,
"numoutlets" : 5,
"outlettype" : [ "", "", "", "", "" ],
"patching_rect" : [ 257.0, 498.0, 100.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "button",
"id" : "obj-87",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"patching_rect" : [ 142.0, 542.0, 20.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "button",
"id" : "obj-80",
"numinlets" : 1,
"presentation_rect" : [ 290.0, 395.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"patching_rect" : [ 239.0, 389.0, 20.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 1",
"fontname" : "Arial",
"id" : "obj-81",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 291.0, 450.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "int" ],
"patching_rect" : [ 239.0, 443.0, 34.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "drunk 3",
"fontname" : "Arial",
"id" : "obj-82",
"numinlets" : 3,
"fontsize" : 12.0,
"presentation_rect" : [ 291.0, 423.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "int" ],
"patching_rect" : [ 239.0, 415.0, 56.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "split 1 2",
"fontname" : "Arial",
"id" : "obj-85",
"numinlets" : 3,
"fontsize" : 12.0,
"presentation_rect" : [ 234.0, 358.0, 0.0, 0.0 ],
"numoutlets" : 2,
"outlettype" : [ "int", "int" ],
"patching_rect" : [ 199.0, 355.0, 59.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "button",
"id" : "obj-79",
"numinlets" : 1,
"presentation_rect" : [ 198.0, 265.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"patching_rect" : [ 198.0, 265.0, 20.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 1",
"fontname" : "Arial",
"id" : "obj-77",
"numinlets" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 199.0, 327.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "int" ],
"patching_rect" : [ 199.0, 320.0, 34.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "drunk 3",
"fontname" : "Arial",
"id" : "obj-78",
"numinlets" : 3,
"fontsize" : 12.0,
"presentation_rect" : [ 199.0, 293.0, 0.0, 0.0 ],
"numoutlets" : 1,
"outlettype" : [ "int" ],
"patching_rect" : [ 199.0, 293.0, 56.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "number",
"fontname" : "Arial",
"id" : "obj-76",
"numinlets" : 1,
"fontsize" : 12.0,
"numoutlets" : 2,
"outlettype" : [ "int", "bang" ],
"patching_rect" : [ 142.0, 514.0, 50.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "button",
"id" : "obj-72",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"patching_rect" : [ 121.0, 288.0, 20.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "number",
"fontname" : "Arial",
"id" : "obj-53",
"numinlets" : 1,
"fontsize" : 12.0,
"numoutlets" : 2,
"outlettype" : [ "int", "bang" ],
"patching_rect" : [ 142.0, 288.0, 42.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "split 1 2",
"fontname" : "Arial",
"id" : "obj-51",
"numinlets" : 3,
"fontsize" : 12.0,
"numoutlets" : 2,
"outlettype" : [ "int", "int" ],
"patching_rect" : [ 142.0, 228.0, 59.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+ 1",
"fontname" : "Arial",
"id" : "obj-3",
"numinlets" : 2,
"fontsize" : 12.0,
"numoutlets" : 1,
"outlettype" : [ "int" ],
"patching_rect" : [ 141.0, 196.0, 34.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "toggle",
"id" : "obj-21",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "int" ],
"patching_rect" : [ 142.0, 37.0, 20.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "metro 500",
"linecount" : 2,
"fontname" : "Arial",
"id" : "obj-22",
"numinlets" : 2,
"fontsize" : 11.595187,
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"patching_rect" : [ 142.0, 63.0, 54.0, 33.0 ]
}

}
, {
"box" : {
"maxclass" : "button",
"id" : "obj-31",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"patching_rect" : [ 142.0, 102.0, 20.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "drunk 3",
"fontname" : "Arial",
"id" : "obj-1",
"numinlets" : 3,
"fontsize" : 12.0,
"numoutlets" : 1,
"outlettype" : [ "int" ],
"patching_rect" : [ 141.0, 162.0, 56.0, 20.0 ]
}

}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-131", 0 ],
"destination" : [ "obj-132", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-131", 0 ],
"destination" : [ "obj-88", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-102", 0 ],
"destination" : [ "obj-106", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-105", 0 ],
"destination" : [ "obj-102", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-129", 0 ],
"destination" : [ "obj-131", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-130", 0 ],
"destination" : [ "obj-131", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-119", 0 ],
"destination" : [ "obj-131", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-120", 0 ],
"destination" : [ "obj-131", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-121", 0 ],
"destination" : [ "obj-131", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-122", 0 ],
"destination" : [ "obj-131", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-123", 0 ],
"destination" : [ "obj-131", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-124", 0 ],
"destination" : [ "obj-131", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-113", 0 ],
"destination" : [ "obj-131", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-114", 0 ],
"destination" : [ "obj-131", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-115", 0 ],
"destination" : [ "obj-131", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-116", 0 ],
"destination" : [ "obj-131", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-117", 0 ],
"destination" : [ "obj-131", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-118", 0 ],
"destination" : [ "obj-131", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-112", 0 ],
"destination" : [ "obj-131", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-111", 0 ],
"destination" : [ "obj-131", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-110", 0 ],
"destination" : [ "obj-131", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-109", 0 ],
"destination" : [ "obj-131", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-108", 0 ],
"destination" : [ "obj-131", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-107", 0 ],
"destination" : [ "obj-131", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-106", 19 ],
"destination" : [ "obj-129", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-106", 18 ],
"destination" : [ "obj-130", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-106", 17 ],
"destination" : [ "obj-119", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-106", 16 ],
"destination" : [ "obj-120", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-106", 15 ],
"destination" : [ "obj-121", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-106", 14 ],
"destination" : [ "obj-122", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-106", 13 ],
"destination" : [ "obj-123", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-106", 12 ],
"destination" : [ "obj-124", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-106", 11 ],
"destination" : [ "obj-113", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-106", 10 ],
"destination" : [ "obj-114", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-106", 9 ],
"destination" : [ "obj-115", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-106", 8 ],
"destination" : [ "obj-116", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-106", 7 ],
"destination" : [ "obj-117", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-106", 6 ],
"destination" : [ "obj-118", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-106", 5 ],
"destination" : [ "obj-112", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-106", 4 ],
"destination" : [ "obj-111", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-106", 3 ],
"destination" : [ "obj-110", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-106", 2 ],
"destination" : [ "obj-109", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-106", 1 ],
"destination" : [ "obj-108", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-106", 0 ],
"destination" : [ "obj-107", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-104", 0 ],
"destination" : [ "obj-105", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-103", 0 ],
"destination" : [ "obj-104", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" :


August 13, 2008 | 6:59 pm

Woah…

Why does my text look like that??? Weird… I think it works though.


August 13, 2008 | 7:19 pm

On Aug 13, 2008, at 11:59 AM, joelsquare wrote:

> Why does my text look like that??? Weird… I think it works though.

This is the "normal" Max 5 format. If you use Copy Compressed instead
of Copy it gives you the forum-friendly compressed format.

-C

Chris Muir
cbm@well.com

http://www.xfade.com


August 13, 2008 | 8:34 pm

This is not a direct solution to the question but a general way of reconstructing [drunk] by using [random] in a feedback loop. Once you have this you can then replace [random] with some weighted random choice (using one of the methods already mentioned e.g., table/itable).


August 13, 2008 | 9:10 pm

How about 7 or 8 pints of Guinness?

-A


August 13, 2008 | 9:23 pm

Quote: Andrew Pask wrote on Wed, 13 August 2008 22:10
—————————————————-
> How about 7 or 8 pints of Guinness?
—————————————————-

Well – that would weigh about 7 or 8 pounds, perhaps slightly more especially if you include the pint glass.


August 13, 2008 | 9:29 pm

By way of more general approaches to randomness, you might check out the
"chance" section of Karlheinz Essl’s Real Time Composition Library
(RTC-lib). The "ratio" object does something like what you want, and there
are plenty of other interesting patches, all designed to work together.

http://www.essl.at/software.html

– Paul

On Wed, Aug 13, 2008 at 3:34 PM, Martin Robinson <
martinrobinson_mail@yahoo.co.uk> wrote:

> This is not a direct solution to the question but a general way of
> reconstructing [drunk] by using [random] in a feedback loop. Once you have
> this you can then replace [random] with some weighted random choice (using
> one of the methods already mentioned e.g., table/itable).
>
>
> –
> martin robinson
> max/msp java c
> installations/performance and systems
>
>
>


—– |(*,+,#,=)(#,=,*,+)(=,#,+,*)(+,*,=,#)| —–


August 14, 2008 | 2:06 pm

I’ve used this before in one of my patches. It was not created by me. It is credited to Bas van de Graaf in the patch. Weighted random thing.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 230 217 28 196617 900;
#P comment 230 276 28 196617 300;
#P button 83 54 15 0;
#P newex 106 99 46 196617 / 1000.;
#P newex 34 99 46 196617 / 1000.;
#P newex 106 78 70 196617 random 1000;
#P newex 34 122 29 196617 * 0.;
#P toggle 34 33 15 0;
#P newex 34 54 46 196617 metro 2;
#P newex 34 202 37 196617 + 300;
#P user multiSlider 34 222 196 92 0. 900. 1 3177 15 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 newex 34 182 41 196617 * 600.;
#P flonum 34 163 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 34 142 30 196617 !- 1.;
#P newex 34 78 70 196617 random 1000;
#P comment 230 307 18 196617 0;
#P window linecount 7;
#P comment 191 43 100 196617 Bas van de Graaff – C74 Forum – random: whatever you want but mosty this – message #120194 – 6/11/07;
#P connect 11 0 13 0;
#P fasten 8 0 11 0 39 73 111 73;
#P fasten 14 0 2 0 88 73 39 73;
#P fasten 14 0 11 0 88 73 111 73;
#P fasten 13 0 10 1 111 119 58 119;
#P connect 7 0 6 0;
#P connect 5 0 7 0;
#P connect 4 0 5 0;
#P connect 3 0 4 0;
#P connect 10 0 3 0;
#P connect 12 0 10 0;
#P connect 2 0 12 0;
#P connect 8 0 2 0;
#P connect 9 0 8 0;
#P window clipboard copycount 17;


August 15, 2008 | 3:08 pm

for larger arrays than 4 you might want to do a simple mapping… i
think someone mentioned table object. This is very simple to
impliment and adapt to various needs and wants. And you can be very
precise.

cheers,

Carey



kjg

August 15, 2008 | 7:55 pm

Quote: Chris Muir wrote on Wed, 13 August 2008 20:48
—————————————————-

> I’m sure Peter Castine will opine on this,
—————————————————-

That doesn’t leave me much choice, does it?

[drunk] is supposed to be a kind of random walk or Brownian motion, and in the literature Brownian motion is always modeled as having equal probabilities for going "left" or "right" (or up/down). So it’s not as if there are going to be ready-made solutions in Wikipedia’s probability articles.

The proposed solutions based simply on [random] are mostly memory-free, and so they won’t be Brownian. Period. For instance, Bas’ generator is giving the product of two independent (approximately) uniform distributions. That’s weighted, but not a random walk. Random walk is a Markov process with (at least) one order of memory.

In fact, the most direct way for Lao-Tze to get what he wants is a first-order Markov chain. You can use the stock [prob] object for that.

I don’t usually post solutions that get by without Litter Power objects, but in this case I’ll make an exception. However, if you are at all serious about randomness, you owe it to yourself to look at Litter Power, at the very least the Starter Pack (URI below). How can anyone calling himself Lao Tze can get by without an I Ching generator?-)

Enjoy:

#P user multiSlider 97 246 196 92 0. 3. 1 3433 15 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 window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 42 244 33 196617 print;
#P toggle 57 153 15 0;
#P newex 57 183 60 196617 metro 300;
#N prob;
#P newobj 42 217 31 196617 prob;
#P newex 42 65 49 196617 loadbang;
#P message 42 88 328 196617 0 0 2 , 0 1 2 , 1 0 2 , 1 1 1 , 1 2 1 , 2 1 2 , 2 2 1 , 2 3 1 , 3 2 3 , 3 3 1;
#P comment 147 109 352 196617 Weights for transition table. Salt to taste. See prob.help for explanation.;
#P connect 3 0 6 0;
#P fasten 3 0 7 0 47 238 102 238;
#P fasten 4 0 3 0 62 211 47 211;
#P connect 5 0 4 0;
#P connect 1 0 3 0;
#P connect 2 0 1 0;
#P window clipboard copycount 8;


August 16, 2008 | 9:34 pm

Oops. My drunkex.maxpat had a major bug in the arithmetic so it was significantly different from drunk (rather than subtly different as the patch comment says).

Fixed version attached.

Quote: Peter Castine wrote on Fri, 15 August 2008 20:55
—————————————————-
> The proposed solutions based simply on [random] are mostly memory-free

Of course [+] gives us the memory we need for this…

And here’s a weighted version too.


August 17, 2008 | 11:49 am

Quote: martinrobinson wrote on Sat, 16 August 2008 23:34
—————————————————-
> Of course [+] gives us the memory we need for this…

Yep, feedback into the right inlet will do the trick.

> And here’s a weighted version too.

Hmmm. What you’re weighting is the step size, which is intriquing but different from what Lao-Tze asked for. He wanted the results to be weighted (specifically bottom-heavy). The result of your patch is an approximately symmetrical, approximately Brownian distribution. BTW, I’m not sure if you intended the itable contents to be assymetrical, but they are. So the expected mean is around 60, rather than 49.5 (which would be the case if the itable values were symmetrical). At the end of the day you’re generating an approximately Gaussian distribution (more values in the middle than at either end, with a very slight shift upwards because of the asymmetry in the itable values).

I’ve attached Max 5 patch that shows a new approach to Lao-Tze’s problem as well as the previous example. The new approach uses lp.pvvv~ from Litter Pro with a few daisy-chained split objects (rather like one of LT’s early attempts but giving the results he wanted). It would be possible to substitute the lp.sss from the Litter Starter Pack (for those who are still just trying out Litter Power). However, you’d have to tweak the split boundaries a lot. Left as an exercise for the reader;-

What’s more important in the attached is the example of lp.stacey to grab some statistical data from whatever your Random Number Generator is. The key values are mean, standard deviation, and skew (4th, 5th, 6th outlets).

– P.

– Pasted Max Patch, click to expand. –

August 17, 2008 | 8:02 pm

Yep, it was an approximated, moused-in set of values. And wasn’t a direct solution to the original question.

intriquing?


August 17, 2008 | 9:26 pm

Quote: martinrobinson wrote on Sun, 17 August 2008 22:02
—————————————————-
> intriquing?
—————————————————-

I need to get some sleep, or else there will be even more intriguing spelling misteaks. Probably medium-rare.


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