How to play a Wav on sustain pedal up/down?

Hi everyone,

I’m working on a JUCE Plugin, which is just an Instrument VST of a Grand Piano that I’ve sampled.
I’d like to be able to include samples (wav files mapped with a Memory Mapped Audio Format Reader) that play on Pedal Up/Down MIDI messages (to replicate the sound of the pedal mechanism), and MIDI Note key releases, but can’t work out how to do this.

For some context, this is the thread I’ve used to program the standard notes across the keyboard already:

To add these Pedal and Key release sounds, is it something that I need to further extend from the above topic on overriding other methods, or perhaps some sort of logic in the processBlock, e.g. if(midimessage.isSustainPedalOff()…

Any help would be appreciated for the best way I can implement this functionality.