1
0
Fork 0

Enveloping the cicada

This commit is contained in:
Rodrigo Franco 2023-12-04 12:40:01 -03:00
parent ed11b9c5e6
commit 24885df532
1 changed files with 2 additions and 1 deletions

View File

@ -75,7 +75,7 @@ void update_cicada_osc(cicada_osc_t* c, osc_t* o, int* timer) {
c->saturation=0;
o->value = tanh(c->saturation * o->value);
// Cicada sound is inactive, check if it should start
if (rand() % 1000000 < 5) {
if ((rand() % 10000) < 5) {
*timer = rand() % (16000 * 100);
}
}
@ -170,6 +170,7 @@ int main() {
}
update_cicada_osc(&cicadaOsc, &randOsc, &cicadaTimer);
update_tape_osc(&tapeOsc, &randOsc);
out = zero_oh_five*randOsc.value/2 +
zero_oh_five*oscbank[0].value +