加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
diode_1185.xml 1.78 KB
一键复制 编辑 原始数据 按行查看 历史
swh 提交于 2007-02-27 11:45 . Initial import
<?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"/>
</global>
<plugin label="diode" id="1185" class="DistortionPlugin">
<name>Diode Processor</name>
<p>Mangles the signal as if it had been passed through a diode rectifier network.</p>
<p>You should probably follow this with a DC offset remover, unless you want the offset.</p>
<callback event="run"><![CDATA[
unsigned long pos;
if (mode >= 0.0f && mode < 1.0f) {
for (pos = 0; pos < sample_count; pos++) {
buffer_write(output[pos], ((1.0f-mode) * input[pos]) +
(mode * (input[pos] > 0.0f ? input[pos] : 0.0f)));
}
} else if (mode >= 1.0f && mode < 2.0f) {
float fac = mode - 1.0f;
for (pos = 0; pos < sample_count; pos++) {
buffer_write(output[pos], ((1.0f-fac) * (input[pos] > 0 ?
input[pos] : 0.0)) + (fac * fabs(input[pos])));
}
} else if (mode >= 2) {
float fac = mode < 3 ? mode - 2 : 1.0;
for (pos = 0; pos < sample_count; pos++) {
buffer_write(output[pos], (1.0-fac) * fabs(input[pos]));
}
} else {
for (pos = 0; pos < sample_count; pos++) {
buffer_write(output[pos], input[pos]);
}
}
]]></callback>
<port label="mode" dir="input" type="control" hint="default_0">
<name>Mode (0 for none, 1 for half wave, 2 for full wave)</name>
<p>The mode parameter is continuously variable from thru to half-wave rectification to full-wave to silence.</p>
<range min="0" max="3"/>
</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>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化