Spreading voices?

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

I've hit a bit of writers block here - how do we go around spreading a variable number of voices equally around the stereo field with a width control?

Code: Select all

width=0; //0=mono, 1=full stereo
for (int i=0; i<num_voices; ++i)
{
   left += voice[i] * ???;
   right += voice[i] * ???;
}

left /= num_voices;
right /= num_voices;

Post

float p = 0.5 - width*0.5 + width*i/(num_voices-1)

left += (1-p) * voice
right += p * voice

assuming linear pan
Chris Jones
www.sonigen.com

Post

Thanks very much... I put a min of 1 around num_voices-1 and it seems to be working.

Post Reply

Return to “DSP and Plugin Development”