Re: [LAD] panning thoughts

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Folderol <folderol@...>
Cc: <linux-audio-dev@...>
Date: Sunday, November 14, 2010 - 6:17 pm

On Sun, 2010-11-14 at 15:38 +0000, Folderol wrote:

> I don't know if this is at all relevant (prolly not!) but I dimly remember,

It is actually very relevant since the algorithm you might have in
mind..
http://en.wikipedia.org/wiki/Midpoint_circle_algorithm

.. is iterative and depends on that the previus step is known. If you
remember, the original poster wanted a /movement/ controlled by either
ENV or LFO - which boils down to a single complex mul. In case of LFO
this also serves as the LFO itself (shaving off even more instructions)
and in case of ENV, a test is needed to detect if speed and/or direction
of the rotation should be changed (say when x below becomes negative and
we have therefore passed the outer position of the speakers.)

Most of this discussion have instead become about finding an arbitrary
point, which is only needed to get the panning LFO/ENV started from a
point which is neither left nor right (ie: not 1.0,0.0)

// Say we want a panning LFO at 0.2 Hz

float

// left and right
x = 0.0,
y = 1.0,

// speed
w = 0.2 * (PI / SAMPLERATE),
a = _sinf(w) * 2, // see below

// Move it!

for(;;) // for each sample, do
x -= a*y, y += a*x; // pure magic ...

// x and y at this point holds an oscillating sin/cos pair.

The GCC/GNU Libc combo can't vectorize Math - not even for vectors of
identical oscillators. A Taylor approximation will do the job for this
project:

// Inverse of the factorials (n!) 1 - 9

#define IF_1 (1.f)
#define IF_2 (1.f/2.f)
#define IF_3 (1.f/6.f)
#define IF_4 (1.f/24.f)
#define IF_5 (1.f/120.f)
#define IF_6 (1.f/720.f)
#define IF_7 (1.f/5040.f)
#define IF_8 (1.f/40320.f)
#define IF_9 (1.f/362880.f)

inline float _sinf(float x)
{
float x2 = x*x;
float rt = IF_9;

rt *= x2;
rt -= IF_7;
rt *= x2;
rt += IF_5;
rt *= x2;
rt -= IF_3;
rt *= x2;
rt += IF_1;
rt *= x;

return rt;
}

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

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

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAD] panning thoughts, Eric Kampman, (Fri Nov 12, 4:22 am)
Re: [LAD] panning thoughts, Jens M Andreasen, (Fri Nov 12, 9:41 am)
Re: [LAD] panning thoughts, , (Fri Nov 12, 7:00 pm)
Re: [LAD] panning thoughts, Ralf Mardorf, (Sat Nov 13, 3:22 am)
Re: [LAD] panning thoughts, , (Sat Nov 13, 10:43 am)
Re: [LAD] panning thoughts, Eric Kampman, (Fri Nov 12, 3:14 pm)
Re: [LAD] panning thoughts, gene heskett, (Fri Nov 12, 4:47 pm)
Re: [LAD] panning thoughts, Arnold Krille, (Fri Nov 12, 10:46 pm)
Re: [LAD] panning thoughts, Folderol, (Sat Nov 13, 9:07 am)
Re: [LAD] panning thoughts, Paul Davis, (Sat Nov 13, 1:09 pm)
Re: [LAD] panning thoughts, Folderol, (Sat Nov 13, 2:57 pm)
Re: [LAD] panning thoughts, , (Sat Nov 13, 3:26 pm)
Re: [LAD] panning thoughts, Ralf Mardorf, (Sat Nov 13, 5:51 pm)
Re: [LAD] panning thoughts, Arnold Krille, (Sat Nov 13, 6:30 pm)
Re: [LAD] panning thoughts, Ralf Mardorf, (Sun Nov 14, 5:15 am)
Re: [LAD] panning thoughts, Arnold Krille, (Sun Nov 14, 3:04 pm)
Re: [LAD] panning thoughts, Folderol, (Sun Nov 14, 3:39 pm)
Re: [LAD] panning thoughts, Jens M Andreasen, (Sun Nov 14, 6:17 pm)
Re: [LAD] panning thoughts, , (Sun Nov 14, 11:37 am)
Re: [LAD] panning thoughts, Rui Nuno Capela, (Sun Nov 14, 11:17 am)
Re: [LAD] panning thoughts, Ralf Mardorf, (Sun Nov 14, 1:00 pm)
Re: [LAD] panning thoughts, Paul Davis, (Sun Nov 14, 11:27 am)
Re: [LAD] panning thoughts, Rui Nuno Capela, (Sun Nov 14, 4:02 pm)
Re: [LAD] panning thoughts, , (Sat Nov 13, 10:54 am)
Re: [LAD] panning thoughts, Ralf Mardorf, (Sat Nov 13, 1:18 pm)
Re: [LAD] panning thoughts, Philipp Überbacher, (Sat Nov 13, 5:07 pm)
Re: [LAD] panning thoughts, , (Sat Nov 13, 8:18 pm)
Re: [LAD] panning thoughts, James Morris, (Sat Nov 13, 8:25 pm)
Re: [LAD] panning thoughts, Philipp Überbacher, (Sat Nov 13, 10:44 pm)
Re: [LAD] panning thoughts, , (Sun Nov 14, 12:01 am)
Re: [LAD] panning thoughts, Remon Sijrier, (Mon Nov 22, 1:15 pm)
Re: [LAD] panning thoughts, , (Mon Nov 22, 2:36 pm)
Re: [LAD] panning thoughts, Remon Sijrier, (Mon Nov 22, 7:06 pm)
Re: [LAD] panning thoughts, Fons Adriaensen, (Mon Nov 22, 9:00 pm)
Re: [LAD] panning thoughts, David Olofson, (Sat Nov 13, 5:24 pm)
Re: [LAD] panning thoughts, Philipp Überbacher, (Sat Nov 13, 5:53 pm)
Re: [LAD] panning thoughts, , (Sat Nov 13, 3:04 pm)
Re: [LAD] panning thoughts, Ralf Mardorf, (Sat Nov 13, 5:30 pm)
Re: [LAD] panning thoughts, , (Fri Nov 12, 9:18 am)
Re: [LAD] panning thoughts, Eric Kampman, (Fri Nov 12, 3:11 pm)
Re: [LAD] panning thoughts, Ralf Mardorf, (Fri Nov 12, 5:40 am)
Re: [LAD] panning thoughts, Eric Kampman, (Fri Nov 12, 3:08 pm)
Re: [LAD] panning thoughts, Rui Nuno Capela, (Fri Nov 12, 3:44 pm)
Re: [LAD] panning thoughts, Ralf Mardorf, (Fri Nov 12, 4:20 pm)
Re: [LAD] panning thoughts, Ralf Mardorf, (Fri Nov 12, 3:32 pm)