Voice control


#1


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?

 


#2

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.


#3

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.


#4

I assumed it was for a polysynth


#5

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.