Just a test (Realtime Convolution)

Sound synthesis techniques, DSP and related mathematics

Moderators: electrogear, exonerate

Just a test (Realtime Convolution)

Postby matti on Tue Nov 11, 2008 1:39 am

I wanted to test out a theory.. and it seemed to work alright.

Realtime Convolution with SM :) -> download a vst

Yep, that's right, there's no latency.
But there are few drawbacks:
- High cpu usage
- Only 2048 sample mono Impulse Responses
(loads stereo files too, but won't use the stereo information)

Good things:
- Zero latency convolution
- Loads Wav files
- Resampling of the IR's if needed
- Stereo processing (two channels processed with the same IR)
- Graph of the frequency response(blue for the 2048 sample, red for the original n-sample)
- Graph of the phase response(orange)

Consider this a tech demo, nothing more..

Be carefull when loading IR files!
matti
essemilian
 
Posts: 472
Joined: Thu Nov 02, 2006 5:23 pm
Location: Finland

Re: Just a test (Realtime Convolution)

Postby infuzion on Tue Nov 11, 2008 4:08 am

Wow!
Let me know if you want some ASM help here...
Need help? First search the forum & WiKi, then post in the help forum with a clear topic, request, & OSM. Then please WiKi the correct solution. If you want my personal assistance, I charge by the hour or for an exchange of services.
infuzion
smstar
smstar
 
Posts: 6163
Joined: Wed May 04, 2005 8:02 pm
Location: Earth, USA, CO, Denver

Re: Just a test (Realtime Convolution)

Postby aliasant on Tue Nov 11, 2008 8:00 am

Very cool. It wouldnt accept any of my IR files but it did work with a mono wave audiotrack that I have for test purposes.
That was about a minute of audio but I guess it just took the 2048 first sampels of that ?

You should sell this to Malc =)
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden

Re: Just a test (Realtime Convolution)

Postby matti on Tue Nov 11, 2008 10:20 am

Yes it takes the 2048 first samples.

I don't think there's any "real" applications for this. The CPU usage is just too high. There are some things i could try that might help my 3ghz P4 to run 8192 sample stereo impulses(in theory it could work), but that's still not much, and it would eat up all the power. I think i should try if this works better with C++/asm...
matti
essemilian
 
Posts: 472
Joined: Thu Nov 02, 2006 5:23 pm
Location: Finland

Re: Just a test (Realtime Convolution)

Postby aliasant on Tue Nov 11, 2008 10:23 am

matti wrote:Yes it takes the 2048 first samples.

I don't think there's any "real" applications for this. The CPU usage is just too high. There are some things i could try that might help my 3ghz P4 to run 8192 sample stereo impulses(in theory it could work), but that's still not much, and it would eat up all the power. I think i should try if this works better with C++/asm...



Well If your building a amp simulator or something else you dont need long impulses. Same if you want to simulate a filter.
Doing that you need very small impulses and maybe 2048 is just enough for that?
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden

Re: Just a test (Realtime Convolution)

Postby TomC on Tue Nov 11, 2008 10:35 am

aliasant wrote:
matti wrote:Yes it takes the 2048 first samples.

I don't think there's any "real" applications for this. The CPU usage is just too high. There are some things i could try that might help my 3ghz P4 to run 8192 sample stereo impulses(in theory it could work), but that's still not much, and it would eat up all the power. I think i should try if this works better with C++/asm...



Well If your building a amp simulator or something else you dont need long impulses. Same if you want to simulate a filter.
Doing that you need very small impulses and maybe 2048 is just enough for that?


Yeah, but 2048 is too short, it'll be 1/20 sec @ 44.1 kHz.

I did a convolution module some months ago (probably a similar algorithm) and decided it's not worth my time to investigate further as long as there are no proper primitives available in SM.

It works, but it's like stabbing yourself to death with a Swiss army knife: it's possible, but the fun wears out after a couple of stitches...

Tom
.signature failure
User avatar
TomC
smanatic
 
Posts: 706
Joined: Tue Oct 02, 2007 9:34 pm
Location: 3rd rock from the sun

Re: Just a test (Realtime Convolution)

Postby matti on Tue Nov 11, 2008 10:38 am

aliasant wrote:
matti wrote:Yes it takes the 2048 first samples.

I don't think there's any "real" applications for this. The CPU usage is just too high. There are some things i could try that might help my 3ghz P4 to run 8192 sample stereo impulses(in theory it could work), but that's still not much, and it would eat up all the power. I think i should try if this works better with C++/asm...



Well If your building a amp simulator or something else you dont need long impulses. Same if you want to simulate a filter.
Doing that you need very small impulses and maybe 2048 is just enough for that?


Well.. yes i suppose so. Anyone thinking of building one btw? It would help in defining the needs for this convolution effect. If i would keep it down to 2048 samples i think i could squeeze a bit off the cpu usage. Making a mono version would also slice off half of the cpu usage..

Btw. i tested this myself with analog mixing console impulses. 2048 was just enough to get some of them to work properly. With longer impulses it ofcourse lost some of the content.
matti
essemilian
 
