Hallo Steve, list !

I just noticed, that the "triple band parametric with shelves" LADSPA plugin generates a DC offset (tried version 0.4.15 and 0.4.14).

The offset is not always the same: first when I create the plugin, there is no offset. Then I pressed play/stop (in ardour) and the DC offset was here - also the amount of the offset is somehow changing when I play with different parameters (but I did not find out a real correspondens).

However, when I use the "Single band parametric" and the shelves alone I don't get an offest (which should be the same code ?).


I also made some other small additions to your plugin collection:

- single low and high shelving filters (see attached files): they are the same code as in "triple band parametric with shelves", because I often need only a single shelving filter

- in the "single band parametric" the slider to change the frequency was linear, I changed this to logarithmic (file attached)

Maybe you could include those plugins/changes in your collection, at least for me they are quite usefull.

LG
Georg
<?xml version="1.0"?>
<!DOCTYPE ladspa SYSTEM "ladspa-swh.dtd">
<?xml-stylesheet href="ladspa.css" type="text/css"?>

<ladspa>
  <global>
    <meta name="maker" value="Georg Holzmann, Steve Harris"/>
    <meta name="copyright" value="GPL"/>
    <meta name="properties" value="HARD_RT_CAPABLE"/>
    <code>
      #include "util/biquad.h"
    </code>
  </global>

  <plugin label="singleHiSh" id="8276" class="ParaEQPlugin">
    <name>single high shelving filter</name>
    <p>one high shelving filter</p>
    <p>taken from Triple band parametric with shelves by Steve Harris</p>

    <callback event="instantiate"><![CDATA[
fs = s_rate;
filter = malloc(sizeof(biquad));
biquad_init(filter);
    ]]></callback>

    <callback event="activate"><![CDATA[
biquad_init(filter);
    ]]></callback>
    
    <callback event="cleanup"><![CDATA[
free(plugin_data->filter);
    ]]></callback>

    <callback event="run"><![CDATA[
unsigned long pos;

hs_set_params(filter, fc, gain, bw, fs);

for (pos = 0; pos < sample_count; pos++) {
       buffer_write(output[pos], biquad_run(filter, input[pos]));
}
    ]]></callback>

    <port label="gain" dir="input" type="control" hint="default_0">
      <name>High-shelving gain (dB)</name>
      <range min="-70" max="+30"/>
    </port>

    <port label="fc" dir="input" type="control" hint="logarithmic,sample_rate,default_minimum">
      <name>High-shelving frequency (Hz)</name>
      <range min="0.0001" max="0.49"/>
    </port>

    <port label="bw" dir="input" type="control" hint="default_middle">
      <name>High-shelving slope</name>
      <range min="0" max="1"/>
    </port>

    <port label="input" dir="input" type="audio">
      <name>Input</name>
      <range min="-1.0" max="+1.0"/>
    </port>

    <port label="output" dir="output" type="audio">
      <name>Output</name>
      <range min="-1.0" max="+1.0"/>
    </port>

    <instance-data label="fs" type="float"/>
    <instance-data label="filter" type="biquad *"/>
  </plugin>
</ladspa>
<?xml version="1.0"?>
<!DOCTYPE ladspa SYSTEM "ladspa-swh.dtd">
<?xml-stylesheet href="ladspa.css" type="text/css"?>

