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
|
<?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 <steve@plugin.org.uk>"/>
<meta name="copyright" value="GPL"/>
<meta name="properties" value="HARD_RT_CAPABLE"/>
</global>
<plugin label="shaper" id="1187" class="WaveshaperPlugin">
<name>Wave shaper</name>
<p>This plugin reshapes the wave by an exponential function, inspiration was taken from the Nord module of the same name.</p>
<p>If you are getting rubbish out then it's probably because the host isn't using the input/output range hints, which are very important for this plugin.</p>
<callback event="run"><![CDATA[
int pos;
float shape = 0.0f;
if (shapep < 1.0f && shapep > -1.0f) {
shape = 1.0f;
} else if (shape < 0) {
shape = -1.0f / shape;
} else {
shape = shapep;
}
for (pos = 0; pos < sample_count; pos++) {
if (input[pos] < 0.0f) {
buffer_write(output[pos], -pow(-input[pos], shape));
} else {
buffer_write(output[pos], pow(input[pos], shape));
}
}
]]></callback>
<port label="shapep" dir="input" type="control" hint="default_0">
<name>Waveshape</name>
<p>Positive values have an expanding effect, and negative values have a compressing effect.</p>
<range min="-10" max="+10"/>
</port>
<port label="input" dir="input" type="audio">
<name>Input</name>
<range min="-1" max="+1"/>
</port>
<port label="output" dir="output" type="audio">
<name>Output</name>
<range min="-1" max="+1"/>
</port>
</plugin>
</ladspa>
|