SynthMaker

Just a test (Realtime Convolution)

Archive · 2008 131 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

matti ·

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!

infuzion ·

Wow! Let me know if you want some ASM help here...

aliasant ·

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 =)

matti ·

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...

aliasant ·

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?

TomC ·

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

matti ·

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.

aliasant ·

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.

matti ·

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 😉 )

aliasant ·

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?

matti ·

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 😕

infuzion ·

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 😉

matti ·

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?

bootsy ·

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

matti ·

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.

bootsy ·

matti wrote: 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.

yes, thats what I meant, changing to frequency domain. Some requested already FFT on stream data.

ronaldpassion ·

matti wrote: 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, can u upload with (.zip) one? my internet cant download the zip one.

Really interest 2 convolution concept Thanx

ronaldpassion ·

THE OSM file plis

thanx

nix ·

I think matti is hanging onto it coz it might be something, like. Cheers

matti ·

Well it's nothing special. Just some FIR filters batched up together. I could perhaps post it because the methods used are no secret. There's bunch of cool tricks for saving in cpu usage inside there too 😉 But I'm not home now so you'll have to wait prob until next year for me to upload it.

Btw. all (near-)realtime convolution algorithms(atleast that i know of) are based on using a small FIR and several small FFT's to do the convolution in small sections. When the new timing system arrives to SM it could be possible to build some reverb's too 🙂

aliasant ·

matti wrote: Well it's nothing special. Just some FIR filters batched up together. I could perhaps post it because the methods used are no secret. There's bunch of cool tricks for saving in cpu usage inside there too 😉 But I'm not home now so you'll have to wait prob until next year for me to upload it.

Btw. all (near-)realtime convolution algorithms(atleast that i know of) are based on using a small FIR and several small FFT's to do the convolution in small sections. When the new timing system arrives to SM it could be possible to build some reverb's too 🙂

Cant wait matti =) I think that if I can see how you did it I just might understand some of it. Reading about something never taught me anything. Have to see it.

matti ·

So here is my crazy Convolution FIR filter schematic. http://www.mkdr.net/FIR-M/

First of all it's based on the cool cascadable FIR structure by Rudolf Lindner, from the "VisualFir" schematic on these forums. The original's CPU usage was around 5.4%(on a 2.8ghz P4) for a 256 tap mono filter and it had no SSE parallelization used. As such it was not very suitable for my purposes of doing FIR's with a targeted 2048 taps(with a quick calculatable estimate: 5.4% * 8 = 43.2% : in stereo it would be twice that). The biggest problem in my implementation was to get SM to run 4 parallel filter calculations efficiently with SSE as it seemed the "Pack" primitive ate up all the processing power. My solution was to build my own "Pack" and do the data shuffling in stage 0 to minimize the cpu usage, as the coefficient was going to be static anyhow(could be hopped too i guess?). Float array input in asm and code modules could've made life alot easier tho.. All this trickering about made the schematic very BIG and clumsy. Even tho i tried to keep everything clean and tidy, loading impulse responses took several seconds. Reducing the amount of modules reduced the load times dramaticly. This is worth noting if having trouble with long load times.

In the end i got the 2048 tap stereo implementations cpu usage down to a nice and light 14.8%, which is considerably lower than the 86.4% i estimated from the original one. Also the load times of the plugin itself and the IR's are now instantaneous. Hope you find this schematic usefull. Like i said it's nothing special and not that usefull as it's not the "sensible" way of doing convolution. Let me know if there's any bugs or errors in there.

And please remember who made this, and respect it by noting it if you borrow the code. 🙂

Disco_Steve ·

you must own Bernard's watch, and be able to stop time!! can I borrow your watch please 🙂 incredible work, must have taken you a lifetime!!

matti ·

Disco_Steve wrote: you must own Bernard's watch, and be able to stop time!! can I borrow your watch please 🙂 incredible work, must have taken you a lifetime!!

Haha, no. It didn't take that long. With enough of modularisation you can just copy and paste most of the stuff to grow it bigger. If you notice even the asm is done in this way. All i had to do is copy and paste and in the end edit the right numbers on all the float names and stream names. Just a few key presses.. just like playing the piano 😀

bootsy ·

Hi matti,

looks really promising! However, some things are a bit odd: - Most of my favourite IRs I've just tested with this device sounds completly different as with e.g. PristineSpace or SIR2 - The frequency and phase responses of those plotted in VST analyzer are different as well - and so is the plot in your plug-in different too

I took some standard 44.1kHz 24bit IRs (stereo). If you need some files, plots or testing support just let me know - I would be glad to contribute a little to this...

peace, bootsy

matti ·

bootsy wrote: Hi matti,

looks really promising! However, some things are a bit odd: - Most of my favourite IRs I've just tested with this device sounds completly different as with e.g. PristineSpace or SIR2 - The frequency and phase responses of those plotted in VST analyzer are different as well - and so is the plot in your plug-in different too

I took some standard 44.1kHz 24bit IRs (stereo). If you need some files, plots or testing support just let me know - I would be glad to contribute a little to this...

peace, bootsy

Might be a bug or you might have wrong latency settings on in VST Analyser. The responses are going to be different because of the 2048 sample limit too. The schematic is there, so please test and modify 🙂

The stereo version has a 1 sample latency. The mono version has a 3 sample latency. These come from the loop i did to take advantage of the 4 simultaneous SSE "threads".

matti ·

matti wrote: Might be a bug ...

I did a quick test with SIR with the same IR and it seems there really is some bug in my schematic somewhere. I have to dig a bit to find it.. 😕

bootsy ·

I will try to have a closer look to the schematic as well during the week. Upfront some possible hint: The effective curves (frequency) in the analyzer looks a little bit like if there is some sideeffects of the group delay due to e.g. a) some parallel processing somewhere or b) the reportet delay is not correct ...

matti ·

Well, lot's of little bugs in here actually 😊 But this underlines the problem of not beeing able to use an analyser on mono signals the way it can be used on poly signals. What i'd need is a way to debug 4packed calculations too.

