int32.positive 24ppq
frac32.positive pos64q
int ppq = 0;
int ppqprev = 0;
float counter = 0;
int ppqcount = 0;
float bpm = 0;
uint32_t phase = 0;
counter += 1;
phase += bpm * (2796202.6667);
ppq = inlet_24ppq - 1536 * (inlet_24ppq / 1536);
if (ppq != ppqprev) {
phase = ppq * 2796202.6667f;
bpm = 1.0f / counter;
counter = 0;
}
ppqprev = ppq;
outlet_pos64q = phase >> 5;
// the bpm variable does not really contain bpm information..