File: triple_para_1204.xml

package info (click to toggle)
swh-plugins 0.4.17-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, stretch
  • size: 3,264 kB
  • ctags: 1,066
  • sloc: ansic: 23,551; xml: 12,633; perl: 1,114; sh: 964; makefile: 221
file content (159 lines) | stat: -rw-r--r-- 4,875 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<?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 "util/biquad.h"
    </code>
  </global>

  <plugin label="triplePara" id="1204" class="ParaEQPlugin">
    <name>Triple band parametric with shelves</name>
    <p>Actually five bands of eq, but the first and last are locked to shelving filters.</p>
    <p>For details see the single band parametric (section \ref{singlePara}).</p>

    <callback event="instantiate"><![CDATA[
fs = s_rate;

filters = calloc(5, sizeof(biquad));
biquad_init(&filters[0]);
biquad_init(&filters[1]);
biquad_init(&filters[2]);
biquad_init(&filters[3]);
biquad_init(&filters[4]);
    ]]></callback>

    <callback event="activate"><![CDATA[
biquad_init(&filters[0]);
biquad_init(&filters[1]);
biquad_init(&filters[2]);
biquad_init(&filters[3]);
biquad_init(&filters[4]);
    ]]></callback>

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

ls_set_params(&filters[0], fc_L, gain_L, bw_L, fs);
eq_set_params(&filters[1], fc_1, gain_1, bw_1, fs);
eq_set_params(&filters[2], fc_2, gain_2, bw_2, fs);
eq_set_params(&filters[3], fc_3, gain_3, bw_3, fs);
hs_set_params(&filters[4], fc_H, gain_H, bw_H, fs);

for (pos = 0; pos < sample_count; pos++) {
	in = biquad_run(&filters[0], input[pos]);
	in = biquad_run(&filters[1], in);
	in = biquad_run(&filters[2], in);
	in = biquad_run(&filters[3], in);
	in = biquad_run(&filters[4], in);
	buffer_write(output[pos], in);
}
    ]]></callback>

    <callback event="activate"><![CDATA[
biquad_init(&filters[0]);
biquad_init(&filters[1]);
biquad_init(&filters[2]);
biquad_init(&filters[3]);
biquad_init(&filters[4]);
    ]]></callback>

    <callback event="cleanup">
free(plugin_data->filters);
    </callback>

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

    <port label="fc_L" 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_L" dir="input" type="control" hint="default_middle">
      <name>Low-shelving slope</name>
      <range min="0" max="1"/>
    </port>

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

    <port label="fc_1" dir="input" type="control" hint="logarithmic,sample_rate,default_low">
      <name>Band 1 frequency (Hz)</name>
      <range min="0.0001" max="0.49"/>
    </port>

    <port label="bw_1" dir="input" type="control" hint="default_1">
      <name>Band 1 bandwidth (octaves)</name>
      <range min="0" max="4"/>
    </port>

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

    <port label="fc_2" dir="input" type="control" hint="logarithmic,sample_rate,default_middle">
      <name>Band 2 frequency (Hz)</name>
      <range min="0.0001" max="0.49"/>
    </port>

    <port label="bw_2" dir="input" type="control" hint="default_1">
      <name>Band 2 bandwidth (octaves)</name>
      <range min="0" max="4"/>
    </port>

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

    <port label="fc_3" dir="input" type="control" hint="logarithmic,sample_rate,default_high">
      <name>Band 3 frequency (Hz)</name>
      <range min="0.0001" max="0.49"/>
    </port>

    <port label="bw_3" dir="input" type="control" hint="default_1">
      <name>Band 3 bandwidth (octaves)</name>
      <range min="0" max="4"/>
    </port>

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

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

    <port label="bw_H" 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="filters" type="biquad *"/>
  </plugin>
</ladspa>