bool32.risingfalling or 'mode'
bool32.rising reset phase
frac32 reset phase to position
int32 length in samples
int32 multiplies 'factor'
frac32 phase 0. till 64.
int32 step index from 0 to 'steps'
bool32.pulse 24 ppq pulse
int32 multiplication or division factor
bool32.tgl 0 = multiply, 1 = divide
combo how many steps per bar?
uint32_t Phase;
uint32_t r;
uint64_t freq;
uint32_t base;
uint8_t factor;
uint8_t steps;
uint32_t prev;
uint32_t ppq;
Phase = 0;
r = 1;
factor = ((inlet_factor) ? inlet_factor : 1) * param_factor;
base =
(param_mode || inlet_mode) ? (inlet_smps * factor) : (inlet_smps / factor);
freq = (int)(281474976710656.f / (base * (128 << 3)));
steps = 29 - attr_steps;
{
if (inlet_reset && r) {
Phase = inlet_topos << 5;
r = 0;
} else {
if (!inlet_reset)
r = 1;
Phase += freq >> 2;
}
outlet_phase = (Phase >> 5);
outlet_step = (Phase >> steps);
ppq = ((Phase >> 25) * 3) >> 2;
if (ppq != prev) {
outlet_24ppq = 1;
prev = ppq;
} else
outlet_24ppq = 0;
}