1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Fix issue where sustain value would be reset after note off in legacy mode

This commit is contained in:
Aga Janowicz 2020-03-26 17:32:45 +00:00 committed by ed
parent 8f069624d7
commit 9d9d26c85a

View file

@ -336,8 +336,8 @@ void MPEInstrument::noteOff (int midiChannel,
note->keyState = (note->keyState == MPENote::keyDownAndSustained) ? MPENote::sustained : MPENote::off;
note->noteOffVelocity = midiNoteOffVelocity;
// If no more notes are playing on this channel, reset the dimension values
if (getLastNotePlayedPtr (midiChannel) == nullptr)
// If no more notes are playing on this channel in mpe mode, reset the dimension values
if (! legacyMode.isEnabled && getLastNotePlayedPtr (midiChannel) == nullptr)
{
pressureDimension.lastValueReceivedOnChannel[midiChannel - 1] = MPEValue::minValue();
pitchbendDimension.lastValueReceivedOnChannel[midiChannel - 1] = MPEValue::centreValue();
@ -395,7 +395,7 @@ void MPEInstrument::polyAftertouch (int midiChannel, int midiNoteNumber, MPEValu
MPEValue MPEInstrument::getInitialValueForNewNote (int midiChannel, MPEDimension& dimension) const
{
if (getLastNotePlayedPtr (midiChannel) != nullptr)
if (! legacyMode.isEnabled && getLastNotePlayedPtr (midiChannel) != nullptr)
return &dimension == &pressureDimension ? MPEValue::minValue() : MPEValue::centreValue();
return dimension.lastValueReceivedOnChannel[midiChannel - 1];