Voice control


I compared my synth with others.
Each MIDI message launches new voice. how to restart the voice?

For example:


My synthesizer

press C4 ->start new voice : press C4 ->start new voice : press C4 ->start new voice : etc

other synthesizers

press C4 ->start new voice : press C4 ->if playing set env state Attack (dont start new) : press C4 ->if playing  set env state Attack (dont start new): etc


How can I control the launch of new voices?

 

Umm. Your question contains its own answer. If the note is playing, restart the attack.
So, just make an array of bools like playing[128], and check that.

An array of bools if probably not good advice!

Are you trying to build a mono synth? If so all you need to do is give it one voice, so that it will have to re-use it.

I assumed it was for a polysynth

Umm. Your question contains its own answer. If the note is playing, restart the attack.
So, just make an array of bools like playing[128], and check that.

thanks for the answer, I knew it 


but the default Synthesizer::findFreeVoice returns only free voices.
Overdrive this function solved the problem thank you.