IO Variants: 2
Variant: 1
bool32.rising Reset phase
int32.positive BPM, integer
int32.positive BPM, tenths
int32.positive BPM, hundredths
bool32 BPM clock output
uint32_t phase;
int32_t old_reset;
phase = 0;
old_reset = 0;
float bpm;
uint32_t pacc;
bpm = inlet_bpm + inlet_tenth * 0.1f + inlet_hundredth * 0.01f;
// pacc = (uint32_t) ( bpm / 3000.0f / 60.0f * 4294967296 );
pacc = (uint32_t)(bpm * 23860.92942222222);
if (inlet_reset && !old_reset) {
phase = 0;
} else {
phase += pacc;
}
old_reset = inlet_reset;
if (phase > 0x80000000) {
outlet_out = 1;
} else {
outlet_out = 0;
}
Variant: 2
bool32.rising Reset phase
bool32 BPM clock output
int32 bpm
int32 tenth
int32 hundredth
uint32_t phase;
int32_t old_reset;
phase = 0;
old_reset = 0;
float bpm;
uint32_t pacc;
bpm = param_bpm + param_tenth * 0.1f + param_hundredth * 0.01f;
// pacc = (uint32_t) ( bpm/3000.0f/60.0f * 4294967296 );
pacc = (uint32_t)(bpm * 23860.92942222222);
if (inlet_reset && !old_reset) {
phase = 0;
} else {
phase += pacc;
}
old_reset = inlet_reset;
if (phase > 0x80000000) {
outlet_out = 1;
} else {
outlet_out = 0;
}