More on the bugs: i tested my FIR asm in a poly environment and it gave out correct readings. Just like it did when i was prototyping the original idea. The 4packed version seems to discard all but the first calculation in all of the asm primitives. That means the FIR-M only outputs the 122 tap filter, even tho its calculating all 2048. There's something fishy about how this thing is working, and better debuggin tools would be very useful. Might there be something similar to the delay stage stuff?

matti ·

Doing it in stage's like the toolbox delays(and some coeff ordering stuff) fixes the problems. This means that VisualFir also has a bug.

Now i only need to write it in fast asm again...

bootsy ·

cool! I stay ready for re-testing.

matti ·

The stage trick adds latency tho.. And maybe some distortion too? Just look at the freq response at higher freqs..

Here's a version with better frequency response, but because of the different structure(32tap filters were quicker to rewrite for testing purposes) there's now 67 sample latency 😕 It seems that every asm primitive adds to the latency. So 16 primitives * 4(because of the 4 sse channels) + 3 from the looping to use all the sse channels = 67. Even at best this would be 5(the primitives) * 4(sse) + 3(looping) = 23.

Fun experiment but it seems SM just isn't ready for these kind of calculations.. for various reasons. I'm soon starting with CUDA FFT's to build some intresting VST's. Let's hope i get some cool realtime convolution reverbs done with that 🙂

Tom7777 ·

Fun experiment but it seems SM just isn't ready for these kind of calculations..

If it's correct inside it definately seems that way, i ran a reverb IR through it, in SIR it sounds great but in this it sounds like a distortion or something. 😕

matti ·

Tom7777 wrote: Fun experiment but it seems SM just isn't ready for these kind of calculations..

If it's correct inside it definately seems that way, i ran a reverb IR through it, in SIR it sounds great but in this it sounds like a distortion or something. 😕

Heh, well it's only suitable for very short IR's. Reverbs tend to be several seconds long. This can only cope with 1/20th of a second.

If the "stage-bug" gets fixed/changed some day, this code should work nicely.

rl ·

matti wrote: ...This means that VisualFir also has a bug....

Do you refer to my schematic? If so, where do you think the bug is?. I thought it was correct since I double checked my FIR filter implementation with a couple of well-known frequency responses like the sinc function for a brickwall lowpass filter.

bootsy ·

matti wrote: The stage trick adds latency tho.. And maybe some distortion too? Just look at the freq response at higher freqs..

Here's a version with better frequency response, but because of the different structure(32tap filters were quicker to rewrite for testing purposes) there's now 67 sample latency 😕 It seems that every asm primitive adds to the latency. So 16 primitives * 4(because of the 4 sse channels) + 3 from the looping to use all the sse channels = 67. Even at best this would be 5(the primitives) * 4(sse) + 3(looping) = 23.

Strange, 1 sample delay per asm code module? Can't imagine that, we should ask SM ... Don't understood the filter modules itself atm, therefore: Is it ok, that the first sse channel which feeds the 'lastout' is zero all the time? I will test how the Analyzer looks like with this one when I'm at home, tonight. Btw. I've just used short impulses with this one, no reverbs.

Btw, I wouldn't give up that soon on that. Even a bunch of delay samples is probably less then you will obtain with a CUDA version.

matti wrote: Fun experiment but it seems SM just isn't ready for these kind of calculations.. for various reasons. I'm soon starting with CUDA FFT's to build some intresting VST's. Let's hope i get some cool realtime convolution reverbs done with that 🙂

matti ·

Ah, it seems the stage stuff didn't do anything. But the rewrite did. This is just too big project to do on my freetime 😀 I keep messing stuff up and never have the time to test it properly.. Haha, i need more sleep.. and time so i can do my microcontroller asm homework too.

But i'm getting this baby fixed soon.. Now i'm rid of that latency, but there's still that distortion of some sort. Maybe it's just from the fact that the IR end's too early? Anyone had a look at that yet?

And sorry rl. I was talking of your schematic, but it seems there's no problem in it.

matti ·

bootsy wrote: Strange, 1 sample delay per asm code module? Can't imagine that, we should ask SM ...

Yes, if you do the stage 2 and 3 stuff it introduces additional delay to the signal. Try this: put a toolbox delay module after an impulse and look at the readout with an analyser. With delay set to 0 it shows that the impulse is at the first sample. Now put another delay in between, with delay set to 0. The analyser will show a 1 sample delay. With more modules, there will be more. Three delays with each set to a delay of 1 won't give a delay of 3 samples, but 5.

aliasant ·

matti wrote: bootsy wrote: Strange, 1 sample delay per asm code module? Can't imagine that, we should ask SM ...

Yes, if you do the stage 2 and 3 stuff it introduces additional delay to the signal. Try this: put a toolbox delay module after an impulse and look at the readout with an analyser. With delay set to 0 it shows that the impulse is at the first sample. Now put another delay in between, with delay set to 0. The analyser will show a 1 sample delay. With more modules, there will be more. Three delays with each set to a delay of 1 won't give a delay of 3 samples, but 5.

isnt that because you cant actually set the delay to 0 ? It never goes under 1 sample. Not sure about this but I think this is the case. Im hoping Stefan will write a Latency checker. He started but needs time to finish it.

bootsy ·

I've just hooked the analyzer in and just some observations: The frequency plot and the distortion in there somehow changes depending how I cut the IR's further down. I've managed to get one to how it should look like by trimming the impulse file symmetrically around the impulse peak (Most are not symmetrically). Is symmetry necesarry, aka does the peak has to be at 2048/2 ?

matti ·

aliasant wrote: isnt that because you cant actually set the delay to 0 ? It never goes under 1 sample.

I could live with that. But that's not how it works. Delay set to 0 is a delay of 0 samples. But two delays set to 0 is a delay of 1 sample.

Tom7777 ·

Heh, well it's only suitable for very short IR's. Reverbs tend to be several seconds long. This can only cope with 1/20th of a second.

If the "stage-bug" gets fixed/changed some day, this code should work nicely.

