#N canvas 412 55 558 635 10;
#X obj 5 603 cnv 15 552 21 empty empty empty 20 12 0 14 #e0e0e0 #202020 0;
#X obj 6 365 cnv 3 550 3 empty empty inlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 5 481 cnv 3 550 3 empty empty outlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 6 556 cnv 3 550 3 empty empty arguments 8 12 0 13 #dcdcdc #000000 0;
#X obj 87 373 cnv 17 3 80 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 86 491 cnv 17 3 17 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X text 162 388 bang;
#X obj 86 458 cnv 17 3 17 empty empty 1 5 9 0 16 #dcdcdc #9c9c9c 0;
#X text 155 458 float;
#X text 136 564 1) float;
#X obj 162 255 print uzi;
#X obj 187 168 bng 17 250 50 0 empty empty empty 0 -6 0 8 #dcdcdc #000000 #000000;
#X floatatom 280 181 0 0 100 0 - - - 0;
#X text 160 490 bang;
#X text 154 534 float;
#X obj 86 512 cnv 17 3 17 empty empty 1 5 9 0 16 #dcdcdc #9c9c9c 0;
#X text 160 512 bang;
#X obj 86 532 cnv 17 3 17 empty empty 2 5 9 0 16 #dcdcdc #9c9c9c 0;
#X text 136 581 2) float;
#X obj 310 254 print counter;
#X text 156 372 float;
#X text 202 581 - sets the counter starting point (offset) - default 1;
#X text 202 435 - sets the starting point of the counter;
#X obj 132 177 nbx 4 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X msg 211 180 offset \$1;
#X floatatom 211 158 5 0 0 0 - - - 0;
#X obj 310 236 nbx 6 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 120 404 pause/break;
#X text 96 420 resume/continue;
#X text 102 436 offset <float>;
#X text 202 404 - stops banging/counting;
#X text 202 534 - bang counter;
#X obj 187 211 cyclone/uzi 10 0;
#X obj 233 255 print done;
#X text 202 388 - starts the banging/counting loop;
#X text 202 420 - restarts banging/counting after being paused;
#X text 202 457 - sets the number of bangs to output;
#X text 202 490 - bang according to the counter loop;
#X text 202 564 - sets the number of bangs (default 0);
#X text 202 512 - bangs after the last bang in the loop has fired;
#N canvas 588 148 611 332 array 0;
#X obj 98 114 bng 20 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X obj 98 154 cyclone/uzi 100 0;
#X obj 197 188 tabread array;
#N canvas 0 22 450 278 (subpatch) 0;
#X array array 100 float 1;
#A 0 -0.585727 -0.585727 -0.585727 -0.585727 -0.585727 -0.585727 -0.585727 -0.580965 -0.576203 -0.571441 -0.547631 -0.523821 -0.500011 -0.457153 -0.300006 -0.171432 -0.0714296 5.96046e-07 0.0285727 0.0571448 0.0857168 0.104765 0.123813 0.142861 0.157147 0.171433 0.185719 0.200005 0.214291 0.228577 0.242863 0.250006 0.257149 0.263499 0.269848 0.276197 0.282547 0.288896 0.295245 0.301595 0.307944 0.314294 0.314294 0.314294 0.314294 0.314294 0.314294 0.291436 0.268578 0.245721 0.222863 0.200005 0.166671 0.133337 0.100003 0.0828596 0.0657164 0.0485731 0.0314299 0.0142866 0.0142866 0.0142866 0.0142866 0.0392872 0.0642878 0.0892884 0.114289 0.16429 0.214291 0.257149 0.300007 0.32858 0.357152 0.385724 0.402867 0.42001 0.437153 0.454297 0.47144 0.476202 0.480964 0.485726 0.489298 0.492869 0.496441 0.500012 0.500012 0.500012 0.500012 0.500012 0.500012 0.500012 0.500012 0.500012 0.500012 0.500012 0.500012 0.500012 0.514298 0.714303;
#X coords 0 1 99 -1 200 140 1 0 0;
#X restore 329 124 graph;
#X obj 197 224 print;
#X text 117 38 [uzi] is useful for sweeping through arrays \, using the counter as the index input.;
#X connect 0 0 1 0;
#X connect 1 2 2 0;
#X connect 2 0 4 0;
#X restore 450 252 pd array sweep;
#N canvas 286 108 836 544 pause/resume 0;
#X msg 220 415 pause;
#X obj 115 256 bng 20 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X obj 115 326 cyclone/uzi 10 101;
#X msg 134 294 resume;
#X obj 571 337 bng 20 250 50 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000;
#X obj 669 439 print;
#X msg 652 495 break;
#X msg 526 307 continue;
#X msg 624 383 offset 11;
#X msg 604 337 offset -9;
#X obj 652 465 sel 5;
#X obj 220 385 select 105;
#X obj 116 418 print bangs;
#X obj 234 360 print counter;
#X text 30 93 [uzi] iterates in a programming loop fashion. So \, once it starts \, it goes all the way to the end as fast as possible. In order to stop it \, you need to break the loop with some logic as below \, where we use [select] to pause [uzi] when the counter reaches "105".;
#X text 31 172 Thus \, before breaking the loop \, it sends 5 bangs (corresponding from 101 to 105 in the counter). You can then continue to output the remaining 5 bangs (from 106 to 110) with the "resume" message.;
#X text 37 478 This may be useful to perform a special oeration in the middle of the loop.;
#X obj 33 35 cnv 15 140 30 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#X text 143 259 <= start;
#X text 185 294 <= resume;
#X text 436 34 You can also use "break" isntead of "pause" and "continue" isntead of "resume".;
#X msg 613 359 offset 1;
#X text 438 78 After pausing [uzi] \, you can reset the offset value. This changes the total number of bangs being sent in the end. In the example below \, if you break and continue without changing the offset \, it goes from 1 to 5 \, then 6 to 10 \, but lets change the offset after the break and before continuing and see what happens.;
#X text 439 164 If you increase the offset from "1" to "11" \, the counter target is supposed to be "20" \, so it continues from 6 until reaching 20!;
#X text 439 214 But if you decrease the offset from "1" to "-9" \, the counter target is supposed to be "0". Imn this case \, it cannot continue outputting any bangs \, because the counter is already past the target \, so it only outputs a bang in the middle outlet saying it's done!;
#X obj 571 411 cyclone/uzi 10;
#X text 48 42 pause/resume;
#X connect 0 0 2 0;
#X connect 1 0 2 0;
#X connect 2 0 12 0;
#X connect 2 2 11 0;
#X connect 2 2 13 0;
#X connect 3 0 2 0;
#X connect 4 0 25 0;
#X connect 6 0 25 0;
#X connect 7 0 25 0;
#X connect 8 0 25 0;
#X connect 9 0 25 0;
#X connect 10 0 6 0;
#X connect 11 0 0 0;
#X connect 21 0 25 0;
#X connect 25 2 5 0;
#X connect 25 2 10 0;
#X restore 444 227 pd pause/resume;
#X text 70 84 [uzi] loops firing a given number of bangs (left outlet) and outputs a count for each bang (right outlet). The middle outlet bangs after the loop is done. The 1st argument is the number of bangs. The counter starts from a given offset (2nd argument).;
#X text 202 371 - sets the number of bangs and starts the loop;
#X obj 4 4 ./header uzi;
#X text 22 61 Bang loop/counter;
#X text 72 315 see also:;
#X obj 401 333 open-else;
#X text 435 305 click;
#X msg 401 305 loop;
#X text 143 312 Plugdata users or those with ELSE can also use [else/loop] as an alternative., f 39;
#X connect 11 0 32 0;
#X connect 12 0 32 1;
#X connect 23 0 32 0;
#X connect 24 0 32 0;
#X connect 25 0 24 0;
#X connect 26 0 19 0;
#X connect 32 0 10 0;
#X connect 32 1 33 0;
#X connect 32 2 26 0;
#X connect 49 0 47 0;
