[LAD] panning thoughts

Jens M Andreasen jens.andreasen at comhem.se
Fri Nov 12 09:40:33 UTC 2010


On Thu, 2010-11-11 at 20:22 -0800, Eric Kampman wrote:
> Since power is proportional to signal squared, this means ..
> .. L(t) = cos(t * pi / 2) and R(t) = cos((1 - t) * pi / 2)

I think you misspelled one sin(), no?

let float p be the panning position such that:
Left == 0.0, Center == 0.5, Right == 1.0

.. then: 

float l = sqrtf(1.0f - p)
float r = sqrtf(p) 

> Thoughts?

For LFO and envelope, I would calculate ay most every 16th value and
interpolate inbetween.

There is support in SSE for sqrt:
http://web.nmsu.edu/~usa/nmcac/apps/intel/vtune/doc/users_guide/mergedProjects/analyzer_ec/mergedProjects/reference_olh/mergedProjects/instructions/instruct32_hh/vc298.htm

It is a complex mul you really want - where L+R is the real and L-R is
the imaginary. You can have the sin/cos pair very cheaply by using an
LFO that works by rotating iself by some complex constant. 

-- 
jedes mal wenn du eine quintparallele verwendest
tötet bach ein kätzchen.

 http://www.youtube.com/watch?v=43RdmmNaGfQ




More information about the Linux-audio-dev mailing list