Change 1.0f to env->sustainLevel in case the user
release the spacebar before attack state done
This commit is contained in:
parent
f6c702b456
commit
8947d3ccc6
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user