vca, but envelopes need work
This commit is contained in:
parent
0b66a8d893
commit
2d0e58a3ed
|
@ -59,6 +59,9 @@ nekobee_voice_note_on(nekobee_synth_t *synth, nekobee_voice_t *voice,
|
||||||
voice->key = key;
|
voice->key = key;
|
||||||
voice->velocity = velocity;
|
voice->velocity = velocity;
|
||||||
voice->vcf_eg = 9.8f;
|
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))) {
|
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;
|
unsigned char previous_top_key;
|
||||||
|
|
||||||
|
voice->vca_tc = 1 / 0.0022 * synth->deltat;
|
||||||
|
|
||||||
|
|
||||||
/* save release velocity */
|
/* save release velocity */
|
||||||
voice->velocity = rvelocity;
|
voice->velocity = rvelocity;
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,7 @@ void vcf(nekobee_synth_t *synth, float *out, uint32_t count) {
|
||||||
delay3 = voice->delay3, delay4 = voice->delay4;
|
delay3 = voice->delay3, delay4 = voice->delay4;
|
||||||
|
|
||||||
float vcf_eg = voice->vcf_eg;
|
float vcf_eg = voice->vcf_eg;
|
||||||
|
float vca_eg = voice->vca_eg;
|
||||||
float delayhp = voice->delayhp;
|
float delayhp = voice->delayhp;
|
||||||
|
|
||||||
// to get the correct cutoff first we need Q10's collector current
|
// 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;
|
delayhp = hp;
|
||||||
fout = delay4-hp;
|
fout = delay4-hp;
|
||||||
}
|
}
|
||||||
out[i] = fout;
|
out[i] = fout * vca_eg;
|
||||||
vcf_eg *= 1 - voice->vcf_tc;
|
vcf_eg *= 1 - voice->vcf_tc;
|
||||||
|
vca_eg *= 1 - voice->vca_tc;
|
||||||
|
|
||||||
}
|
}
|
||||||
voice->delay1 = delay1;
|
voice->delay1 = delay1;
|
||||||
voice->delay2 = delay2;
|
voice->delay2 = delay2;
|
||||||
|
@ -202,6 +205,8 @@ void vcf(nekobee_synth_t *synth, float *out, uint32_t count) {
|
||||||
voice->delay4 = delay4;
|
voice->delay4 = delay4;
|
||||||
|
|
||||||
voice->vcf_eg = vcf_eg;
|
voice->vcf_eg = vcf_eg;
|
||||||
|
voice->vca_eg = vca_eg;
|
||||||
|
|
||||||
voice->delayhp = delayhp;
|
voice->delayhp = delayhp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue