#N canvas 406 47 639 709 12;
#X obj 25 12 metro;
#X floatatom 157 426 5 0 0 0 - - - 0;
#X msg 22 242 1, f 2;
#X text 75 242 nonzero number or "bang" to start;
#X msg 59 270 0, f 2;
#X msg 86 270 stop;
#X text 23 677 see also:;
#X obj 143 677 timer;
#X obj 304 603 metro 1 120 permin, f 19;
#X obj 274 550 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X obj 96 677 delay;
#X text 124 269 zero or "stop" to stop;
#X msg 434 516 0.5;
#X msg 470 516 1;
#X msg 399 516 4;
#X msg 304 551 tempo \$1 permin;
#X floatatom 304 515 5 0 0 0 - - - 0;
#X msg 101 299 tempo 0.5 msec;
#X msg 110 327 tempo 2 permillisecond;
#X text 273 327 this is the same as above.;
#X obj 48 463 metro 500 1 msec;
#X text 66 599 A metronome at intervals of one beat at 120 beats per minute:, f 31;
#X floatatom 434 577 5 0 0 0 - - - 0;
#X text 221 551 on/off;
#X text 255 507 change tempo, f 6;
#X msg 121 354 tempo 0.001 second;
#X obj 191 677 text sequence;
#X text 74 11 - send a bang message periodically (a la metronome);
#X text 127 379 Note that if the tempo is changed while the metro is running \, the change takes effect to the remaining fraction of the beat., f 62;
#X obj 6 42 cnv 1 625 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#N canvas 759 166 577 341 reference 0;
#X obj 8 44 cnv 5 550 5 empty empty INLETS: 8 18 0 13 #202020 #000000 0;
#X obj 8 202 cnv 2 550 2 empty empty OUTLET: 8 12 0 13 #202020 #000000 0;
#X obj 8 239 cnv 2 550 2 empty empty ARGUMENT: 8 12 0 13 #202020 #000000 0;
#X obj 7 313 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0;
#X obj 7 165 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0;
#X obj 7 76 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0;
#X obj 23 14 metro;
#X text 72 13 - send a bang message periodically (a la metronome);
#X text 140 82 float -;
#X text 147 101 bang -;
#X text 147 120 stop -;
#X text 28 138 tempo <float \, symbol> -;
#X text 197 138 set tempo value (float) and time unit symbol., f 46;
#X text 197 101 start the metronome., f 46;
#X text 197 82 non zero starts and zero stops the metronome., f 46;
#X text 197 120 stop the metronome., f 46;
#X text 140 177 float -;
#X text 197 177 set metronome time for the next tempo., f 46;
#X text 146 214 bang - bang at a periodic time., f 54;
#X text 140 269 2) float - tempo value (default 1)., f 54;
#X text 133 289 3) symbol - time unit (default 'msec')., f 55;
#X text 140 250 1) float - initial metronome time (default 1)., f 54;
#X restore 460 9 pd reference;
#X text 554 11 <= click;
#X obj 6 664 cnv 1 625 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X text 57 148 - millisecond (msec for short) \; - seconds (sec) \; - minutes (min) \; - samples (samp), f 32;
#X text 200 171 These symbols can also be preceded by "per" (as in "permin" \, "permsec" \, etc.) In this case \, 60 permin means 1/60 min (hence \, the same as 'BPM'). 'samps' depends on the sample rate the patch is running., f 52;
#X text 172 463 <= arguments:;
#X text 270 463 - delay time (float) \, tempo (float) and time unit (symbol) as in "tempo" message., f 41;
#X obj 434 553 expr 1/$f1;
#X text 427 678 updated for Pd version 0.48;
#X obj 48 242 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X text 26 53 The [metro] object sends a series of bangs at regular time intervals. The left inlet takes a nonzero number or "bang" to start and 0 or 'stop' to stop it. The time is set via the right inlet or first argument. The default time unit is 1 millisecond but you can change this via the 2nd and 3rd argument or the "tempo" message (as in [timer] \, [delay] and [text sequence]) \, which set a different tempo number and a time unit symbol. Possible symbols are:, f 84;
#N canvas 689 94 429 349 random 0;
#X obj 160 159 expr random(500 \, 1001);
#X floatatom 160 187 5 0 0 0 - - - 0;
#X obj 128 124 tgl 19 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X obj 128 254 bng 19 250 50 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000;
#X obj 128 214 metro;
#X text 32 26 This example shows us how to implement a metronome with random time values. At each bang output \, a new random time value is set. Note that in this case we have a loop and the time value takes effect right away for the current period., f 53;
#X connect 0 0 1 0;
#X connect 1 0 4 1;
#X connect 2 0 4 0;
#X connect 4 0 0 0;
#X connect 4 0 3 0;
#X restore 489 626 pd random example;
#X obj 48 493 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X obj 304 630 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X text 198 420 right inlet sets the time (if set between beats \, it only takes effect in the next beat \, unlike the tempo message).;
#X text 211 292 set units to 1/2 millisecond so that a time of '1000' gives an interval of 500 msec (1/2 second)., f 54;
#X text 256 353 same as 1 msec \, so '1000' time results in a second.;
#X text 475 577 change beat length;
#X text 59 527 Note: "0" or less time/tempo values become "1"!, f 17;
#X connect 1 0 20 1;
#X connect 2 0 20 0;
#X connect 4 0 20 0;
#X connect 5 0 20 0;
#X connect 8 0 43 0;
#X connect 9 0 8 0;
#X connect 12 0 37 0;
#X connect 13 0 37 0;
#X connect 14 0 37 0;
#X connect 15 0 8 0;
#X connect 16 0 15 0;
#X connect 17 0 20 0;
#X connect 18 0 20 0;
#X connect 20 0 42 0;
#X connect 22 0 8 1;
#X connect 25 0 20 0;
#X connect 37 0 22 0;
#X connect 39 0 20 0;
