implement beat loop, with built-in tempo updating