[linux-audio-dev] LADSPA_Data audio values

Iain Young iain at g7iii.net
Thu Dec 21 16:19:04 EST 2006


Hi All,

I'm trying to write a LADSPA plugin to do the following:

Given n inputs (lets say 4), and one output, It should present the
highest "priority" input on the output. Input 1 is the lowest priority,
with Input 4 being the highest.

In order to write this in code, within the runPriomux function, I do
this:

   y=-1;
   for (i=0; i<=3; i++)
   {
      pfBuffer=*(pfInput[i]++);
      if (pfBuffer > -1.0f)
        y=i;
    }
    if (y!=-1)
      *(pfOutput++)=pfBuffer;

i is the input channel (0-3, not 1-4, but you know what I mean)
y is what is supposed to be the highest priority channel with audio
on it.


Now..here's where Im confused. I thought the values for audio samples
in LADSPA were -1.0f...1.0f (with -1.0f being infinity). This doesn't
seem to work, as the above code always appears to think that the 4th
input (i=3) has data on it, even if it's muted in ardour (via another
bus that's single output is connected to input 4...)

I've also looked at the code of meterbridge, and tried using -70.0f,
but with the same problem...Anyone want to plant me a clue on what
I'm doing wrong ?

I've attached the entire plugin source below. It's really been ripped
off of the example amp in the LADSPA SDK I'm afraid....

Thanks in advance for any help, this last bit is driving me mad, now
I've worked out how to code plugins!


All the Best

Iain

-------------- next part --------------
A non-text attachment was scrubbed...
Name: priomux.c
Type: text/x-csrc
Size: 6388 bytes
Desc: not available
Url : http://music.columbia.edu/pipermail/linux-audio-dev/attachments/20061221/f95e5455/priomux.bin


More information about the linux-audio-dev mailing list