max v2;
#N vpatcher 287 283 1048 725;
#P origin 0 13;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 394 129 95 196617 expr ($f1*3.5)+1.;
#P number 436 151 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 4;
#P comment 516 117 58 196617 Output new random pan value every X ms;
#P window linecount 1;
#P newex 551 95 89 196617 r randompanstate;
#P newex 593 212 34 196617 s pan1;
#P newex 514 192 27 196617 + 10;
#P message 606 170 14 196617 5;
#P newex 593 190 44 196617 line 0 1;
#P newex 514 170 35 196617 * 2.5;
#P number 514 214 35 9 1 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 574 124 55 196617 metro 100;
#P newex 574 145 64 196617 random 127;
#P window linecount 3;
#P comment 551 189 27 196617 Pan rate (ms);
#P window linecount 1;
#P newex 514 75 85 196617 r randompanrate;
#P window linecount 4;
#P comment 445 176 53 196617 Cycles repeatedly from 0 to 127 to 0;
#P window linecount 3;
#P comment 418 319 71 196617 Sends adjusted pan value;
#P window linecount 6;
#P comment 195 213 96 196617 0's ensure that each type of control (manual \, random \, and auto) overrides settings left by last used control;
#P window linecount 1;
#P newex 336 154 39 196617 r pan2;
#P message 327 133 14 196617 0;
#P message 357 133 14 196617 1;
#P newex 327 111 46 196617 select 1;
#P message 327 199 39 196617 set \$1;
#P newex 327 177 27 196617 gate;
#P message 149 189 14 196617 0;
#P message 19 189 14 196617 0;
#P message 63 189 14 196617 0;
#P message 107 189 14 196617 0;
#P message 476 250 14 196617 0;
#P number 432 277 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 444 250 18 196617 64;
#P newex 444 228 44 196617 loadbang;
#P newex 394 107 71 196617 r autopanrate;
#P newex 385 87 75 196617 r autopanstate;
#P newex 385 176 29 196617 defer;
#P newex 447 300 34 196617 s pan1;
#P message 430 204 16 196617 -1;
#P toggle 385 322 15 0;
#P user gswitch 400 234 41 32 0 0;
#P newex 385 299 67 196617 select 127 0;
#P message 415 204 14 196617 1;
#P newex 385 273 40 196617 accum;
#P newex 385 154 52 196617 metro 60;
#P window linecount 2;
#P comment 335 53 145 196617 AUTOPANNER (or Automater for anything from 0-127);
#P outlet 142 325 15 0;
#P outlet 100 325 15 0;
#P outlet 56 325 15 0;
#P outlet 12 325 15 0;
#P inlet 56 280 15 0;
#P inlet 100 280 15 0;
#P inlet 142 280 15 0;
#P inlet 12 280 15 0;
#P window setfont "Sans Serif" 20.;
#P window linecount 1;
#P comment 194 17 102 196628 PANNING;
#P window setfont "Sans Serif" 9.;
#P newex 100 298 27 196617 *~;
#P newex 142 298 27 196617 *~;
#P newex 12 298 27 196617 *~;
#P newex 56 298 27 196617 *~;
#P message 12 232 37 196617 \$1 25;
#P newex 12 253 42 196617 line~ 0.;
#P message 142 232 37 196617 \$1 25;
#P message 100 232 37 196617 \$1 25;
#P newex 100 253 50 196617 line~ 0.5;
#P message 56 232 37 196617 \$1 25;
#P newex 142 253 42 196617 line~ 0.;
#P newex 56 253 50 196617 line~ 0.5;
#P newex 12 56 39 196617 r pan2;
#P newex 167 131 119 196617 expr (($f1-86.0)/42.0);
#P newex 159 107 168 196617 expr abs(abs(($f1-86.0)/43.0)-1);
#P newex 22 131 168 196617 expr abs(abs(($f1-43.0)/43.0)-1);
#P flonum 12 213 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 12 107 134 196617 expr abs(($f1/43.0) - 1.0);
#P flonum 142 213 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 100 213 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 56 213 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 159 83 66 196617 split 43 127;
#P newex 12 83 54 196617 split 0 43;
#P newex 87 83 54 196617 split 0 86;
#P window linecount 3;
#P comment 172 152 139 196617 Expressions process signal going to each speaker so that total volume equals approx. 1;
#P window linecount 8;
#P comment 321 220 53 196617 Autopan starts from last position set manually or by randompan;
#P user panel 321 104 54 223;
#X brgb 214 214 214;
#X frgb 157 157 157;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P window linecount 1;
#P newex 241 83 66 196617 split 86 127;
#P comment 47 58 276 196617 Split pan control signal to map certain range to each channel;
#P user panel 9 53 298 291;
#X brgb 214 214 214;
#X frgb 157 157 157;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P window linecount 7;
#P comment 504 261 141 196617 INFO: Module for controlling pan position. Creates linear panning effect by adjusting volume of each of four channels according to pan position set manually \, by randompan \, or by autopan.;
#P user panel 512 72 123 165;
#X brgb 214 214 214;
#X frgb 157 157 157;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P window linecount 1;
#P comment 531 53 100 196617 RANDOM PANNER;
#P window linecount 3;
#P comment 472 144 27 196617 Pan rate (ms);
#P user panel 379 83 118 266;
#X brgb 214 214 214;
#X frgb 157 157 157;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P fasten 22 0 12 0 17 79 17 79;
#P connect 12 0 17 0;
#P fasten 17 0 18 0 17 154 17 154;
#P connect 62 0 18 0;
#P connect 18 0 30 0;
#P connect 30 0 29 0;
#P connect 36 0 32 0;
#P connect 32 0 40 0;
#P connect 21 0 62 0;
#P connect 20 0 62 0;
#P fasten 11 0 19 0 92 105 125 105 125 128 27 128;
#P fasten 29 0 32 1 17 276 34 276;
#P fasten 19 0 14 0 27 151 61 151;
#P connect 61 0 14 0;
#P connect 14 0 25 0;
#P connect 25 0 23 0;
#P connect 39 0 31 0;
#P connect 31 0 41 0;
#P connect 21 0 61 0;
#P fasten 23 0 31 1 61 276 78 276;
#P fasten 22 0 11 0 17 79 92 79;
#P fasten 20 0 15 0 164 151 105 151;
#P connect 60 0 15 0;
#P connect 15 0 27 0;
#P connect 27 0 26 0;
#P connect 38 0 34 0;
#P connect 34 0 42 0;
#P connect 17 0 60 0;
#P fasten 26 0 34 1 105 276 122 276;
#P fasten 21 0 16 0 172 153 147 153;
#P connect 63 0 16 0;
#P connect 16 0 28 0;
#P connect 28 0 24 0;
#P connect 37 0 33 0;
#P connect 33 0 43 0;
#P connect 19 0 63 0;
#P connect 17 0 63 0;
#P fasten 22 0 13 0 17 79 164 79;
#P connect 13 0 20 0;
#P fasten 24 0 33 1 147 276 164 276;
#P fasten 7 0 21 0 246 104 301 104 301 128 172 128;
#P fasten 22 0 7 0 17 79 246 79;
#P fasten 54 0 66 0 390 108 332 108;
#P connect 66 0 68 0;
#P fasten 67 0 64 0 362 152 332 152;
#P connect 68 0 64 0;
#P connect 64 0 65 0;
#P fasten 69 0 64 1 341 175 349 175;
#P connect 66 1 67 0;
#P connect 54 0 45 0;
#P connect 45 0 53 0;
#P connect 53 0 46 0;
#P fasten 65 0 46 0 332 217 390 217;
#P fasten 57 0 46 0 449 270 390 270;
#P connect 46 0 48 0;
#P fasten 48 1 50 0 418 320 390 320;
#P connect 48 0 50 0;
#P connect 55 0 86 0;
#P fasten 50 0 49 0 390 341 382 341 382 225 405 225;
#P fasten 59 0 49 0 481 270 491 270 491 225 405 225;
#P connect 49 0 46 1;
#P fasten 53 0 47 0 390 201 420 201;
#P connect 47 0 49 1;
#P fasten 86 0 45 1 399 151 432 151;
#P fasten 53 0 51 0 390 198 435 198;
#P connect 51 0 49 2;
#P fasten 46 0 58 0 390 293 428 293 428 274 437 274;
#P fasten 86 0 85 0 399 149 441 149;
#P connect 56 0 57 0;
#P fasten 46 0 52 0 390 296 452 296;
#P fasten 56 0 59 0 449 248 481 248;
#P connect 73 0 78 0;
#P connect 78 0 81 0;
#P connect 81 0 77 0;
#P fasten 83 0 76 0 556 115 579 115;
#P connect 76 0 75 0;
#P fasten 75 0 79 0 579 167 598 167;
#P connect 79 0 82 0;
#P fasten 75 0 80 0 579 165 611 165;
#P connect 80 0 79 1;
#P fasten 77 0 76 1 519 232 630 232 630 120 624 120;
#P pop;
