int32 length in samples
frac32.positive scaling factor
frac32.positive pos
bool32.rising reset phase to 'pos'
frac32 phase 0. till 64.
int32 step index from 0 to 'steps'
int32 length in k-ticks
bool32.pulse 24 ppq pulse
frac32.u.map factor
combo how many steps per bar?
uint32_t Phase;
uint32_t pos;
uint32_t r;
uint64_t freq;
uint32_t base;
uint32_t factor;
uint8_t steps;
uint32_t prev;
uint32_t ppq;
Phase = 0;
r = 1;
factor = (param_factor + inlet_factor) >> 16;
base = (inlet_kticks << 5) / factor;
freq = (int)(281474976710656.f / (base * (128 << 7)));
steps = 29 - attr_steps;
{
if (inlet_reset && r) {
Phase = inlet_pos << 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;
}
outlet_kticks = base;