Salut à tous. Voici un portage de TapTempo en Forth.
5 set-precision
6 Constant steps
: now utime drop ;
: calc-tempo steps 60 1000 1000 * * * s>f drop now swap - s>f f/ ;
: print-tempo ." Tempo: " f. ." bpm" cr ;
: restart now steps ;
: main
." Appuyer sur la touche entrée en cadence (q pour quitter)." cr
restart
begin
key 113 <> while 1- dup 0 = if calc-tempo print-tempo restart
(…)