Does anyone know if gettimeofday() works in the Owl and if it returns sensible values for microseconds? Trying to get accurate clock measurements.
There’s no default implementation of gettimeofday()
but you can provide your own if you need it.
To get the exact number of processor cycles since the start of the current audio block use Patch::getElapsedCycles()
, see https://www.hoxtonowl.com/docs/classPatch.html
To convert to seconds divide the cycles by the MCU clock speed: 168MHz.
To get a simple measure of the time available use getElapsedBlockTime()
which returns a percentage value (0 to 1) of elapsed time.
There are 3500 processor cycles available per sample (168MHz / 48kHz sampling rate), so the total cycles available to an audio block is 3500*blocksize, minus overheads of a few hundred cycles.