Real time convolution
Hello, I am a beginner to Max/Msp.
I have a problem of convolving an impulse response (2 seconds long) with a music sample (16 seconds long). In the attached patch, I opened an impulse response on the left sfplay~ object and the music sample is opened in the right sfplay~ object. The problem is that I cannot convolve the whole music sample with the whole impulse response. In other words, the music sample is convolved with the impulse response only for 2 seconds (which is the length of the impulse response) every time I press the text message '1' connected to the left sfplay~ object.
I suspect using buffer object might help, however I do not know if it is useful. If so, please help me how to do.
Another question is how long it will be taken for the convolution of an impulse response with 18 seconds music sample. The sampling rate used for the music is 44.1 kHz, 16 bit. The reason I concern about this is that the impulse response has to be replaced to another impulse response instantly. So i hope the time is not longer than 0.5 second.
Thanks in advance.
when you call it "impulse response" it seems that you
are going to build a deconvolution reverb.
using fft/pfft and convolving 2 channels volumes is
not how deconvolution reverbs work.
it will need too much CPU to build something like that in
maxmsp as you can not optimise the process good enough
(compared to C language stuff) but there is a third party
external which can do it.
the best way to find it is searching for "convolution"
on maxobjects.com:
-110
Thanks Roman Thilenius for your prompt reply.
What I want to do is to convolve reverb, not to deconvolve reverb.
I did download tconvolve object from the website you provided. However I do not know how to use. Could anyone please provide me a simple guide?
Roman Thilenius wrote on Tue, 21 July 2009 13:35
when you call it "impulse response" it seems that you
are going to build a deconvolution reverb.
using fft/pfft and convolving 2 channels volumes is
not how deconvolution reverbs work.
it will need too much CPU to build something like that in
maxmsp as you can not optimise the process good enough
(compared to C language stuff) but there is a third party
external which can do it.
the best way to find it is searching for "convolution"
on maxobjects.com:
-110
Do you know how much CPU?
I have a quadcore 2,53ghz processor, will this struggle you think?
I do not know. I have 2.2 GHz core 2 duo.
I have another problem of using tconvolution vst. In order to use this plug-in, I need pluggo installed in Max/msp. However the pluggo is no longer available for max/msp, of which version higher than 5.0.
So another option for the convolution reverb would be SIR vst. The version 1 (SIR1) is free however the version 2 (SIR2) is USD$189. And only the version 2 is compatible with mac.
Anyone knows a good convolution reverb vst plug-in, which is complementary and compatible with mac?
marlon brando wrote on Thu, 23 July 2009 13:45
Do you know how much CPU?
I have a quadcore 2,53ghz processor, will this struggle you think?
i am a motu customer since day 1.
honeysyd wrote on Thu, 23 July 2009 14:06I do not know. I have 2.2 GHz core 2 duo.
you will know by trying it out.
but i think marlon brando was talking about the tconvolution~
OBJECT rather than the plug-in.
try the object in max - its pretty cool.
yet not as effective as commercial products.
Does TconvolutionUB~ support only the sampling rate of 44.1 kHz?
I have an impulse response and a music segment sampled at 48 kHz. However the output of the TconvolutionUB has the sampling rate of 48 kHz, although those files are opened in Max/MSP with the sampling rate of 44.1 kHz.
Is there a method to convolve them with the sampling rate of 48 kHz??
I have attached three waveforms resulting from three different convolution method: (1) Aurora plugin in Adobe Audition; (2) Tconvolution object in Max/MSP; and (3) SIR2 VST plugin opened with vst~ object in Max/Msp. As seen in the attached, the three methods show substantially different waveform profiles, although slightly different gain adjustment is taken into account.
Another question is why my CPU usage gets high when I open the patch having TconvolutionUB~, even while I do not run any convolution calculations.
Thanks Roman Thilenius for your very useful answer.
honeysyd wrote on Fri, 24 July 2009 21:36
Is there a method to convolve them with the sampling rate of 48 kHz??
by converting the files before using them or by setting
your hardware to 48 khz. the loss of quality, if any, is
the same. when we are taking into account that you eventually
will go back to 44.1 at a point.
Quote:
Another question is why my CPU usage gets high when I open the patch having TconvolutionUB~, even while I do not run any convolution calculations.
i assume it runs all the time, like al msp objects do.
in case it does not support turning it off by a message
you might want to look into the helpfiles for [begin~] or
[poly~].
-110
.
Roman Thilenius wrote on Fri, 24 July 2009 15:38
by converting the files before using them or by setting
your hardware to 48 khz. the loss of quality, if any, is
the same. when we are taking into account that you eventually
will go back to 44.1 at a point.
The impulse response and the music were sampled at 48 kHz already. Would you suspect that the inconsistent sampling rate between the three methods causes the different profile of convolved sound waveforms?
I have attached the patch I used. Please have a look.