|
Post by meneillos on Apr 25, 2018 17:01:13 GMT 1
I have noticed that when trying to modulate its volume input this does not differentiate between negative and positive, it seems that even if you send negative values he picks them up as positive, which is a problem to modulate.
Is there any reason for this? or it's just wrong
|
|
|
Post by Rob on Apr 25, 2018 19:10:31 GMT 1
It's a crap attempt at stereo balance control, I should make some changes to it. Some time ago found the module needs proper pan law ( or a mode selector to choose a law ). Are you talking about the volume pin? It seems I didn't set a negative value block ( clip ), so that's wrong indeed. float balance_left = 1.0f + *pan; float balance_right = 1.0f - *pan;
*leftOut = *inputL * *volume * balance_left * 0.5f; *rightOut = *inputR * *volume * balance_right * 0.5f;
|
|
|
Post by meneillos on Apr 25, 2018 20:01:35 GMT 1
Are you talking about the volume pin? yes
the effort you make to create more modules is appreciated. regards
|
|
Andrew
Developer
Posts: 110
Posts: 110
|
Post by Andrew on Apr 25, 2018 21:02:07 GMT 1
It's a crap attempt at stereo balance control, I should make some changes to it. Some time ago found the module needs proper pan law ( or a mode selector to choose a law ). Are you talking about the volume pin? It seems I didn't set a negative value block ( clip ), so that's wrong indeed. I won't say it is wrong, it's a design choice. In my pan module I clip the pan control, but not the volume level control, because sometimes you want the level at -10 instead of +10. //some pan laws I use in my module - assumes pan is in 0-1 range --adapt to your own needs, designed to use sqrts as they are pretty cheap on modern CPUs
//equal power 3dB - most common float x = pan * (M_PI/2); float x2 = x*x;
float taylorCos = 0.04166666666666666f*(x2*(x2-12.0f)+24.0f);//taylor approximation float taylorSin = 0.008333333333333333f*x*(x2*(x2-20.0f)+120.0f);//don't need full precision
outputL = (*input1*taylorCos); outputR = (*input2*taylorSin);
//sqrt power - also 3dB, just different 'taper'
float sqrtT = sqrtf(1.f-pan); float isqrtT = sqrtf(pan);
// 1.5dB power law - just for fun
float sqrtSqrt = sqrtf(sqrtf(1.f-pan)); float isqrtSqrt = sqrtf(sqrtf(pan));
// 4.5 law - used on some hardware and pro-tools
float sqrt1 = sqrtf(pan); float sqrt1inv = sqrtf(1.f-pan); float sqrtT = sqrt1inv * sqrtf(sqrt1inv); float isqrtT = sqrt1 * sqrtf(sqrt1);
Cheers Andrew
|
|
|
Post by Rob on Apr 25, 2018 21:21:23 GMT 1
Thanks for your insights Andrew, much appreciated.
|
|