File: plugin.xml

package info (click to toggle)
swh-lv2 1.0.15%2B20111107.gitec6b85e-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 984 kB
  • sloc: xml: 11,701; ansic: 2,120; makefile: 103; sh: 19
file content (70 lines) | stat: -rw-r--r-- 2,239 bytes parent folder | download | duplicates (10)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?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"/>
    <code>
      #include "ladspa-util.h"
    </code>
  </global>

  <plugin label="sinCos" id="1881" class="OscillatorPlugin">
    <name>Sine + cosine oscillator</name>
    <p>This is a simple oscillator that outputs sinewaves with a 90 degree phase shift between them.</p>
    <p>The current implementation is very inefficient, but I will improve it later.</p>

    <callback event="instantiate"><![CDATA[
      fs = (float)s_rate;
      phi = 0.0;
      last_om = 0.0;
    ]]></callback>

    <callback event="run"><![CDATA[
      unsigned long pos;
      const double target_om = 2.0 * M_PI * f_clamp(freq, 0.0f, 0.5f) * pow(2.0, f_clamp(pitch, 0.0f, 16.0f)) / fs;
      const double om_d = (target_om - last_om) / (double)sample_count;
      double om = last_om;

      for (pos = 0; pos < sample_count; pos++) {
        buffer_write(sine[pos], sin(phi));
        buffer_write(cosine[pos], cos(phi));
	om += om_d;
	phi += om;
      }
      while (phi > 2.0 * M_PI) {
	phi -= 2.0 * M_PI;
      }

      plugin_data->phi = phi;
      plugin_data->last_om = target_om;
    ]]></callback>

    <port label="freq" dir="input" type="control" hint="default_440,sample_rate,logarithmic">
      <name>Base frequency (Hz)</name>
      <p>The base frequency of the output waves.</p>
     <range min="0.000001" max="0.5"/>
    </port>

    <port label="pitch" dir="input" type="control" hint="default_0">
      <name>Pitch offset</name>
      <p>The pitch offset of the output waves. Final oscillator frequency is $base + 2^pitch$.</p>
     <range min="0" max="8"/>
    </port>

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

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

    <instance-data label="phi" type="double" />
    <instance-data label="fs" type="float" />
    <instance-data label="last_om" type="double" />
  </plugin>
</ladspa>