Sustain pedal bug?


#1

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 !


#2

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.


#3

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

Sorry for the unnecessary noise....