[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-dev] happy convolution
Have developed a proper running (non circular with
zero padding and overlap output...) Fast Convolution
plug-in, which I've checked in as Convolution.cpp in
the plug-ins folder. I'll check it in to the project
itself properly once I get Panther+XCode in the new
year (I'm still using PB right now), or someone else
can. I thought it best to commit the first draft for
anyone who'd like to try it and make suggestions, plus
there is some SC source code below (no help file as
yet, will do one eventually).
best wishes to all, I shall now go vaguely
incommunicado for a holiday.
N
//SC3 example code, class code
(
//must have power of two framesize- FFT size will be
sorted by Convolution to be double this
//maximum is currently a=8192 for FFT of size 16384
a=2048;
s = Server.local;
//kernel buffer
g = Buffer.alloc(s,a,1);
)
(
//random impulse response
g.set(0,1.0);
100.do({arg i; g.set(a.rand, 1.0.rand)});
{ var input, kernel;
input=AudioIn.ar(1);
kernel=
PlayBuf.ar(1,g.bufnum,BufRateScale.kr(g.bufnum),1,0,1);
Out.ar(0,Convolution.ar(input,kernel, 2*a, 0.5));
}.play;
)
///class
Convolution : UGen
{
*ar { arg in, kernel, framesize=512,mul = 1.0, add =
0.0;
^this.multiNew('audio', in, kernel,
framesize).madd(mul, add);
}
}
________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html