Re: [linux-audio-dev] Mixing signals

2005-05-23 Thread Alfons Adriaensen
On Mon, May 23, 2005 at 12:18:58PM +0200, Viceic Predrag wrote: > Well, you're right. But if you want to finish with signal thats limited to > [-1:1] you got to have some normalization somewhere..Or I'm totaly wrong? Since everything in LADSPA (and I assume in your app) is floats, there is nor r

Re: [linux-audio-dev] Mixing signals

2005-05-23 Thread Viceic Predrag
> Why? What is this supposed to achieve and what's wrong with: > > *p_output = *p_A + *p_B; Well, you're right. But if you want to finish with signal thats limited to [-1:1] you got to have some normalization somewhere..Or I'm totaly wrong? Predrag Le Lundi, 23 Mai 2005 11.37, Erik de Cast

Re: [linux-audio-dev] Mixing signals

2005-05-23 Thread Erik de Castro Lopo
Richard Spindler wrote: > It's some evil black magic that tries to avoid disortion. I'm not sure > whether it's the right way to do, but I was inspired by some website, > but i don't have the link anymore. > The original code-snippet performed a similar operation on integer-data. I can (possibly)

Re: [linux-audio-dev] Mixing signals

2005-05-23 Thread Alfons Adriaensen
On Mon, May 23, 2005 at 11:03:30AM +0200, Richard Spindler wrote: > if (*p_A<0 && *p_B<0) { > *p_output =(*p_A+1)*(*p_B+1)-1; > } else { > *p_output =2*(*p_A+*p_B+2)-(*p_A+1)*(*p_B+1)-3; > } What is th

Re: [linux-audio-dev] Mixing signals

2005-05-23 Thread Richard Spindler
On 5/23/05, Erik de Castro Lopo <[EMAIL PROTECTED]> wrote: > > if (*p_A<0 && *p_B<0) { > > *p_output =(*p_A+1)*(*p_B+1)-1; > > } else { > > *p_output =2*(*p_A+*p_B+2)-(*p_A+1)*(*p_B+1)-3; > > } > > Why?

Re: [linux-audio-dev] Mixing signals

2005-05-23 Thread Richard Spindler
On 5/23/05, Steve Harris <[EMAIL PROTECTED]> wrote: > I've no idea what your trying to do cos I missed the original post, but > just FYI, you will generally be better off doing x[i] rather than *x and > incrementing x. Modern C compilers (eg. gcc 4) can vectorise array > operations as long as you d

Re: [linux-audio-dev] Mixing signals

2005-05-23 Thread Erik de Castro Lopo
Richard Spindler wrote: > On 5/23/05, Viceic Predrag <[EMAIL PROTECTED]> wrote: > > Could someone please help with this apparently simple problem? > > I'm not a "professional" either, but this is what I do: > if (*p_A<0 && *p_B<0) { > *p_output =(*p_A+1)

Re: [linux-audio-dev] Mixing signals

2005-05-23 Thread Steve Harris
On Mon, May 23, 2005 at 10:45:51 +0200, Viceic Predrag wrote: > Hi all, > > I'm the author of Freecycle, one of the younger FOSS audio projects out > there. > I have a problem that may astound by it's simplicity, so I barely dare to ask > for help... > > Freecycle provides some LADSPA function

Re: [linux-audio-dev] Mixing signals

2005-05-23 Thread Viceic Predrag
Hi, > Is there any reason why you don't just start up two instances of the > plugin and send each channel through its own plugin? You could replicate > the control parameters for each channel. Freecycle already allows the double plugin as you describe it. It's just that sometimes someone might w

Re: [linux-audio-dev] Mixing signals

2005-05-23 Thread Steve Harris
On Mon, May 23, 2005 at 11:03:30 +0200, Richard Spindler wrote: > On 5/23/05, Viceic Predrag <[EMAIL PROTECTED]> wrote: > > Could someone please help with this apparently simple problem? > > I'm not a "professional" either, but this is what I do: > > unsigned int TLData::MixChannels(float *A, flo

Re: [linux-audio-dev] Mixing signals

2005-05-23 Thread Alfons Adriaensen
On Mon, May 23, 2005 at 10:45:51AM +0200, Viceic Predrag wrote: > 1) sum L and R and divide by 2 : well.. > > 2) if L>0 and R>0 take the max, if L<0 and R<0, take the min, else add. : > current implementation > > 3) add, and then normalize to the max after summation. Options 2 and 3 are not l

Re: [linux-audio-dev] Mixing signals

2005-05-23 Thread Erik de Castro Lopo
Viceic Predrag wrote: > Hi all, > > I'm the author of Freecycle, one of the younger FOSS audio projects out > there. > I have a problem that may astound by it's simplicity, so I barely dare to ask > for help... > > Freecycle provides some LADSPA functionality, and as there are lot of great >

Re: [linux-audio-dev] Mixing signals

2005-05-23 Thread Richard Spindler
On 5/23/05, Viceic Predrag <[EMAIL PROTECTED]> wrote: > Could someone please help with this apparently simple problem? I'm not a "professional" either, but this is what I do: unsigned int TLData::MixChannels(float *A, float *B, float* out, unsigned int count) /*Mix function for (-1)-(1) float

[linux-audio-dev] Mixing signals

2005-05-23 Thread Viceic Predrag
Hi all, I'm the author of Freecycle, one of the younger FOSS audio projects out there. I have a problem that may astound by it's simplicity, so I barely dare to ask for help... Freecycle provides some LADSPA functionality, and as there are lot of great but mono ladspa effects, I need a very si