int32 samples in
bool32.rising rphase
bool32.rising reset phase
int32.positive 1barLength
frac32.positive phase
uint32_t Phase;
uint64_t freq;
bool rphase;
bool rspeed;
Phase = 0;
if (inlet_rspeed && !rspeed) {
freq = (int)((281474976710656.f / (inlet_smps * (128 << 3))) *
((((unsigned int)inlet_smps) / (inlet_1barLength * 48000)) + 1));
rspeed = 1;
}
if (inlet_rphase && !rphase) {
Phase = 0;
rphase = 1;
}
Phase += freq >> 2;
outlet_wave = (Phase >> 5) & ((1 << 27) - 1);
if (!inlet_rphase)
rphase = 0;
if (!inlet_rspeed)
rspeed = 0;