Sustain pedal bug?

Am I missing something or is Sustain pedal event wrongly handled in the code ? It seems that if we release the MIDI pedal  while a MIDI keyboard key is still down, it will cut off the sound for that note anyway. And looking at the handleSustainPedal code seems to confirm that, unfortunately.

Any suggestion to fix this ?

Thanks !

Reading the code, it all looks correct to me.. The line:


            if (voice->isPlayingChannel (midiChannel) && ! voice->keyIsDown)
                stopVoice (voice, 1.0f, true);

..has an explicit check so that it'll only stop the voice if it doesn't still have the key held down.

Damned ! you're right... I don't have this test in my code. My bad.

Sorry for the unnecessary noise....