Panning Audio with Knob + CV input

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

Post

I am building a stereo mixer for VCV rack.
I have followed this: viewtopic.php?t=235347

and came up with a decent panning knob that pans left/right
I wrote two functions, one for panning left and one for pan right

Code: Select all

 float PanL(float balance, float cv)
{
   float p, gl;
   p=M_PI*(balance+1)/4;
   gl=::cos(p);
   return gl;
}

float PanR(float balance , float cv)
{
   float p, gr;
   p=M_PI*(balance+1)/4;
   gr=::sin(p);
   return gr;
}
Sofar it works quitw well and I can control pannig with a knob. I would like to control panning using a CV input as well (the cv parameter) of my functions....But I cannot find a proper way to "add" cv to the balance parameter ...
How could I "sum" balance + cv paramaters (it's not a simple sum, I am afraid ;-) )

Sorry for the "novice" question...

Post

It is a simple sum if you want to do it that way, just clamped.

Code: Select all

balance = clampf(balance + cv, 0.0, 1.0);
VCV Rack, the Eurorack simulator

Post

thanks, I will try it (I came up with a working solution, but it's not perfect)
I was trying to clamp cv only, like:

Code: Select all

p=M_PI*(balance+clampf(balance + cv, 0.0, 1.0)+1)/4;

Post Reply

Return to “DSP and Plugin Development”