代码拉取完成,页面将自动刷新
<?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="divider" id="1186" class="GeneratorPlugin">
<name>Audio Divider (Suboctave Generator)</name>
<p>Reduces the period of the signal by the factor given, and makes it a square wave in the process. Has some amplitude tracking capability, but not really useful on complex signals.</p>
<callback event="instantiate"><![CDATA[
out = 1.0f;
amp = 0.0f;
count = 0.0f;
lamp = 0.0f;
last = 0.0f;
zeroxs = 0;
]]></callback>
<callback event="run"><![CDATA[
/* Integer version of denominator */
int den = (int)denominator;
unsigned long pos;
for (pos = 0; pos < sample_count; pos++) {
count += 1.0f;
if ((input[pos] > 0.0f && last <= 0.0f) ||
(input[pos] < 0.0f && last >= 0.0)) {
zeroxs++;
if (den == 1) {
out = out > 0.0f ? -1.0f : 1.0f;
lamp = amp / count;
zeroxs = 0;
count = 0;
amp = 0;
}
}
amp += fabs(input[pos]);
if (den > 1 && (zeroxs % den) == den-1) {
out = out > 0.0f ? -1.0f : 1.0f;
lamp = amp / count;
zeroxs = 0;
count = 0;
amp = 0;
}
last = input[pos];
buffer_write(output[pos], out * lamp);
}
plugin_data->last = last;
plugin_data->amp = amp;
plugin_data->lamp = lamp;
plugin_data->zeroxs = zeroxs;
plugin_data->count = count;
plugin_data->out = out;
]]></callback>
<port label="denominator" dir="input" type="control" hint="integer,default_1">
<name>Denominator</name>
<range min="1" max="8"/>
<p>The factor the incoming frequency will be divided by.</p>
</port>
<port label="input" dir="input" type="audio">
<name>Input</name>
</port>
<port label="output" dir="output" type="audio">
<name>Output</name>
<range min="-1" max="+1"/>
</port>
<!-- Last input value, to find 0 crossings -->
<instance-data label="last" type="LADSPA_Data"/>
<!-- Current amplitude sum (well, amp of last half cycle) -->
<instance-data label="amp" type="LADSPA_Data"/>
<!-- Average last amplitude (well, amp of last half cycle) -->
<instance-data label="lamp" type="LADSPA_Data"/>
<!-- Count of zero xings to make divider -->
<instance-data label="zeroxs" type="int"/>
<!-- Count of number of samples since x -->
<instance-data label="count" type="float"/>
<!-- Current output value -->
<instance-data label="out" type="LADSPA_Data"/>
</plugin>
</ladspa>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。