[ardour-dev] questions about panner.cc ...

Paul Davis paul at linuxaudiosystems.com
Thu Aug 25 08:13:08 PDT 2005


> I looked at the code and I saw some things which surprised me:
> 
> I expected to see an attenuation of x in one channel and sqrt(1-x*x) in
> the other, but I saw:
> 
> 	const float pan_law_attenuation = -3.0f;
> 	const float scale = 2.0f - 4.0f * powf
> //snip
> 	desired_left = panL * (scale * panL + 1.0f - scale);
> 	desired_right = panR * (scale * panR + 1.0f - scale);
> 
> what is the purpose of this formula?

it provides constant power panning (i.e. the total perceived volume
during panning remains the same), unlike the more simplistic approach
you mentioned, which tends to cause a dip or peak in perceived volume
during parts of a full panning sweep.

this is all standard stuff, just google for "power panning constant" to
get lots of good references.

> BTW(not very important), wouldn't be better to replace powf
> (10.0f,pan_law_attenuation/20.0f) with 1/sqrt(2). and add a comment of
> //-3db attenuation

could be. DSP has never been my thing, so i'd need someone else confirm
that this is indeed equivalent.





More information about the Ardour-Dev mailing list