Update default envelope

This commit is contained in:
Bad Diode 2023-10-17 21:17:07 +02:00 committed by neauoire
parent 8f3d7b9020
commit 1d7c96dd3d
1 changed files with 6 additions and 8 deletions

View File

@ -91,16 +91,14 @@ env_on(Envelope *env) {
env->stage = ENV_DECAY;
env->vol = 1.0f;
}
if (env->d > 0) {
env->d = (SOUND_TIMER / AUDIO_BUFSIZE) / env->d;
} else {
env->d = (SOUND_TIMER / AUDIO_BUFSIZE) / 10.0f;
if (env->d < 10.0f) {
env->d = 10.0f;
}
if (env->r > 0) {
env->r = (SOUND_TIMER / AUDIO_BUFSIZE) / env->r;
} else {
env->r = (SOUND_TIMER / AUDIO_BUFSIZE) / 10.0f;
env->d = (SOUND_TIMER / AUDIO_BUFSIZE) / env->d;
if (env->r < 10.0f) {
env->r = 10.0f;
}
env->r = (SOUND_TIMER / AUDIO_BUFSIZE) / env->r;
}
void