unsigned LI_FrameVO()
{
int delay;
if((state.voOsc.delay - state.voR1) < (state.voEnv.delay - state.voR2))
{
if(state.voOsc.sync && state.current.syncSw == LI_SYNC_B)
{
NeAttackDecayReset(state.voEnv);
}
state.voOutC = NeMoscSample(state.voOsc, state.morph, state.voMod);
delay = state.voOsc.delay - state.voR1;
if(delay < 0) delay = 0;
state.voR1 = 0;
state.voR2 += delay;
}
else
{
state.voOutE = NeAttackDecayOscSample(state.voEnv);
state.voMod = fix24_mul(state.voModAmt, 2 * (state.voOutE - FIX24_HALF));
if(state.voEnv.reset && state.current.syncSw == LI_SYNC_A)
{
NeMoscReset(state.voOsc);
}
delay = state.voEnv.delay - state.voR2;
if(delay < 0) delay = 0;
state.voR2 = 0;
state.voR1 += delay;
}
fix24 out = 0;
out = NeFoldSample(state.fold, state.voOutC);
out = fix24_mul(state.voOutE, out);
out = fix24_mul(state.voMComp,out);
out = fix24_soft_clip_poly(out);
return fix24_to_u16_audio_delay(out, delay);
}
Code: VO
Noise Engineering
Loquelic Iteritas
Complex Digital Oscilator
11