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 (72 lines) | stat: -rw-r--r-- 1,990 bytes parent folder | download | duplicates (4)
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
71
72
<?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"
      #include "util/blo.h"
    </code>
  </global>

  <plugin label="fmOsc" id="1415" class="OscillatorPlugin">
    <name>FM Oscillator</name>

    <callback event="instantiate"><![CDATA[
      tables = blo_h_tables_new(1024);
      osc = blo_h_new(tables, BLO_SINE, (float)s_rate);
    ]]></callback>

    <callback event="run"><![CDATA[
      unsigned long pos;
      osc->wave = LIMIT(f_round(wave) - 1, 0, BLO_N_WAVES-1);

      tables = tables; // So gcc doesn't think it's unused

      for (pos = 0; pos < sample_count; pos++) {
	blo_hd_set_freq(osc, fm[pos]);
        buffer_write(output[pos], blo_hd_run_cub(osc));
      }
    ]]></callback>

    <callback event="cleanup"><![CDATA[
      blo_h_tables_free(plugin_data->tables);
      blo_h_free(plugin_data->osc);
    ]]></callback>

    <port label="wave" dir="input" type="control" hint="integer,default_1">
      <name>Waveform (1=sin, 2=tri, 3=squ, 4=saw)</name>
      <p>The shape of the waveform.</p>
      <p><![CDATA[
	\begin{tabular}{|r|l|}
	\hline
	Value & Waveform \\
	\hline \hline
	1 & Sine \\
	2 & Triangle \\
	3 & Square \\
	4 & Saw \\
        \hline
	\end{tabular}
      ]]></p>
      <range min="1" max="4"/>
    </port>

    <port label="fm" dir="input" type="audio" hint="sample_rate,default_440">
      <name>Frequency (Hz)</name>
      <p>The frequency of the output (in Hertz).</p>
      <range min="-0.25" max="0.25"/>
    </port>

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

    <instance-data label="tables" type="blo_h_tables *" />
    <instance-data label="osc" type="blo_h_osc *" />
  </plugin>
</ladspa>