Ok, do you mean it's a bug stopping long ir's now? also im thinking maybe for long ones the code modules need a array input as it seems some of the inside parts completely fill the whole page, either that or the dynamic schematic size adjust when you drag a module down which i and others requested if it ever happens, im guessing it might cut down the cpu size having it in a single code block but currently thats not possible due to these things.

RunBeerRun2 ·

Not bad on cpu. I'm gonna play around with this today.

RunBeerRun2 ·

This is pretty cool, I just used a low pass filter, stock SM distortion and a homemade impulse for an amp sim, 4.5% cpu.

aliasant ·

matti wrote: aliasant wrote: isnt that because you cant actually set the delay to 0 ? It never goes under 1 sample.

I could live with that. But that's not how it works. Delay set to 0 is a delay of 0 samples. But two delays set to 0 is a delay of 1 sample.

OK. I forgot to reply to this but I dont agree. have a look at these pictures.

I use different times as delays and depending on the delay the result varies. You can clearly see that the one with the dummy reports 0 while the one with a 1 sample delay primitive shows just that. That confirms that the Delay Calculator works. I wrote the simples code I could think of and yes, the code blocks both use 1 sample delay but if you use more then 1 codeblock it will still use only 1 sample delay. Even if you use 100 code blocks its still only 1 sample delay. At least if you hook them up in serial. Interesting here is that if you set the delay time to 0 the delays will be 1 and if you connect them in serial of 2 it will be 2 and so on. The Fractional delay seems to work more like the code blocks. If 3 are serial and delay time is 1 the final delay will be 4. 3+1. The old stock delay however shows 2 samples delay and if you hook 2 up in serial it will show 4 samples delay. Its all a bit odd and if you really want to know use the delay calc on your schematics.

theun ·

Hi Aliasant,

I would like to make some remarks after reading your post (above):

