Hallo,
Andrew Faraday hat gesagt: // Andrew Faraday wrote:
> Any tap tempo device is tricky, simply put you probably won't be able to tap
> consistently enough to keep the figure consistent. Which is why a lot of
> commercial tap tempos have some form of averaging algorithm. With a bit of
> practice you can get close enough to match existing music for maybe 4 or 8
> bars. Here's the clever bit, if you're working with live (electronic or
> acoustic) musicians they will usually start to sync up to drums in this time,
> assuming they're close to the original tempo.
Attached is a tap-tempo example patch, that does a bit of averaging over a
buffer of a configurable size and also tries to rate your performance by the
flatness of the tap-interval curve (using the ratio of geometric and arithemtic
mean).
Ciao
--
Frank
#N canvas 96 134 1063 614 10;
#X obj 139 120 timer;
#X obj 139 89 t b b;
#X obj 139 33 key;
#X obj 139 58 select 32;
#X obj 139 354 /;
#X floatatom 154 377 5 0 0 0 - - -;
#X obj 458 261 list prepend 0;
#N canvas 0 0 450 300 (subpatch) 0;
#X array \$0-taps 8 float 0;
#X coords 0 1000 7 50 200 140 1;
#X restore 704 352 graph;
#X obj 909 354 vsl 15 135 50 1000 0 0 empty \$0-gmean gm 0 -9 0 10
-262144 -1 -1 6571 1;
#X obj 925 354 vsl 15 135 50 1000 0 0 empty \$0-mean mean 0 -9 0 10
-262144 -1 -1 6582 1;
#X obj 303 376 cnv 15 100 60 empty \$0-quality Good 10 35 0 30 -191407
-1 0;
#X obj 139 492 s \$0-quality;
#X msg 213 456 label Good;
#X obj 139 430 moses 0.99;
#X text 219 430 <= adjust!;
#N canvas 333 172 609 314 filter-range 0;
#X obj 143 178 outlet;
#X obj 210 178 outlet;
#X obj 210 150 b;
#X obj 143 81 moses 2000;
#X text 248 83 filter viable range \, reset else (Handel \, 1989);
#X obj 79 54 inlet;
#X obj 79 80 moses 50;
#X text 270 181 reset timer from here;
#X connect 2 0 1 0;
#X connect 3 0 0 0;
#X connect 3 1 2 0;
#X connect 5 0 6 0;
#X connect 6 0 2 0;
#X connect 6 1 3 0;
#X restore 139 144 pd filter-range;
#X text 220 58 tab with spacebar;
#X obj 274 291 s \$0-mean;
#X obj 148 312 s \$0-gmean;
#X obj 139 212 t a a a;
#X msg 139 456 label Bad;
#X obj 157 395 hsl 128 15 0 1 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 12680 1;
#X obj 458 284 s \$0-taps;
#N canvas 534 229 450 300 show-bpm 0;
#X floatatom 107 144 5 0 0 1 IOI_in_bpm - -;
#X floatatom 107 126 5 0 0 1 IOI - -;
#N canvas 0 0 450 300 ms2bpm 0;
#X obj 93 50 inlet;
#X obj 93 102 swap 6;
#X obj 93 131 /;
#X obj 93 182 outlet;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 1 1 2 1;
#X connect 2 0 3 0;
#X restore 248 99 pd ms2bpm;
#X obj 248 37 inlet;
#X connect 2 0 0 0;
#X connect 3 0 1 0;
#X connect 3 0 2 0;
#X coords 0 -1 1 1 125 60 1 100 100;
#X restore 430 378 pd show-bpm;
#N canvas 534 229 450 300 show-bpm 0;
#X floatatom 107 144 5 0 0 1 IOI_in_bpm - -;
#X floatatom 107 126 5 0 0 1 IOI - -;
#N canvas 0 0 450 300 ms2bpm 0;
#X obj 93 50 inlet;
#X obj 93 102 swap 6;
#X obj 93 131 /;
#X obj 93 182 outlet;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 1 1 2 1;
#X connect 2 0 3 0;
#X restore 248 99 pd ms2bpm;
#X obj 248 37 inlet;
#X connect 2 0 0 0;
#X connect 3 0 1 0;
#X connect 3 0 2 0;
#X coords 0 -1 1 1 125 60 1 100 100;
#X restore 566 378 pd show-bpm;
#X obj 566 352 r \$0-mean;
#X obj 430 352 r \$0-gmean;
#X obj 65 179 s \$0-last;
#N canvas 534 229 450 300 show-bpm 0;
#X floatatom 107 144 5 0 0 1 IOI_in_bpm - -;
#X floatatom 107 126 5 0 0 1 IOI - -;
#N canvas 0 0 450 300 ms2bpm 0;
#X obj 93 50 inlet;
#X obj 93 102 swap 6;
#X obj 93 131 /;
#X obj 93 182 outlet;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 1 1 2 1;
#X connect 2 0 3 0;
#X restore 248 99 pd ms2bpm;
#X obj 248 37 inlet;
#X connect 2 0 0 0;
#X connect 3 0 1 0;
#X connect 3 0 2 0;
#X coords 0 -1 1 1 125 60 1 100 100;
#X restore 432 172 pd show-bpm;
#X obj 432 148 r \$0-last;
#X obj 628 144 s \$0-taps;
#X msg 628 120 resize \$1;
#X obj 212 178 r \$0-buffer-size;
#X obj 711 142 s \$0-buffer-size;
#X floatatom 628 94 5 0 0 0 - - -;
#X msg 628 68 8;
#X msg 665 67 16;
#X msg 573 282 510.839 464.399 534.059 510.839 505.034 510.839 522.449
574.694;
#N canvas 0 0 566 431 geometric-mean 0;
#X obj 127 69 inlet;
#X obj 127 337 outlet;
#X obj 146 138 list-drip;
#X obj 146 164 route float;
#X obj 127 274 f;
#X obj 254 250 pow -1;
#X obj 146 193 pow;
#N canvas 370 313 450 300 product 0;
#X obj 135 79 inlet;
#X obj 182 79 inlet;
#X obj 135 169 outlet;
#X obj 168 138 f;
#X obj 135 137 *;
#X obj 182 102 1;
#X connect 0 0 4 0;
#X connect 1 0 5 0;
#X connect 3 0 4 1;
#X connect 4 0 2 0;
#X connect 4 0 3 0;
#X connect 5 0 4 1;
#X restore 146 225 pd product;
#X obj 127 105 t b a b a;
#X obj 254 222 list length;
#X connect 0 0 8 0;
#X connect 2 0 3 0;
#X connect 3 0 6 0;
#X connect 4 0 1 0;
#X connect 5 0 6 1;
#X connect 6 0 7 0;
#X connect 7 0 4 1;
#X connect 8 0 4 0;
#X connect 8 1 2 0;
#X connect 8 2 7 1;
#X connect 8 3 9 0;
#X connect 9 0 5 0;
#X restore 139 270 pd geometric-mean;
#N canvas 0 0 566 431 arithmetic-mean 0;
#X obj 127 69 inlet;
#X obj 127 337 out