#N canvas 406 25 640 708 12;
#X obj 25 12 metro;
#X floatatom 175 426 5 0 0 0 - - - 0;
#X msg 30 242 1;
#X text 93 242 nonzero number or "bang" to start;
#X msg 77 270 0;
#X msg 110 270 stop;
#X text 23 677 see also:;
#X obj 143 677 timer;
#X obj 298 603 metro 1 120 permin, f 19;
#X obj 256 551 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X obj 96 677 delay;
#X text 148 269 zero or "stop" to stop;
#X msg 428 516 0.5;
#X msg 464 516 1;
#X msg 393 516 4;
#X text 495 514 beat length;
#X msg 298 551 tempo \$1 permin;
#X floatatom 298 515 5 0 0 0 - - - 0;
#X msg 125 299 tempo 0.5 msec;
#X text 235 292 set units to 1/2 millisecond so that '1000' gives a time interval of 500 msec (1/2 second)., f 47;
#X msg 134 327 tempo 2 permillisecond;
#X text 280 353 same as 1 msec \, so '1000' is a second.;
#X text 297 327 this is the same as above.;
#X obj 66 463 metro 500 1 msec;
#X text 60 599 A metronome at intervals of one beat at 120 beats per minute:, f 31;
#X floatatom 428 577 5 0 0 0 - - - 0;
#X text 203 552 on/off;
#X text 202 514 change tempo;
#X msg 145 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 151 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 190 463 <= arguments:;
#X text 288 463 - delay time (float) \, tempo (float) and time unit (symbol) as in "tempo" message., f 41;
#X obj 428 553 expr 1/$f1;
#X text 427 678 updated for Pd version 0.48;
#X obj 66 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 430 308 random 0;
#X obj 104 206 metro;
#X obj 136 151 expr random(500 \, 1001);
#X floatatom 136 179 5 0 0 0 - - - 0;
#X obj 104 116 tgl 19 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X obj 104 246 bng 19 250 50 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000;
#X text 32 30 This example shows us how to implement a metronome with random time values. At each bang output \, a new time value is set. Note that in this case the time value takes effect right away for the current period., f 53;
#X connect 0 0 1 0;
#X connect 0 0 4 0;
#X connect 1 0 2 0;
#X connect 2 0 0 1;
#X connect 3 0 0 0;
#X restore 490 621 pd random example;
#X obj 66 493 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X obj 298 630 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X text 216 420 right inlet sets the time (if set between beats \, it only takes effect in the next beat \, unlike the tempo message).;
#X connect 1 0 23 1;
#X connect 2 0 23 0;
#X connect 4 0 23 0;
#X connect 5 0 23 0;
#X connect 8 0 46 0;
#X connect 9 0 8 0;
#X connect 12 0 40 0;
#X connect 13 0 40 0;
#X connect 14 0 40 0;
#X connect 16 0 8 0;
#X connect 17 0 16 0;
#X connect 18 0 23 0;
#X connect 20 0 23 0;
#X connect 23 0 45 0;
#X connect 25 0 8 1;
#X connect 28 0 23 0;
#X connect 40 0 25 0;
#X connect 42 0 23 0;
