mirror of
https://git.sr.ht/~rabbits/uxn
synced 2024-12-01 18:17:25 +00:00
Add minimum decay/release of 10ms
This commit is contained in:
parent
c0e0a41a77
commit
fca3b46d81
1 changed files with 4 additions and 3 deletions
|
@ -93,12 +93,13 @@ env_on(Envelope *env) {
|
||||||
}
|
}
|
||||||
if (env->d > 0) {
|
if (env->d > 0) {
|
||||||
env->d = (SOUND_TIMER / AUDIO_BUFSIZE) / env->d;
|
env->d = (SOUND_TIMER / AUDIO_BUFSIZE) / env->d;
|
||||||
} else if (env->stage == ENV_DECAY) {
|
} else {
|
||||||
env->stage = ENV_SUSTAIN;
|
env->d = (SOUND_TIMER / AUDIO_BUFSIZE) / 10.0f;
|
||||||
env->vol = env->s;
|
|
||||||
}
|
}
|
||||||
if (env->r > 0) {
|
if (env->r > 0) {
|
||||||
env->r = (SOUND_TIMER / AUDIO_BUFSIZE) / env->r;
|
env->r = (SOUND_TIMER / AUDIO_BUFSIZE) / env->r;
|
||||||
|
} else {
|
||||||
|
env->r = (SOUND_TIMER / AUDIO_BUFSIZE) / 10.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue