mirror of
https://github.com/yokemura/Magical8bitPlug2.git
synced 2025-05-24 23:00:21 -04:00
Fixed the behavior when sending a note-off to a note already in release phase
This commit is contained in:
parent
325f080857
commit
8f4c8258e8
@ -89,6 +89,10 @@ void BaseVoice::stopNote (float, bool allowTailOff)
|
|||||||
{
|
{
|
||||||
if (settingRefs->volumeSequence.hasRelease)
|
if (settingRefs->volumeSequence.hasRelease)
|
||||||
{
|
{
|
||||||
|
if (settingRefs->volumeSequence.isInRelease(currentVolumeSequenceFrame)) {
|
||||||
|
// Already in release(Custom Env.)
|
||||||
|
return ;
|
||||||
|
}
|
||||||
currentVolumeSequenceFrame = settingRefs->volumeSequence.releaseSequenceStartIndex;
|
currentVolumeSequenceFrame = settingRefs->volumeSequence.releaseSequenceStartIndex;
|
||||||
currentEnvelopeLevel = (float) (settingRefs->volumeSequence.valueAt (0)) / 15.0f;
|
currentEnvelopeLevel = (float) (settingRefs->volumeSequence.valueAt (0)) / 15.0f;
|
||||||
}
|
}
|
||||||
@ -100,6 +104,11 @@ void BaseVoice::stopNote (float, bool allowTailOff)
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (envelopePhase == kEnvelopePhaseR) {
|
||||||
|
// Already in release(ADSR)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
envelopePhase = kEnvelopePhaseR;
|
envelopePhase = kEnvelopePhaseR;
|
||||||
}
|
}
|
||||||
|
@ -68,4 +68,8 @@ struct FrameSequence
|
|||||||
|
|
||||||
// No reach here
|
// No reach here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isInRelease(int index) {
|
||||||
|
return index >= releaseSequenceStartIndex;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user