Login / Register  0 items | $0.00 NewWhat is KVR? Submit News Advertise

Panning Audio with Knob + CV input

User avatar
autodafe
KVRAF
 
1641 posts since 16 Jul, 2001, from Milan, Italy

Postby autodafe; Thu Sep 28, 2017 10:19 am Panning Audio with Knob + CV input

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...
vortico
KVRist
 
67 posts since 19 Jul, 2008

Postby vortico; Thu Sep 28, 2017 7:02 pm Re: Panning Audio with Knob + CV input

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);
User avatar
autodafe
KVRAF
 
1641 posts since 16 Jul, 2001, from Milan, Italy

Postby autodafe; Fri Sep 29, 2017 8:23 am Re: Panning Audio with Knob + CV input

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;

Moderator: Moderators (Main)

Return to DSP and Plug-in Development