diff --git a/plugins/Nekobi/nekobee-src/nekobee_voice.c b/plugins/Nekobi/nekobee-src/nekobee_voice.c index e0ec1f0..e223b61 100644 --- a/plugins/Nekobi/nekobee-src/nekobee_voice.c +++ b/plugins/Nekobi/nekobee-src/nekobee_voice.c @@ -59,6 +59,9 @@ nekobee_voice_note_on(nekobee_synth_t *synth, nekobee_voice_t *voice, voice->key = key; voice->velocity = velocity; voice->vcf_eg = 9.8f; + voice->vca_eg = 1.0f; + // 1.5M and 1uF + voice->vca_tc = 1 / 1.5 * synth->deltat; if (!synth->monophonic || !(_ON(voice) || _SUSTAINED(voice))) { @@ -181,6 +184,9 @@ nekobee_voice_note_off(nekobee_synth_t *synth, nekobee_voice_t *voice, { unsigned char previous_top_key; + voice->vca_tc = 1 / 0.0022 * synth->deltat; + + /* save release velocity */ voice->velocity = rvelocity; diff --git a/plugins/Nekobi/nekobee-src/nekobee_voice_render.c b/plugins/Nekobi/nekobee-src/nekobee_voice_render.c index 90e3903..9ba69f6 100644 --- a/plugins/Nekobi/nekobee-src/nekobee_voice_render.c +++ b/plugins/Nekobi/nekobee-src/nekobee_voice_render.c @@ -119,6 +119,7 @@ void vcf(nekobee_synth_t *synth, float *out, uint32_t count) { delay3 = voice->delay3, delay4 = voice->delay4; float vcf_eg = voice->vcf_eg; + float vca_eg = voice->vca_eg; float delayhp = voice->delayhp; // to get the correct cutoff first we need Q10's collector current @@ -193,8 +194,10 @@ void vcf(nekobee_synth_t *synth, float *out, uint32_t count) { delayhp = hp; fout = delay4-hp; } - out[i] = fout; + out[i] = fout * vca_eg; vcf_eg *= 1 - voice->vcf_tc; + vca_eg *= 1 - voice->vca_tc; + } voice->delay1 = delay1; voice->delay2 = delay2; @@ -202,6 +205,8 @@ void vcf(nekobee_synth_t *synth, float *out, uint32_t count) { voice->delay4 = delay4; voice->vcf_eg = vcf_eg; + voice->vca_eg = vca_eg; + voice->delayhp = delayhp; }