Re: [linux-audio-dev] LADSPA and run_adding()

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] LADSPA and run_adding()
From: Benno Senoner (sbenno_AT_gardena.net)
Date: Mon Nov 20 2000 - 03:52:31 EET


Exactly what I meant !
and the code is not THAT ugly !

Plus my ++votes go for making both
run() and run_adding() (with gain control)
mandatody.

cheers,
Benno.

On Sun, 19 Nov 2000, Steve Harris wrote:

>
> I have a pathalogical fear of duplicated code, which I'm afraid is going
> to be a common solution. The best thing I have come up with so far is
> defining a macro for writing to an output:
>
> write_to_buffer(buffer, value)
>
> which gets #defined as
> (buffer = value)
> before run(), and
> (buffer += ((value) * run_adding_gain))
> before run_adding()
>
> This would make the callback run* element for an amp:
>
> <callback event="run">
> int pos;
> float coef = pow(10.0f, gain / 20.0f);
>
> for (pos = 0; pos &lt; sample_count; pos++) {
> write_to_buffer(*(output++), *(input++) * coef);
> }
> </callback>
>
> Can anyone see any glaring problems with this? Apart from uglyness, and
> that I need to write a propper dtd. ;)
>
> - Steve


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Mon Nov 20 2000 - 02:32:18 EET