Customize Max Voices Synth Behavior

Hi. I have been using the Synthesizer class so far and it works well for my plugin. If I want to have a maximum number of voices, I only add that many voices to the synth. However, this means that when a user hits the maximum number of voices, the synth is forced to end a voice immediately which causes a small audio glitch. I think letting the user specify a maximum number of voices is a nice thing, but I don’t like this side effect.

Has anyone else encountered this problem and found any solutions? If I could let the voice smooth to silence before ending, then the glitches would stop. I’d need to increase the number of voices though or else it would delay the new note playing.