-
Notifications
You must be signed in to change notification settings - Fork 52
/
foldover_1213.xml
48 lines (40 loc) · 1.44 KB
/
foldover_1213.xml
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
<?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 <[email protected]>"/>
<meta name="copyright" value="GPL"/>
<meta name="properties" value="HARD_RT_CAPABLE"/>
</global>
<plugin label="foldover" id="1213" class="DistortionPlugin">
<name>Foldover distortion</name>
<p>Uses a sinwave approximation to simulate valve style foldover distortion.</p>
<p>Probably should have a DC offset remover on the output, but it's not always necessary.</p>
<callback event="run"><![CDATA[
unsigned long pos;
float x;
const float drive = drive_p + 1.0f;
for (pos = 0; pos < sample_count; pos++) {
x = input[pos] * drive + push;
buffer_write(output[pos], 1.5f * x - 0.5f * x * x * x);
}
]]></callback>
<port label="drive_p" dir="input" type="control" hint="default_0">
<name>Drive</name>
<range min="0" max="1"/>
<p>Controls the degree of distortion.</p>
</port>
<port label="push" dir="input" type="control" hint="default_0">
<name>Skew</name>
<range min="0" max="1"/>
<p>Controls the asymmetry of the waveform.</p>
</port>
<port label="input" dir="input" type="audio">
<name>Input</name>
</port>
<port label="output" dir="output" type="audio">
<name>Output</name>
</port>
</plugin>
</ladspa>