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