Hi, I’m trying to emulate a hardware synth I own, and I noticed that it uses a different voice every time I press the same key.
Juce on the other hand wants to use same voice if I repeatedly press a key.
I’ve got around this a little hackerly, being new to the voice stuff:-
…Which basically says I can’t use this voice because the envelope is still being used.
But it throws an assert when it can’t play anything.
Is there a more ready to use method of selecting a different voice every key press?
Thanks.
Dave
How about overriding the Synthesiser::noteOn method so it does roughly the same thing except removes the following lines of code:
// If hitting a note that's still ringing, stop it first (it could be
// still playing because of the sustain or sostenuto pedal).
for (auto* voice : voices)
if (voice->getCurrentlyPlayingNote() == midiNoteNumber && voice->isPlayingChannel (midiChannel))
stopVoice (voice, 1.0f, true);