void LFDClipNoise_next(LFDClipNoise *unit, int inNumSamples) { float *out = ZOUT(0); float *freq = ZIN(0); float level = unit->mLevel; float phase = unit->mPhase; float smpdur = SAMPLEDUR; RGET LOOP1(inNumSamples, phase -= ZXP(freq) * smpdur; if (phase < 0) { phase = sc_wrap(phase, 0.f, 1.f); level = fcoin(s1,s2,s3); } ZXP(out) = level; )
void LFDClipNoise_next_k(LFDClipNoise *unit, int inNumSamples) { float *out = ZOUT(0); float freq = ZIN0(0); float level = unit->mLevel; float phase = unit->mPhase; float smpdur = SAMPLEDUR; float dphase = smpdur * freq; RGET LOOP(inNumSamples, phase -= dphase; if (phase <= 0) { phase = sc_wrap(phase, 0.f, 1.f); level = fcoin(s1,s2,s3); } ZXP(out) = level; )