Hey, check out my FIR Chugin: https://github.com/ccrma/chugins/tree/master/FIR In the examples folder there's a convolution example. Not super efficient (circular buffers would be required for that), but direct from the definition. Most efficient would be FFT based. If there's no example of that. I'll make one. Standby. Enjoy!! Prc Sent from my iPhone
On Nov 25, 2014, at 9:00 AM, chuck-users-request@lists.cs.princeton.edu wrote:
End of chuck-users Digest, Vol 112, Issue 8 *******************************************
Note also that the FIR chugin is included in the default install of ChucK,
so if you have a recent version (1.3.3.0 or later) you are already good to
go!
spencer
On Tue, Nov 25, 2014 at 11:01 AM, Perry Cook
Hey, check out my FIR Chugin:
https://github.com/ccrma/chugins/tree/master/FIR
In the examples folder there's a convolution example. Not super efficient (circular buffers would be required for that), but direct from the definition.
Most efficient would be FFT based. If there's no example of that. I'll make one. Standby.
Enjoy!!
Prc
Sent from my iPhone
On Nov 25, 2014, at 9:00 AM, chuck-users-request@lists.cs.princeton.edu wrote:
End of chuck-users Digest, Vol 112, Issue 8 *******************************************
chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
-- Spencer Salazar Doctoral Candidate Center for Computer Research in Music and Acoustics Stanford University https://ccrma.stanford.edu/~spencer/
I have ChucK 1.3.4.0 (Linux) and it returns "undefined type FIR". Not
exactly "good to go"... perhaps is this because I installed it from the
github repo?
Best regards!
On Tue, Nov 25, 2014 at 7:51 PM, Spencer Salazar wrote: Note also that the FIR chugin is included in the default install of ChucK,
so if you have a recent version (1.3.3.0 or later) you are already good to
go! spencer On Tue, Nov 25, 2014 at 11:01 AM, Perry Cook Hey, check out my FIR Chugin: https://github.com/ccrma/chugins/tree/master/FIR In the examples folder there's a convolution example. Not super
efficient (circular buffers would be required for that), but direct from
the definition. Most efficient would be FFT based. If there's no example of that. I'll
make one. Standby. Enjoy!! Prc Sent from my iPhone On Nov 25, 2014, at 9:00 AM, chuck-users-request@lists.cs.princeton.edu
wrote: End of chuck-users Digest, Vol 112, Issue 8
******************************************* chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users -- Spencer Salazar
Doctoral Candidate
Center for Computer Research in Music and Acoustics
Stanford University
https://ccrma.stanford.edu/~spencer/ _______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users --
Jean Menezes da Rocha
Compositor
Professor -- Faculdades Est
Mestre e Doutorando em Composição pela Universidade Federal da Bahia
FFT version. Most efficient, lots of delay. Could chunk up and factor, overlap-add for less delay. This is the basic idea tho. // FFT convolution with static impulse response // by Perry R. Cook, November 2014 // upsides: as efficient as it could be, save for // constructing a specific fft convolution chugin // downsides: minimum delay is length of impulse response + buffers // fix: break into pieces and overlap add // Other fix: see filter version using my FIR Filter chugin // our fixed convolution kernal (impulse response) SndBuf s => FFT ffth => blackhole; "CelloBodyShort.wav" => s.read; // whatever you like (caution of length!!) 2 => int fftSize; while (fftSize < s.samples()) 2 *=> fftSize; // next highest power of two fftSize => int windowSize; // this is windowsize, only apply to signal blocks windowSize/2 => int hopSize; // this can any whole fraction of windowsize 2 *=> fftSize; // zero pad by 2x factor (for convolve) // our input signal, replace adc with anything you like adc => Gain input => FFT fftx => blackhole; // input signal IFFT outy => dac; // our output fftSize => ffth.size => fftx.size => outy.size; // sizes Windowing.hann(windowSize) => fftx.window; // <<< s.samples(), fftSize >>>; windowSize::samp => now; // load impulse response into h ffth.upchuck() @=> UAnaBlob H; // spectrum of fixed impulse response s =< ffth =< blackhole; // don't need impulse resp signal anymore complex Z[fftSize/2]; 1000 => input.gain; // fiddle with this how you like/need while (true) { fftx.upchuck() @=> UAnaBlob X; // spectrum of input signal // multiply spectra bin by bin (complex for free!): for(0 => int i; i < fftSize/2; i++ ) { fftx.cval(i) * H.cval(i) => Z[i]; } outy.transform( Z ); // take ifft hopSize :: samp => now; // and do it all again }
participants (4)
-
Jean Menezes da Rocha
-
Perry Cook
-
Perry R Cook
-
Spencer Salazar