First, there seems to be a misunderstanding that code execution introduces latency. However code execution (except if it should work as a delay) should not introduce latency. If it would do so that would mean this piece of code consumes more CPU power than there is available. If your CPU runs at 2GHz (probably it's faster and you have doublecore and so on) and the samplerate you're at is 96 kHz (most people are at 44.1 or 48 I suppose) there are rougly 20,000 CPU clock cycles available to do the calculations necessary at sample rate! However to keep the CPU hit below say 10 % practically speaking we would have 2,000 clock cycles available. Simple (asm) instructions, like a move, add, compare usually take only 1 or 2 clockcycles, so 100 move instructions would only take 100 clockcycles. So, if you test the "latency" of a small piece of code, the outcome normally should be "0".

Secondly, at this "micro" level, I think you shouldn't overestimate the exactness of a measurement like this. In this specific case it finally depends on the question: "will the action (i.c. output changes from 0 to 1) propagate fast enough through the schematic to result in a change in the input that gets caught by the algorithm during the same execution at sample rate" (if you still can follow me 😉 ) . Even a small change in the order of the algorithm, or adding some fake statements might change the outcome.

Cheers

aliasant ·

I agree on most of what your saying and this is sort of the point of my post.

Its very hard to tell. But I think this latency calculator is pretty good. It measures correctly if I put nothing in the signal chain or if I put a 1 sample delay in it or several 1 sample delays or just a dummy folder. It always gives the expected result. To me it seems to be correct.

The problem as I see it is that often it is quite time critical when you use very small delays in eg. filters. The difference between a 2 sample delay and a 1 sample delay can be very critical. ( im dead tired while writing this so pardon my ramblings....)

What I tried to show was that different delays gives different results.

About the code blocks... Im not really sure but I think I understand it. maybe.... I think it has something to do with how SM compiles everything. SM dont care if you have 5 code blocks in serial or 1 with everything in it. At the end it will still use 1 sample delay for some reason. And that is probably not exact at all.

Finally. Why I posted in the first place is because matti said that: "Delay set to 0 is a delay of 0 samples. But two delays set to 0 is a delay of 1 sample." That didnt look right to me. At least not to my tests.

bed time.,...,.,.,.

Tzarls ·

So, I kept thinking about this convolution thing, specially since I didn´t have a clue of how it actually worked. So I did some research and finally understood what was it all about, and after some testing I built this:

Supports impulses up to 8192 samples, and has 0 latency (which is kind of strange, it should have a 1 sample latency since I´m delaying the input signal by 1 sample). Built using rl´s FIR module from visualfir and the packing routine from matti´s work (because I wasn´t going to rewrite all those streamins again!).

Usage is simple, load the plugin, load an IR (for some reason it won´t accept every IR), make sure it´s 8192 samples or less (or it´ll be truncated), flip the switch, wait until the readout reads 256, then force recompile and that´s it. All instructions are on screen. It uses about 50% CPU on my P4 2.8HT.

Let me know what you think of this!

Tzarls ·

Does this mean everyone lost interest in the convolution theme? C´mon guys! 😉

rl ·

You young people are always so impatient... I'm not at my DAW computer right now, so if you'd posted the osm file instead I'd be able to have a look immediately. 😇

aliasant ·

Tzarls wrote: Does this mean everyone lost interest in the convolution theme? C´mon guys! 😉

Most def not but not a fan of testing vst format 😉

Tzarls ·

Mmmmmmm.......you old people are always so right.... 🙂 Just wanted you o tell me "wow, thid is really working! How did you do it? Please, show us the .osm!". 😉 I´ve finished a self optimizing version which lowers cpu usage depending on IR length. I´ll make it automatic (so you don´t have to be flipping switches, just load the IR and it´ll process it) and then I´ll post the .osm for you.

By the way, I found that we can´t process much longer IRs, not because of CPU power, but because it seems that SM has a limit on the amount of operations in an schematic. When trying to do a 16382 sample conv module, I got domething like a "code exceeded" error. More on that later.

MichaelBenjamin ·

i think that sm is not really capable of doing that kind of stuff without using all cpu and a very big schematic which seems too cumbersome for me too have a deeper look into it. thats why sm would benefit from some core update, maybe with windowing functions and that stuff that other convolution plugins use. i dont know much about this but SIR for example takes any wave file as convolution source and doesnt use that much cpu. although convolution by itself is nice and i like the effects it can give.

Tzarls ·

The schematic itself isn´t that big, just very repetitive. I managed to take CPU down to around 37% (P4 2.8), but yes, some windowing for streams and access to buffers (memin?) would help a lot. Now, the thing about windowing is that there is an inherent latency to it, while the "brute force method" used here allows you to have real time convolution, at the expense of higher CPU usage, and there´s no way around it. I guess all other onvolution plugins available commercially aren´t realtime, or use a combination of brute force and windowing.

aliasant ·

Tzarls wrote: The schematic itself isn´t that big, just very repetitive. I managed to take CPU down to around 37% (P4 2.8), but yes, some windowing for streams and access to buffers (memin?) would help a lot. Now, the thing about windowing is that there is an inherent latency to it, while the "brute force method" used here allows you to have real time convolution, at the expense of higher CPU usage, and there´s no way around it. I guess all other onvolution plugins available commercially aren´t realtime, or use a combination of brute force and windowing.

Or very small windows 🙂

Tzarls ·

Ok, here it is, the self optimizing convolution schematic. Just load an IR, wait a couple of seconds (well, almost 25 seconds) and that´s it. Make sure ASIO is activated, btw.

Credits: RL and Matti (am I forgetting someone?)

Now I´ll be waiting for your comments and optimizations.

aliasant ·

Tzarls wrote: Ok, here it is, the self optimizing convolution schematic. Just load an IR, wait a couple of seconds (well, almost 25 seconds) and that´s it. Make sure ASIO is activated, btw.

Credits: RL and Matti (am I forgetting someone?)

Now I´ll be waiting for your comments and optimizations.

Question 1:

Is it really necessary o use that complex and time consuming timer system? Cant this method be used?

Tzarls ·

It depends. First of all, I don´t exactly know how the min-max primitive works, but if it just gets data from a mem and turns it into a Float Array, then that could work. But keeping the data in several small arrays is crucial for the ability to self optimize, because the way the data reorders itself when the IR is shorter than 8192 samples.

BTW, wouldn´t resampling a larger IR to 8192 samples change its pitch somehow? I´d rather just truncate.

Edit: Now that I think of it, all the data could be stored in one array and extracted as small chunks......but what´s the max size for a float array?

Tzarls ·

Yep, you were right, using the Min/Max will eliminate the timers, wave reads and overall waiting..... which is even better!

Tzarls ·

New version, now the IR loading is almost immediate thanks to Aliasant´s suggestion.

CPU usage stays around 35% for the full 8192 samples on my P4 2.8HT. I wonder if anything else could be optimized in order to make it a little lighter. From CPU usage alone, it looks like we could easily get 16384 or even more on a P4 machine. On a more powerfull PC we could even reach 44100 samples. On this schematic I´ve managed to get 1024 more samples, but as soon as I connect a second additional 1024 module, I get the "code exceeded" error.

Of course with this high CPU usage things are a little impractical for real life applications, except maybe for amplifier cabinets and eq-console impulses. Nevertheless, it´s good to feel that you can push SM to its limits and then some more.

As usual, awaiting you comments impatiently. 😉

aliasant ·

Nice that I could actually help 🙂

Been looking a bit at it and wondering. Why dont you cut the 8192 section just after the Array Max? Then adapt the rest to work on only 8192 samples?`

I also tried to put a NORM after the Array Max to make sure the data is high. This will of course change the amount of distortion but I cant see that as a problem?

I also added Left Min and Left Max together with a Float Array Add before cutting the 8192 section.

I have tried with a couple of ( about 114k size & 55000-65000 samples ) impulses I had of a DBX, Focusrite Red and SSL and it sounds pretty nice. Most of the data in these impulses are at the absolute beginning if the file so for that purpose cutting the first 8192 works pretty nice... except the huge waste of cpu.

I think there must be a way to write this smarter? I have seen simple convolution using almost no cpu.

Also wondering about this image.

Tzarls ·

Why dont you cut the 8192 section just after the Array Max? Then adapt the rest to work on only 8192 samples?`

Yes, I guess I just missed that one. I guess I was sure that it could work with more than 8192 samples sometime.

I also tried to put a NORM after the Array Max to make sure the data is high. This will of course change the amount of distortion but I cant see that as a problem?

I also added Left Min and Left Max together with a Float Array Add before cutting the 8192 section.

About adding L and R Max - when you use FloatArrayMinMax with a step of 1, Min and Max turn out to be the same for every sample, so adding them would be like multiplying the impulse by 2. That and normalizing don´t seem like a good idea for me - I have this thing for "purity of data", I don´t like to tamper with the original data, so I´d better leave it the way it is. 🙂

I think there must be a way to write this smarter? I have seen simple convolution using almost no cpu.

I guess they use FFT to reduce the amount of calculations needed, hence lowering the CPU requirements. Until we get some kind of FFT for streams, this is going to be the only way for realtime convolution in SM.

And about the image.....

The convolution process is basically a FIR filter using the present sample and all previous samples (up to the order of the filter, that is, a filter of 32nd order will have the present sample and the previous 31 samples in the formula) all multiplied by some coefficients and then summed. You can see that there are several delays implied in this process. In visualFiR´s modules (which are the ones I used) the delays are coded in each block (the a11=a10, a10=a9, a9=a8 parts). Because of optimization reasons, I´ve divided the very long formula (8192 mults and additions) in 4 parallel lines (mono4). The delay times in the picture show the amount of delay needed to align the 4 parts of the formula. BUT, when I looked at the picture I noticed that, when using IR larger than 8192 samples, the module that calculates the amount of FIR blocks needed doesn´t take into account the fact that the max amount of FIR blocks is 8, and misscalculates the delays. Easy to fix.

Tzarls ·

New version with a small fix - now the number of modules is limited to a maximum of 8 "reported" FIR modules. Without this limit, for large IRs only the first 2048 samples were being correctly processed.

Comments?

Tzarls ·

Just had time to test that last version (I did that quick fix in the middle of the night in my netbook, right beside my sleeping wife, so I couldn´t really make the required noise to test this things) and I really think it is working as it should - I even loaded some reverb IRs and could hear something like a gated reverb!

So I´ve been thinking..... if you check inside the schematic, at the very heart of it, you will see that this is just a bunch of small 32 tap FIR filters chained together in a very clever way (RL´s work). These FIR modules have 32 inputs for some floats taken from arrays, have a non-circular buffer structure inside which holds the last 32 samples and the coeffs mults and additions.

SO.....

What we have here is basically a module that, if hopped with a hop 32, will behave like a 32 sample window. We could replace the values from the arrays with their FFT´d values, and all we would need would be to calculate the FFT of the 32 buffered samples (in code), multiply those 32 values with the ones from the arrays (already FFT´d) and then calculate the iFFT of the result. THEN we will have some real and practical convolution module under SM.

All we need is the code for FFT and IFFT.

Is anyone willing to take the challenge? I would, but I´m not mathematically competent for this one. But, unless the FFT code is extremely difficult, I feel this can be finally achieved.

Unless, of course, I´m getting this totally wrong....

rl ·

Yes, that's the recipe to build convolution in the spectral domain with clever laid out FFT window, STFT buffer lengths and overlays,....

Some thoughts: - there is a static impulse response signal: Fine: it's possible to FFT it offline, but... - there is a dynamic input signal. Samples have to be collected into 1 or more FFT buffers (for overlay). FFT and iFFT work in "green". The trigger to start the FFT has to be derived from stream data: Expect timing glitches in current SM architecture. - process FFT data: possible, but... - trigger iFFT and put resulting samples back in audio buffer: I'd expect also time glitches here

other things to consider: - The SM devs never said a word which window function is used - IMO SM currently is missing some tools to efficiently implement that (like code module with memory or array input, sample accurate trigger generation,...)

At least the FIR filter approach leads to a working solution in your schematic. 🙂

Tzarls ·

That´s why I was asking for someone to code FFT and iFFT, to avoid having to go back into the green world. Inside every FIR module we already have the buffers needed (a00 thru a31 and c00 thru c31) for processing 32 samples at a time. Right, this wouldn´t be the most elegat approach, but without having array or mem inputs in for the code primitives this seems like the only way to get usable convolution.

rl ·

I see, but a FFT needs iterations, nested loops, etc. That's impossible using the code module and absolutely no fun to do in assembly.

MegaHurtz ·

Given the bunch of codes it`s hard to figure out what you did. If you do it one "frequency" Ill see if I can code it.

Tzarls ·

AFAIK, the FFT process has 2 stages:

1. The bit shifting stage. That part can be done easily by hand, assigning the floats to the desired buffer indexes (in code), specially since our buffer is fixed size.

2. The Danielson-Lanzcos algo. That´s the tricky part, mainly for the nested loops. Lets see, it is one external loop (doable) and 2 nested loops. These nested loops are only doable by hand - calculating each variable by hand, one at a time. That can be painfuly boring and repetitive, but in some way it´s just copy and pasting code and changing variable names. And we have the fact that our buffer is of a fixed size. How many iterations should we have to recreate?

Check this link with an implementation of the FFT (in C I think). If that code is right, we could use it as a starting point. I understand most of it, but still don´t know how to relate, for example data[j] and data[i] to our samples, or how to order real and imaginary..... or where to get the imaginary numbers.

Tzarls ·

Here´s a small file to be used as a template for this. Already has 32 inputs for getting the IR values inside the code (you have to fill the 32 green floats with some usable data for this example). If we manage to make this code work, this can be directly copied to my Convolution module and see the results on a higher number of samples (with the chaining of these small modules).

Maybe Megahertz you can use it to try to translate the code from the link I posted to SMcode.

RL.... do you really think this is not doable? Maybe I´m aiming too high for SM´s possibilities?

rl ·

Hehe, I've thought that "FFT in SM"-topic through some time ago but found me in a dead end somewhere. But maybe I'm totally wrong and have overlooked something.

From my understanding a 32 point FFT at 44100 Hz samplerate has an accuracy of 44100/32 = 1378 Hz. This seems to be far too less accuracy.

MegaHurtz ·

It`s actually quite a long ir.. If i understand correctly. But where`s the link? The first thought is to serialize the array, similar to the tecnique used in the box plot. But not knowing how this is going to be implemented ittd be yust as hard to implement as it is to write it. on the upside you would have the possibility to adjust your sizes with eaze. I guess theres more to this than yust multiplying the two arrays, and given it`s a finite impulse responce. One of the arrays can be delt with via a waveloader.. no?

Tzarls ·

http://www.codeproject.com/KB/recipes/howtofft.aspx

Sorry, I thought I had posted this!

Yes, it is a long FIR. All the process of loading and sorting the arrays has just been done - check my convolution module, there you´ll find the basis for this. All I need is to translate the code i the link and adapt my schematic to use it.

@rl.....yes, low resolution would be a real problem. But I´ll give it a shot nevertheless. I mean, once the code for 32 samples is in place and working, it shouldn´t be too difficult to try to make it work for larger sizes, up to the point of practicality (I don´t think a code module can handle 128 inputs, for example).

Tzarls ·

Does anybody know what this expressions means (in C I guess):

nn = n << 1;

j -= m;

j += m;

?

trogluddite ·

Not s sure about the <<. += and -= usually just mean increment and decrement (i.e. add or subtract one)

exonerate ·

Tzarls wrote: Does anybody know what this expressions means (in C I guess):

nn = n << 1;

j -= m;

j += m;

?

n<<1 means shift the bits in n left by one bit. The same as multiplying by two.

j -= m is equal to j = j - m.

j +=m is j = j+m

Cheers 😉

Exo

trogluddite ·

trogluddite wrote: += and -= usually just mean increment and decrement (i.e. add or subtract one)

exonerate wrote: j -= m is equal to j = j - m. j +=m is j = j+m

Doh! Like my teachers told me at school - I should always read the question properly before answering 😕

MichaelBenjamin ·

some teacher teached me that some of what teachers teach is wrong. now i was really irritated.

Tzarls ·

Thanks! Now to code the FFT.

BTW, I´ve thought of a way to store up to 1024 samples in a code buffer without the need of 1024 streamins and in just 32 samples time, and without much CPU hit (I hope).It should work, haven´t tried it yet, first I´ll finish coding the FFT, and if I´m succesfull I´ll try to take it from 32 samples to 128 or higher.

wish me luck.

Out!

exonerate ·

Tzarls wrote: Thanks! Now to code the FFT.

BTW, I´ve thought of a way to store up to 1024 samples in a code buffer without the need of 1024 streamins and in just 32 samples time, and without much CPU hit (I hope).It should work, haven´t tried it yet, first I´ll finish coding the FFT, and if I´m succesfull I´ll try to take it from 32 samples to 128 or higher.

wish me luck.

Out!

Good luck! will be quite a feat if you pull it off. 😀

Cheers 😉

Exo

TomC ·

Tzarls wrote: Thanks! Now to code the FFT.

BTW, I´ve thought of a way to store up to 1024 samples in a code buffer without the need of 1024 streamins and in just 32 samples time, and without much CPU hit (I hope).It should work, haven´t tried it yet, first I´ll finish coding the FFT, and if I´m succesfull I´ll try to take it from 32 samples to 128 or higher.

wish me luck.

Out!

It's possible to read your samples and feed them into a code module until a code array is filled (I took the waveplayer as base for this). The principle works, but I never got it completely right, and I hated the fact that I had to wait for all the samples to finish loading, so I decided to invest my precious time into other things and wait for malc to provide either a convolution primitive or a SDK.

But if you have the time I'd be happy to help you if necessary. When I'm back from winter vacation in 10 days of course 🙂

Tom

Tzarls ·

Back to you....

I´ve used this code: http://www.dspguide.com/ch12/3.htm

(the BASIC program) as the foundation for a little experiment - if I´m succesfull, then that should give us the posibility of FFT in code, although in a very limited fashion (like without the posibility of changing FFT size dyamically - you would need different codes for different sizes). I´ve been through the code several time now, and after carefull debugging, I´ve come to some very weird results. Feeding the same samples to both the BASIC routine and the FFT primitive in SM gives almost the same results. I say almost the same because SM´s result are always 4 times smaller than the program´s. If the program says that a certain´s value transform is -0.0024, then SM will return -0.0006 for that same sample. Is there any small and reliable FFT calculator (a Java applet, an online calculator or some small .exe) to compare results? Because either my program is wrong, or SM is wrong, I´d like some second opinion.

Edit: On second thought, this happens when calculating a 4 point FFT.....4 point, 4 times smaller.....maybe something´s missing here.

rl ·

I wouldn't care too much about the levels. The FFT result has to be normalized anyway.

How do you intend to implement the nested loops?

but wait...

MALC ARE YOU READING THIS?

HAVE MERCY!!!

-> Give us a software development kit or at least a little dynamic convolution module!

Otherwise us SM users would all turn into lunatic fringes...

last night I dreamt of SSE opcodes

Tzarls ·

Ok, so I can expect to have good results if I base my work in that code.

As for the nested loops - I won´t need them 😉 . I´ve turned the nested loops into one big loop with some lookup tables. Later on I´ll need some special ASM powers, because I´ll need a loop inside a hop (because we don´t need the FFT to be performed at samplerate, but only every n samples).

Soon I´ll post my first test, just a 4 point FFT in code. Not too useful, but a good starting point.

Tzarls ·

Found what appears to be a bug in the code primitive. If I´m working with buffers, and have something like:

REX [1] = REX [0] + var; out = REX [1];

REX[1] doesn´t get the correct value - it shows it´s original value (before the operation), but if you use an intermediate variable like this;

xx = REX[0] + var; REX[1] = xx; out = REX[1];

Then REX[1] get the correct value. I´m attaching an osm showing this behaviour - I´m using the latest beta, 1.1.7b5. Please confim (or correct me if i´m doing something wrong) so I can post this in the bugs section. I expected to have a working 4 point FFT by now, but this is stopping me - using intermediate variables would complicate things too much and add unnecesary lines.

Tzarls ·

What the heck, it isn´t that difficult to add the extra intermediate variables. SO, here´s a 4 point FFT in code, non optimized, in "raw" form. As you can see, there are 4 code blocks which could be easily transformed into a loop(4). The indexes for the REX and IMX buffers could be stored in a look-up table, and extracted based on the loop count. That would simplify things a lot, since in the raw (non-looped) version a 32 point fft would need more than 400 lines of code. Using the loop we would need only about 10 lines for the FFT and a loop of 80 iterations, plus a couple of look-up tables of about 80 values each.. And a hop on top of that to save cpu.

In case you are wondering, I used the BASIC program to calculate all the values you see in the code. For a "n" point FFT, I just enter "n=32" and the program outputs the code you see in the schematic. I will modify it so it gives me the code for the loop + the code (values) for the lookup tables. In the end, it would be just a matter of entering the number of points for the desired fft, then copy the generated code and paste it into SM´s code primitive. But it won´t be possible to change the fft size from within SM.

rl ·

I think the bug was reported some time ago, but it never hurts to write a little reminder.

exonerate ·

Great work Tzarls, keep going. 🙂

Don't really understand this FFT stuff but when it comes to optimizing I'll definitely be giving you a hand 🙂

Cheers 😉

Exo

Tzarls ·

Thanks Exo. Right now I´m in the process of making the 4 blocks into 1 loop, that should reduce code size, and make it easier to ASM and optimize it.

I´ll be back.

MegaHurtz ·

what you can do is store the vectors into a buffer. may be easyer to represent something like <a||a>.

Tzarls ·

Could you explain this please?

Tzarls ·

Ok, some info o this project. First, I´ve done some interesting findings (at least for me):

Compare this schematics:

These are the same 4 point FFT I uploaded earlier. The first one is an unoptimized version, using arrays in code (REX[n] and IMX [n]).In my P4 2.8, it uses about 12.9% of CPU. Now run the 05xx b file. It avoids using arrays, just plain float variables. The CPU usage is down to less than 1%!!! SO I guess using arrays in code is a bad idea, specially if we want this to be usable CPU wise. Time to recode my "code maker" to use plain floats instead of x[n] vars. The downside is that a 32 point FFT will use about 400 lines of code for the FFT only - add to that the iFFT and conv.....

To finish, here are 2 schematics for an 8 point FFT. The first one uses code, the second one uses ASM and adds a hop(8). OF course the ASM version uses less cpu, but trying to find the exact point to place the hop in such a large piece of code is a nightmare.

Anyway, here they are:

Tzarls ·

exonerate ·

Yes arrays in SM are very slow because the sse channels have to be unpacked and then there is the rounding to integer at sample rate.

Cheers 😉

Exo

Tzarls ·

Yep, too bad, this will complicate things some more.....anyway, here,s a 8 point FFT in code, without arrays, just plain floats, using a hop(8) and no loops, about 0.5% CPU on a P4 2.8. Looking good....

Tzarls ·

Actually this isn´t looking that good. The 4 point FFT calculates real and imag numbers correctly. The 8 point FFT gets all reals right, but imag are wrong. When trying to use the code with a 16 point FFT, only even numbered reals are right, the other ones are wrong.

The good news is that the 16 point FFT uses the same amount of CPU (0.6%) as the 8 point FFT. So if I get the code to calculate correctly, hopefully the 32, 64 or even 128 point FFT should introduce not much overhead. (Editing those large >400 line codes is painfuly slow, though).

Back to the drawing board. 😝

Tzarls ·

Haha! Found the bug - a "-" in place of a "+". I gotta change my printer´s ink cartridge... 😕

8 point FFT is working OK now.....tomorrow I´ll try the 16 and 32 point FFT - right nwo I have to prepare some invitation cards for my son´s birthday, just to remind myself that there´s life beyond DSP. 🙂

rl ·

From my experience editing the code module slows down considerably at > 100 lines. That was the reason I did my FIR filter cascadeable. Looks like the newest beta has some improvements here, but I didn't test it yet.

The code generator is a cool idea.

Tzarls ·

Cascading might work here too with some small tweaks, and might make all this code manageable. I wonder how much overhead this might add?

Tzarls ·

16 point FFT in code, everything is working OK, the real and imag values are calculated accurately. The code is a hell to edit, though, due to slugginess.

Tzarls ·

32 point FFT, only checked the first 4 reals, but this should work ok. Code has more than 500 lines ñ that has to be some kind of record!. CPU usage is ver low, haven´t checked it on my P4, but using it on my netbook gives me about 3%.

Now that 32 FFT is working, I´ll try to break the code in several parts to make it more edit friendly. Then I´ll work in the iFFT (which is a lot more easier) and finally, in a 32 point convolution module. After that and if the results are more or less practical, specially CPU wise, I´ll try to do a 64 point FFT. With a special implementation, one can use a 64 point structure to process 128 points of data. That should give us a 128 sample convolution module.

I might try a 256+ point conv sometime, but for that we would need a larger workspace, since actual limit of streamins for a code block (or a module, for that matter) is 128, mainly due to the height of the worksapce.

Getting closer!

Tzarls ·

Here´s an schematic with 8 point FFT and iFFT. The process for iFFT s quite simple, just invert the sign of the imag part, then process all rex and imx with the FFT code. Check the schematic and you´ll know what I mean.

Doing the same for a 32 sample buffer would be quite easy. Now, the big question: HOW DO I GET THE CONVOLUTION? My understanding is that a convolution in the time domain is just a multiplication in the frequency domain. Does it mean that to get the convolution, I just have to multiply the real and imag parts of my signal with the real and imag parts of the IR, then get the result back into the time domain using the iFFT?

RL, I guess this question is for you. 😉

TomC ·

Tzarls wrote: Now, the big question: HOW DO I GET THE CONVOLUTION? My understanding is that a convolution in the time domain is just a multiplication in the frequency domain. Does it mean that to get the convolution, I just have to multiply the real and imag parts of my signal with the real and imag parts of the IR, then get the result back into the time domain using the iFFT?

RL, I guess this question is for you. 😉

From memory:

Re(x) = Re1(x)*Re2(x) - Im1(x)*Im2(x)

Im(x) = Im1(x)*Re2(x) + Re1(x)*Im2(x)

Throw the results into the iFFT and call it a day 🙂

Tom

rl ·

Tom is right. It's just a complex multiplication:

(a+jb)*(c+jd) = ac + jad + jbc + j*j(bd) = ac + jad + jbc - bd = ac - bd + j(ad + bc)

MegaHurtz ·

(jwt) standing for "je weet toch" in dutch, wich means something along the lines of "you know". Anyhow.. thats a lot of lines, hope it works. Great efford!

Tzarls ·

So the process of going from the time domain to the freq domain is a convolution in itself?mmmm.....

Anyway, here´s a 32 point FFT and iFFT. Lots of linesin code but quite light on CPU.

Now to try the streaming convolution with all this stuff. This won´t be realtime though, there´ll be 32 samples of latency.....maybe creating a new thread would be a good idea?

I guess the code component can accept quite a long code without problems, we just need the editing to be faster. And due to space issues, we won´t be able to get more that 32 point, because at some point we would have 64 streams from the "live" FFT´d input (32 real and 32 imag) and 64 streams from the IR (32 real and 32 imag). Thats 128 inputs for code module, and that´s the limit for the height of our workspace.(Malc, are you reading this? We need more workspace!).

I´ll let you know if the convolution works.....cross fingers please. 😉

MegaHurtz ·

You would be supprised about the things we need 🙂

Edit: I do not think that it`s a convolution in itself (fingers crossed indeed), Time to F is something like Xk=N0,..Nx( Xn (e) 2pi i/N)Kn). edit i or j depending on jr lingo.

Tzarls ·

Mmmmmm, something´s not working properly here......I thought that just buffering blocks of 32 samples and then convolving them with the IR FFT and then applying iFFT and streaming the resulting samples would work, but it doesn´t. Do I have to use Add & Overlap? How should it be implemented? Kind of tired right now, so no more SM for me tonight, but would appreciate your ideas so I can get this working.

At least the FFT and iFFT codes are working now......and we have adjustable buffers with the last beta.....should I try a 128 point FFT? 😈

MegaHurtz ·

I was curious about this.. But afaik the multy happens on both frequency domains.

Tzarls ·

Ok, no matter what I do I don´t seem to be able to get this working, so maybe the more maths oriented guys here can take a look at this. I´ve tried windowing, zero padding, etc, according to the instructions presented here, for a 50% overlap add method: http://www.engineeringproductivitytools.com/stuff/T0001/PT15.HTM.

Here´s the schematic.:

MegaHurtz ·

I think I do understand it.. but by doing so I don`t really. In the direct convolution the letter P to my mind stands to the number of samples to be convolved. But since theres a common name for these things (meaning to the power of N"-1") I do get kinda confused if this is about samples at all. It`s 6:20 here so I really need to get a nap 😀 But ill start experimenting with this soon. It seems to be a sample based convolution.

Tzarls ·

Thanks man. Please do what you can, hopefully once this thing is working, and with the ability to change code buffer size, I can make a 128 or 256 point FFT convolution. For me this is exciting, specially since just a few weeks ago it was "impossible" to have FFT in code. 😈

Tzarls ·

Hi guys, any news?

MegaHurtz ·

Ive looked over it before but havent got enough time to get to it. Besides that it`s confusing as heck. Maybe next weekend.

Disco_Steve ·

Hi tzarls this is very close to working. I think its a simpler implementation than what you were trying, it defiantly more user friendly for piling them up on top of each other. its based on your code. all it does is take a signal FFT and go back again. so the result should be exactly what went in (plus a little math error, which is unavoidable) there is no windowing, just very simple, as it should be to start with. your FFT code almost seems to work perfect, as some beautifully pure sine waves were coming out of it earlier when I was playing. I think you might be able to fix this as you know your FFt code much better Sorry its taken me so long to get around to helping you with your epic proj 🙂 Steve

Disco_Steve ·

I cann't really say, but it looks like the FFT stops working after the 6th bin. or it might b three bins in from either end (more likely), all the other bins come out with the same as each other. so it looks like there might be one butterfly missing. I can't spot it by eye, but it might be 4 near the top??

Tzarls ·

From a quick look to the code everything seems to be in place, the 80 blocks of code (butterflies) are all there. Haven´t checked the factors though. But in my other schematic (the 32 FFT-iFFT) I´ve checked every real value against the one´s generated by SM´s FFT primitive and everything seems to be ok. Why do you feel it´s not working as it should?

Disco_Steve ·

play some audio through it. and watch the output from the FFT on an osc. you see it wobble around, and then flat line. something in there isn't working?but its so darn close

Tzarls ·

Funny, I´m not getting the flat line, the audio goes thru without problems. Just distorted...... is that to be expected due to the low resolution?

Disco_Steve ·

it should make no change if all is working correctly it should sound identical

MegaHurtz ·

If you do a convolution with it it should be distorted due to not being windowed, if you leave it as is it shouldnt distort. Looks pretty narly indeed.

ronaldpassion ·

Hei all, I just take a look again old matti IR loader. I recognize why this IR loader not same (sound) with keFIR that i used to use it. Here is what i do, when i look into analyzer is just 95% close to keFIR (i think).

Have a good time TQ,RP!

RunBeerRun2 ·

That's pretty cool, Ronald. I tried comparing the 2 versions, and also with Kefir using the Recabinet stuff. Your version did sound like Kefir, and the other version was more trebly.

ronaldpassion ·

RunBeerRun2 wrote: That's pretty cool, Ronald. I tried comparing the 2 versions, and also with Kefir using the Recabinet stuff. Your version did sound like Kefir, and the other version was more trebly.

Yes my friend, this one slight better. I kept thinking at that why we need MAX module in here. It is like a gate, wait till MAX value to process. So we lost some first artifact before MAX value.

BUt still my hope: there will be simple way to do it. Like array looping. It is so manual for every 32 step. But for guitar cab, 512 or 1024 is more than enough (around 1 to 2 ms)

TQ,RP!

McBarGig ·

HAHA Good job Ronald! You may be able to get some small room sounds too out of that..Great work!

ronaldpassion ·

Hehe Btw i am not looking for room sound in this convolution technology. Designing Cabinet is much interesting. We need short but FAST.

To SM DEV -> Convolution is FUTURE in digital recording domain. Except mastering section, DIGITAL WILL TAKE OVER HARDWARE (my opinion, no need to doubt, hehe...). WHY NOT BRING SM CLOSE TO THE MOST WANTED SOFTWARE DEVELOPMENT LINEAR TO CONVO TECH?

TQ,RP!

stealthgear ·

This works great! I made two instances of the loader and split my stereo impulse wavs.

....but I'm kind of a noob, is there a way to embed my IR wavs so the user doesn't have to load it? I'm kind of just using it as an effect to beef up my synth.

ronaldpassion ·

This works great! I made two instances of the loader and split my stereo impulse wavs.

....but I'm kind of a noob, is there a way to embed my IR wavs so the user doesn't have to load it? I'm kind of just using it as an effect to beef up my synth.

-> u mean that your vst has already load the FILE u wish?

Take a look MULTI SAMPLE PLAYER v.1, it load all wav in folder. Next just use selector to select it...

TQ,RP!

jeff ·

Hey I have a Question I wanna Make A Reverb With Impulse Files Built Into The Vst How Can I Do That

Basicly I wanna Use an Impulse File As Its Own Preset On the Vst Also I dont Want the User To Be Able to Change The Impulse Files And Only Able to Change the Presets On the Vst

How can i accomplish This Wich Components Or Addons Should I grab ?

Large ·

Bump.

1.) Has this been updated so the user can easily load the wave file into the convolution reverb?

2.) Has this been fixed so that users can load ANY SIZE wavefile into it?

I really need this finished 🙂

McBarGig ·

@stealthgear You may want to look at wave file arrays

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.