File: const_1909.xml

package info (click to toggle)
swh-plugins 0.4.15%2B1-6
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 9,060 kB
  • sloc: ansic: 72,074; xml: 12,247; sh: 11,689; perl: 769; makefile: 211; sed: 16
file content (50 lines) | stat: -rw-r--r-- 1,472 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?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;steve@plugin.org.uk&gt;"/>
    <meta name="copyright" value="GPL"/>
    <meta name="properties" value="HARD_RT_CAPABLE"/>
  </global>

  <plugin label="const" id="1909" class="UtilityPlugin">
    <name>Constant Signal Generator</name>
    <p>This plugin add an output DC offset at the given amplitude to the input
signal. It has no real use other than for debugging and in modular synths.</p>

    <callback event="activate"><![CDATA[
      last_amp = 0.0f;
    ]]></callback>

    <callback event="run"><![CDATA[
      unsigned long pos;
      const float delta = (amplitude - last_amp) / (sample_count - 1);
      float amp = last_amp;

      for (pos = 0; pos < sample_count; pos++) {
	amp += delta;
        buffer_write(output[pos], input[pos] + amp);
      }

      plugin_data->last_amp = amp;
    ]]></callback>

    <port label="amplitude" dir="input" type="control" hint="default_0">
      <name>Signal amplitude</name>
      <p>Controls the amplitude of the output signal.</p>
      <range min="-1" max="1.1"/>
    </port>

    <port label="input" dir="input" type="audio">
      <name>Input</name>
    </port>

    <port label="output" dir="output" type="audio">
      <name>Output</name>
    </port>

    <instance-data label="last_amp" type="float" />
  </plugin>
</ladspa>