It might be possible to get this behaviour by deriving from Synthesiser and overriding handleController to keep a record of the sustain pedal value. Then, you can also override SynthesiserVoice::startNote to look up the sustain controller value on the voice’s currentPlayingMidiChannel.
Yes, override handleController to capture the state of the pedal seemed inevitable. Although I evaluated how to treat it later, I finally thought that this state should be included in the played note, so I finally did something quite ugly but effective, which is to combine the sustain with the velocity.
I think a new version of synthesizerVoice::starNote should be added with a structure with the current values of the sustain, sustenuto, soft, pitch wheel, (and maybe channel pressure), as well as any state or value that is currently required to be added, or in the future.