uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 8f3d7b90209417d9e9a52f212c35a6b883890c18
parent d1c156d56cabf8033e6e3c999a441308a671cfd9
Author: Bad Diode <bd@badd10de.dev>
Date:   Tue, 17 Oct 2023 21:01:18 +0200

Add minimum decay/release of 10ms

Diffstat:
Msrc/devices/audio.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/devices/audio.c b/src/devices/audio.c @@ -93,12 +93,13 @@ env_on(Envelope *env) { } if (env->d > 0) { env->d = (SOUND_TIMER / AUDIO_BUFSIZE) / env->d; - } else if (env->stage == ENV_DECAY) { - env->stage = ENV_SUSTAIN; - env->vol = env->s; + } else { + env->d = (SOUND_TIMER / AUDIO_BUFSIZE) / 10.0f; } if (env->r > 0) { env->r = (SOUND_TIMER / AUDIO_BUFSIZE) / env->r; + } else { + env->r = (SOUND_TIMER / AUDIO_BUFSIZE) / 10.0f; } }