mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
ADSR: Set the envelope value to 1 when calling noteOn() with an attack rate of 0
This commit is contained in:
parent
7ffcd5e5f4
commit
dd9802e265
1 changed files with 13 additions and 3 deletions
|
|
@ -113,9 +113,19 @@ public:
|
|||
/** Starts the attack phase of the envelope. */
|
||||
void noteOn()
|
||||
{
|
||||
if (attackRate > 0.0f) currentState = State::attack;
|
||||
else if (decayRate > 0.0f) currentState = State::decay;
|
||||
else currentState = State::sustain;
|
||||
if (attackRate > 0.0f)
|
||||
{
|
||||
currentState = State::attack;
|
||||
}
|
||||
else if (decayRate > 0.0f)
|
||||
{
|
||||
envelopeVal = 1.0f;
|
||||
currentState = State::decay;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentState = State::sustain;
|
||||
}
|
||||
}
|
||||
|
||||
/** Starts the release phase of the envelope. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue