int32 24ppq
int32 bpm
int32 mill
int32 1000bpm
int counter;
int tcount;
bool ttrig;
int bpm;
int mill;
int _1000bpm;
int ppq_previous;
counter = 0;
ttrig = 0;
tcount = 0;
bpm = 0;
mill = 0;
_1000bpm = 0;
counter += 1;
if (inlet_24ppq != ppq_previous) {
ppq_previous = inlet_24ppq;
tcount += 1;
if (tcount > 23) {
bpm = 180000 / counter;
_1000bpm = 180000000 / counter;
mill = _1000bpm - bpm * 1000;
tcount = 0;
counter = 0;
}
}
outlet_mill = mill;
outlet_bpm = bpm;
outlet_1000bpm = _1000bpm;