commit 9d1013d3bfcaa7fdaa96b3ef61cacd29af7291fb
parent c6713b6d1b9dca5ea54008069f6bd3f6e3b9ae9c
Author: Bad Diode <bd@badd10de.dev>
Date: Tue, 10 Oct 2023 17:04:27 +0200
Make sure ADSR uses the audiobuf macros
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/devices/audio.c b/src/devices/audio.c
@@ -92,19 +92,19 @@ env_on(Envelope *env) {
env->stage = ENV_ATTACK;
env->vol = 0.0f;
if (env->a > 0) {
- env->a = (SOUND_TIMER / 256.0f) / env->a;
+ env->a = (SOUND_TIMER / AUDIO_BUFSIZE) / env->a;
} else if (env->stage == ENV_ATTACK) {
env->stage = ENV_DECAY;
env->vol = 1.0f;
}
if (env->d > 0) {
- env->d = (SOUND_TIMER / 256.0f) / env->d;
+ env->d = (SOUND_TIMER / AUDIO_BUFSIZE) / env->d;
} else if (env->stage == ENV_DECAY) {
env->stage = ENV_SUSTAIN;
env->vol = env->s;
}
if (env->r > 0) {
- env->r = (SOUND_TIMER / 256.0f) / env->r;
+ env->r = (SOUND_TIMER / AUDIO_BUFSIZE) / env->r;
}
}