Convolve an Array of channels to an Array of channels.
in |
The input signal, an array. |
kernel |
The convolution kernel. |
mul |
Output will be multiplied by this value. |
add |
This value will be added to the output. |
An array of channels.
// hand code a mono signal to a decorrelated soundfield in B-format // NOTE: the demonstrated kernel is not ideal for this task // define encoding kernel ( var kernelSize; var scale; kernelSize = 256; scale = 24.neg.dbamp; ~kernel = [[ Buffer.loadCollection(s, FloatArray.fill(kernelSize, {(3/2).sqrt * scale.rand2})), Buffer.loadCollection(s, FloatArray.fill(kernelSize, {scale.rand2})), Buffer.loadCollection(s, FloatArray.fill(kernelSize, {scale.rand2})), Buffer.loadCollection(s, FloatArray.fill(kernelSize, {scale.rand2})) ]] ) // convolve ( { var sig; // pink noise sig = PinkNoise.ar; // encode AtkKernelConv.ar(sig, ~kernel); }.scope ) // free kernel when finished ~kernel.at(0).do({arg kern; kern.free})