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
|
<?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"/>
<code>
#include "ladspa-util.h"
#include "util/blo.h"
</code>
</global>
<plugin label="fmOsc" id="1415" class="OscillatorPlugin">
<name>FM Oscillator</name>
<callback event="instantiate"><![CDATA[
tables = blo_h_tables_new(1024);
osc = blo_h_new(tables, BLO_SINE, (float)s_rate);
]]></callback>
<callback event="run"><![CDATA[
unsigned long pos;
osc->wave = LIMIT(f_round(wave) - 1, 0, BLO_N_WAVES-1);
tables = tables; // So gcc doesn't think it's unused
for (pos = 0; pos < sample_count; pos++) {
blo_hd_set_freq(osc, fm[pos]);
buffer_write(output[pos], blo_hd_run_cub(osc));
}
]]></callback>
<callback event="cleanup"><![CDATA[
blo_h_tables_free(plugin_data->tables);
blo_h_free(plugin_data->osc);
]]></callback>
<port label="wave" dir="input" type="control" hint="integer,default_1">
<name>Waveform (1=sin, 2=tri, 3=squ, 4=saw)</name>
<p>The shape of the waveform.</p>
<p><![CDATA[
\begin{tabular}{|r|l|}
\hline
Value & Waveform \\
\hline \hline
1 & Sine \\
2 & Triangle \\
3 & Square \\
4 & Saw \\
\hline
\end{tabular}
]]></p>
<range min="1" max="4"/>
</port>
<port label="fm" dir="input" type="audio" hint="sample_rate,default_440">
<name>Frequency (Hz)</name>
<p>The frequency of the output (in Hertz).</p>
<range min="-0.25" max="0.25"/>
</port>
<port label="output" dir="output" type="audio">
<name>Output</name>
</port>
<instance-data label="tables" type="blo_h_tables *" />
<instance-data label="osc" type="blo_h_osc *" />
</plugin>
</ladspa>
|