Unison detuning in poly~: how to achieve equal spread?
Hi everyone!
I'm working on a polyphonic synth. Besides the normal polyphony that allows me to play multiple notes together, I also want a variable 'unison' polyphony per oscillator with a detune parameter. So basically I need a poly~ within a poly~: one for the whole synth to play polyphonic and at least one inside for the individual oscillator. It should allow me to adjust the amount of voices per oscillator and the amount of detuning/spread between those voices.
I found out how to get a random detuning per osc-voice within a range of +100 cents (+1 semitone) and -100 cents (-1 semitone), but I want a controlled and equal spread of all the voices within the set range. My detune-knob is scaled to a max. range of -100 cents to +100 cents. So when the knob is turned to 0%, there should be no detuning and when it's turned to 100% the voices should equally spread over the the full range. So for example:
If I have set the 'unison amount' to 5 voices and the detuning is set to 100%, I want an equal spread of all 5 voices over the full range. 5 is an uneven number, so in this case one voice should be centered with no detuning. The amount of detuning could look like this:
voice 1: 0 cents
voice 2: +50 cents
voice 3: -50 cents
voice 4: +100 cents
voice 5: -100 cents
All the steps are now equally spread from each other with a spread-range of 50 cents
But in case of an even voice number, like 4 voices, it should work a little bit different. Now there is no single median, so there can't be a single centered voice here if I want an equal spread. In this case the amount of detuning could look like this:
voice 1: +33,1/3 cents
voice 2: -33,1/3 cents
voice 3: +100 cents
voice 4: - 100 cents
All the steps are equally spread with a range of 66,2/3 cents.
So to make sure all the voices are spread equally, do I need to make different setups for even and uneven voice numbers? And how could I make sure that they all spread equally within the set range? I need some help finding an efficient way to make this work, because everything I've tried seemed too far fetched, I think.
You could try something along these lines:
i question that you really want equal distance -100 -50 0 - 50 -100
hm, i needed a moment, but in fact it is only scaling. :)
