diff --git a/plugins/Nekobi/nekobee-src/nekobee_voice_render.c b/plugins/Nekobi/nekobee-src/nekobee_voice_render.c index f5fef08..90e3903 100644 --- a/plugins/Nekobi/nekobee-src/nekobee_voice_render.c +++ b/plugins/Nekobi/nekobee-src/nekobee_voice_render.c @@ -165,12 +165,25 @@ void vcf(nekobee_synth_t *synth, float *out, uint32_t count) { // printf("cutoff = %04fHz, ct=%f\n", cutoff, ct); float hpc = 6.28 * 16 * synth->deltat; - float fout, hp; + float fout, fb, hp; for (uint32_t i = 0; i < count; i++) { for (uint32_t ovs = 0; ovs < 4; ovs++) { float in = voice->osc_audio[i]; - float fb = tanh(in - ((fout - 0.25*in) * synth->resonance * 6)); + + float clip = 1.0; + fb = (in - ((fout - .33*in) * synth->resonance * 4)) / clip; + + //fb = in * synth->resonance*5; + + if (fb > 1) fb=1; + if (fb < -1) fb=-1; + + fb = 1.5 * fb - 0.5 * fb*fb*fb; + + fb *= clip; + + //fb *= 0.5; delay1 = ((fb - delay1) * ct) + delay1; delay2 = ((delay1 - delay2) * ct) + delay2;