text
stringlengths
0
14.1k
(foreach-channel
(cout (* scale (part-convolve (audio-in 0) *pvbuf*))))))
---
<span style=""color: #ff7f24;""># </span><span style=""color: #ff7f24;"">Trivial rego file</span>
<span style=""color: #b0c4de;"">echo</span> 0 convolve &gt; forge.rego</pre>
<p>
I use `&#x2013;' to separate toplevel and user options. reverb.wav is
the impulse response of a stereo reverb, sampled with sample rate
96 kHz, and voice.wav is an input file. The second user option is a
scale factor for the output.
</p>
<pre class=""src src-sh"">incudine conv.cudo -i voice.wav -r 96000 -s forge.rego -- reverb.wav 0.4</pre>
<p>
A function for the shell is immediate.
</p>
<pre class=""src src-sh""><span style=""color: #ff7f24;""># </span><span style=""color: #ff7f24;"">Usage: convolve inputfile irfile [scale] [srate] [pad]</span>
<span style=""color: #87cefa;"">convolve</span>() { incudine conv.cudo -i <span style=""color: #ffa07a;"">""$1""</span> ${<span style=""color: #eedd82;"">4</span>:+-r $<span style=""color: #eedd82;"">4</span>} --pad ${<span style=""color: #eedd82;"">5</span>:-2} <span style=""color: #ffa07a;"">\</span>
-s forge.rego -- <span style=""color: #ffa07a;"">""$2""</span> <span style=""color: #ffa07a;"">""$3""</span> ; }
convolve voice.wav reverb.wav 0.4 96000
convolve voice48.wav ir48.wav 0.53 48000 2.5
<span style=""color: #ff7f24;""># </span><span style=""color: #ff7f24;"">Remove the traces</span>
<span style=""color: #b0c4de;"">unset</span> -f convolve</pre>
<p>
If you have created the incudine command with the support for LV2, you
can use LV2 plugins in your scripts. A trivial example:
</p>
<pre class=""src src-sh"">cat &gt; amp.cudo &lt;&lt;'---'
(lv2-&gt;vug ""http://plugin.org.uk/swh-plugins/amp"" swh.amp)
(dsp! amp-test (gain)
(stereo (swh.amp gain (white-noise 1))))
---
cat &gt; amp-test.rego &lt;&lt;'---'
0 amp-test -6 :id 1
1 set-control 1 :gain -12
2 set-control 1 :gain -4
3 set-control 1 :gain -20
4 set-control 1 :gain -5
5 free 1
---
incudine amp.cudo -s amp-test.rego</pre>
<p>
Another example, where a multi output plugin returns a FRAME:
</p>
<pre class=""src src-sh"">cat &gt; gverb.cudo &lt;&lt;'---'
(lv2-&gt;vug ""http://plugin.org.uk/swh-plugins/gverb"" gverb)
(dsp! gverb-test (room-size rev-time damping input-bw dry early-level
tail-level scale)
(frame-out (gverb room-size rev-time damping input-bw
dry early-level tail-level (audio-in 0))
2 0 scale))
---
cat &gt; gverb-test.rego &lt;&lt;'---'
0 gverb-test 80 8 0.5 0.75 -70 0 -17 .4 :id 1
3 set-controls 1 :freq .3 :dt .05 :dry -77 :rev-time 30 :tail-level -7
6 set-control 1 :rev-time 1
---
incudine gverb.cudo -i voice.wav --pad 3 -r 96000 -s gverb-test.rego</pre>
<p>
If you have also created the incudine command with the support for
LADSPA, here is an example to use LADSPA plugins:
</p>
<pre class=""src src-sh"">cat &gt; plate-rev.cudo &lt;&lt;'---'
(ladspa-&gt;vug ""caps"" ""Plate"" plate-reverb)
(dsp! plate-reverb-test (trig-freq input-decay input-scale bw tail damping blend)
""Test of the Plate reverb developed by Tim Goetze.""
(with-samples ((in (* (decay (impulse trig-freq) input-decay)
(white-noise input-scale))))
;; PLATE-REVERB returns a frame because there are two outputs.
(multiple-sample-bind (l r)
(plate-reverb bw tail damping blend in)
(out l r))))
---
cat &gt; plate-rev-test.rego &lt;&lt;'---'
0 plate-reverb-test 4 .165 .5 .75 .5 .25 .25
2 set-controls 1 :trig-freq 1.5 :tail .8 :dumping .1 :blend .5
5 set-control 1 :trig-freq .1
8 free 1