<ladspa>
  <global>
    <meta name="maker" value="Georg Holzmann, Steve Harris"/>
    <meta name="copyright" value="GPL"/>
    <meta name="properties" value="HARD_RT_CAPABLE"/>
    <code>
      #include "util/biquad.h"
    </code>
  </global>

  <plugin label="singleLoSh" id="8273" class="ParaEQPlugin">
    <name>single low shelving filter</name>
    <p>one low shelving filter</p>
    <p>taken from Triple band parametric with shelves by Steve Harris</p>

    <callback event="instantiate"><![CDATA[
fs = s_rate;
filter = malloc(sizeof(biquad));
biquad_init(filter);
    ]]></callback>

    <callback event="activate"><![CDATA[
biquad_init(filter);
    ]]></callback>
    
    <callback event="cleanup"><![CDATA[
free(plugin_data->filter);
    ]]></callback>

    <callback event="run"><![CDATA[
unsigned long pos;

ls_set_params(filter, fc, gain, bw, fs);

for (pos = 0; pos < sample_count; pos++) {
       buffer_write(output[pos], biquad_run(filter, input[pos]));
}
    ]]></callback>

    <port label="gain" dir="input" type="control" hint="default_0">
      <name>Low-shelving gain (dB)</name>
      <range min="-70" max="+30"/>
    </port>

    <port label="fc" dir="input" type="control" hint="logarithmic,sample_rate,default_minimum">
      <name>Low-shelving frequency (Hz)</name>
      <range min="0.0001" max="0.49"/>
    </port>

    <port label="bw" dir="input" type="control" hint="default_middle">
      <name>Low-shelving slope</name>
      <range min="0" max="1"/>
    </port>

    <port label="input" dir="input" type="audio">
      <name>Input</name>
      <range min="-1.0" max="+1.0"/>
    </port>

    <port label="output" dir="output" type="audio">
      <name>Output</name>
      <range min="-1.0" max="+1.0"/>
    </port>

    <instance-data label="fs" type="float"/>
    <instance-data label="filter" type="biquad *"/>
  </plugin>
</ladspa>
<?xml version="1.0"?>
<!DOCTYPE ladspa SYSTEM "ladspa-swh.dtd">
<?xml-stylesheet href="ladspa.css" type="text/css"?>

<ladspa>
  <global>
    <meta name="maker" value="Steve Harris &lt;[EMAIL PROTECTED]&gt;"/>
    <meta name="copyright" value="GPL"/>
    <meta name="properties" value="HARD_RT_CAPABLE"/>
    <code>
      #include "util/biquad.h"
    </code>
  </global>

  <plugin label="singlePara" id="1203" class="ParaEQPlugin">
    <name>Single band parametric</name>
    <p>A single band of a parametric filter.</p>

    <callback event="instantiate"><![CDATA[
      fs = (float)s_rate;
      filter = malloc(sizeof(biquad));
      biquad_init(filter);
    ]]></callback>

    <callback event="activate"><![CDATA[
      biquad_init(filter);
    ]]></callback>

    <callback event="cleanup"><![CDATA[
      free(plugin_data->filter);
    ]]></callback>

    <callback event="run"><![CDATA[
      unsigned long pos;

      eq_set_params(filter, fc, gain, bw, fs);

      for (pos = 0; pos < sample_count; pos++) {
	buffer_write(output[pos], biquad_run(filter, input[pos]));
      }
    ]]></callback>

    <port label="gain" dir="input" type="control" hint="default_0">
      <name>Gain (dB)</name>
      <p>The attenuation/gain of the eq.</p>
      <range min="-70" max="+30"/>
    </port>

    <port label="fc" dir="input" type="control" hint="logarithmic,sample_rate,default_440">
      <name>Frequency (Hz)</name>
      <p>The centre frequency (ie. point of most/least attenuation).</p>
      <p>Beware of high values for Frequency and Bandwidth, if the high pitch (Frequency * 2$^{Bandwidth}$) goes over half the sample rate you will get aliasing.</p>
      <p>Note: if your host offers you a frequency range between 0 and 0.4 then it's not rendering the input parameter correctly, the input frequency will actually be that number multiplied by the sample rate (e.g. 44.1kHz).</p>
      <range min="0" max="0.4"/>
    </port>

    <port label="bw" dir="input" type="control" hint="default_1">
      <name>Bandwidth (octaves)</name>
      <p>The pitch difference from the centre before the attenuation has reached half the gain.</p>
      <range min="0" max="4"/>
    </port>

    <port label="input" dir="input" type="audio">
      <name>Input</name>
      <range min="-1.0" max="+1.0"/>
    </port>

    <port label="output" dir="output" type="audio">
      <name>Output</name>
      <range min="-1.0" max="+1.0"/>
    </port>

    <instance-data label="fs" type="float"/>
    <instance-data label="filter" type="biquad *"/>
  </plugin>
</ladspa>
_______________________________________________
Linux-audio-dev mailing list
[email protected]
http://lists.linuxaudio.org/mailman/listinfo.cgi/linux-audio-dev

Reply via email to