Change 1.0f to env->sustainLevel in case the user

release the spacebar before attack state done
This commit is contained in:
arbipink 2026-04-03 06:24:14 +07:00
parent f6c702b456
commit 8947d3ccc6

View File

@ -194,7 +194,7 @@ static void UpdateEnvelope(Envelope *env)
break;
case RELEASE:
env->currentValue -= (1.0f / env->releaseTime) * sampleTime;
env->currentValue -= (env->sustainLevel / env->releaseTime) * sampleTime;
if (env->currentValue <= 0.001f) // Use a small threshold to avoid infinite tail
{
env->currentValue = 0.0f;