Posts: 472
Joined: Thu Nov 02, 2006 5:23 pm
Location: Finland

Re: Just a test (Realtime Convolution)

Postby aliasant on Tue Nov 11, 2008 10:53 am

I would love to put some of that in my effects.
Impuses are easy to find and there are plenty out there that sounds great.
Very nice in any vst effect. What it needs to have is a way to store more then 1 impulse.
Do you load them like any wave file? If so thats not a problem.
One could have a set of favorite impulses that the user can select from.
No need for the user to try and find impulses of his own.
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden

Re: Just a test (Realtime Convolution)

Postby matti on Tue Nov 11, 2008 11:02 am

Yes they are like normal wave files.. So selectable impulses(basicly on the fly) could be possible. There are just alot of problems in how SM works to get them running smoothly. For example getting the array values to the code efficiently (now i basicly just have 2048 inputs in it ;) )
matti
essemilian
 
Posts: 472
Joined: Thu Nov 02, 2006 5:23 pm
Location: Finland

Re: Just a test (Realtime Convolution)

Postby aliasant on Tue Nov 11, 2008 11:15 am

matti wrote:Yes they are like normal wave files.. So selectable impulses(basicly on the fly) could be possible. There are just alot of problems in how SM works to get them running smoothly. For example getting the array values to the code efficiently (now i basicly just have 2048 inputs in it ;) )


OK. So how many cycles does one mono instance use?
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden

Re: Just a test (Realtime Convolution)

Postby matti on Tue Nov 11, 2008 2:43 pm

aliasant wrote:
matti wrote:Yes they are like normal wave files.. So selectable impulses(basicly on the fly) could be possible. There are just alot of problems in how SM works to get them running smoothly. For example getting the array values to the code efficiently (now i basicly just have 2048 inputs in it ;) )


OK. So how many cycles does one mono instance use?


It seems there's no way to benefit from the SIMD structure in SM with this schematic. There just isn't a way to get the data inside the code modules to be efficient enough. So basicly doing mono is not a viable solution after all. And to answer your question: one mono instance uses as much as 4 identical mono instances(packed stream). The vst in the link is basicly a mono instance. In a modular host using it with mixing desk(or eq, or similar short IR) emulation this might not be a problem, as you get 4 channels(with the same IR tho) with the price of one. All in all, i think this might already be as efficient as it possibly can :S
matti
essemilian
 
Posts: 472
Joined: Thu Nov 02, 2006 5:23 pm
Location: Finland

Re: Just a test (Realtime Convolution)

Postby infuzion on Tue Nov 11, 2008 3:51 pm

matti wrote:It seems there's no way to benefit from the SIMD structure in SM with this schematic. There just isn't a way to get the data inside the code modules to be efficient enough
I know some ASM-fu that might help with that ;)
Need help? First search the forum & WiKi, then post in the help forum with a clear topic, request, & OSM. Then please WiKi the correct solution. If you want my personal assistance, I charge by the hour or for an exchange of services.
infuzion
smstar
smstar
 
Posts: 6163
Joined: Wed May 04, 2005 8:02 pm
Location: Earth, USA, CO, Denver

Re: Just a test (Realtime Convolution)

Postby matti on Tue Nov 11, 2008 4:23 pm

infuzion wrote:
matti wrote:It seems there's no way to benefit from the SIMD structure in SM with this schematic. There just isn't a way to get the data inside the code modules to be efficient enough
I know some ASM-fu that might help with that ;)

Haha, you just want to see the source ;)
Well there's nothing magical about it. It's just a 2048 tap Fir filter with an IR as it's coefficient. The structure of the FIR is pretty close to the one on the "visual designer" by rl. I really liked the way an array was be inputted to the code in that schematic. Even tho it has it's drawbacks.

What kind of ASM-fu's you might have to get arrays inside the code faster?
matti
essemilian
 
Posts: 472
Joined: Thu Nov 02, 2006 5:23 pm
Location: Finland

Re: Just a test (Realtime Convolution)

Postby bootsy on Tue Nov 11, 2008 7:29 pm

why don't you just give up on the zero latency approach?
Come and visit my Blog: Variety Of Sound
bootsy
essemilian
 
Posts: 370
Joined: Sat Jul 28, 2007 10:55 am
Location: Frankfurt, Germany

Re: Just a test (Realtime Convolution)

Postby matti on Tue Nov 11, 2008 7:51 pm

bootsy wrote:why don't you just give up on the zero latency approach?

Any ideas how to do that? I thought of doing a simple FFT with code, but it seems like it would be a bit too much work.

Btw. i found a better way of getting the data inside the code. That way i got the cpu usage slimmed down to half(or less) and now it works with stereo impulses. -> v2
There's also a mono version with lower cpu usage. Stereo version has a 1 sample latency, mono 4 sample.
matti
essemilian
 
Posts: 472
Joined: Thu Nov 02, 2006 5:23 pm
Location: Finland

Next

Return to Sound

Who is online

Users browsing this forum: No registered users and 1 guest

cron