tomopey ·
I'm trying to build a basic reverb unit for my multi effects. I think i have some basic understanding of the principles behind the workings... just don't know where to start from building it!
From the original SynthMaker forum (2004–2014), with its members’ names and dates.
tomopey ·
I'm trying to build a basic reverb unit for my multi effects. I think i have some basic understanding of the principles behind the workings... just don't know where to start from building it!
cyto ·
Hi tomopey and welcome 🙂
What type of reverb are you thinking of building? Knowing this will help the forum members point you in the right direction. The three common types (off the top of my head) in DSP are: Schroeder-type allpass networks, feedback delay networks (FDN), or convolution. Each one of them has its pros and cons (quality vs. CPU, etc). If you haven't yet, do a couple google searches for each of those methods and figure out what path you want to take. Then, someone here (maybe even me 😉 ) might be able to help. FYI, the stock SM reverb is a Schroeder algo.
-cyto
tomopey ·
I've had a brief introduction schroder algorithms with the use of comb filters etc. so that is the type I have been thinking about. I've Looked at the stock SM reverb however, it is a bit complex for my current level, I am trying to build one to better my understanding...!
Thanks!
cyto ·
tomopey wrote: it is a bit complex for my current level, I am trying to build one to better my understanding...!
Good for you! That's the best way to learn. I can see how the stock reverb can be a bit confusing, especially with all the "packing" schemes it employs. To help you out a bit, I whipped up this little "educational" osm. Basically, I stripped the stock reverb of all its mix functions and a few other things so you can just focus on the Schroeder algorithm. The guts of the algo should look similar to the Schroeder block diagrams that you'll find on the internet. It should be pretty clear how the parallel combs are implemented as well as the series APs. I also included some little analysers for each of the filter types so you can plug in numbers and see how the frequency spectrum is affected. One warning: you probably cannot just plug a sound source into this and expect it to work. Because there are so many feedback loops in the filters, your CPU will go through the roof trying to deal with all the denormal numbers. I put a little explanation in the osm about this. But hopefully seeing the algorithm "cleaned up" a bit will help you in your efforts.
-cyto
martinvicanek ·
Excellent, cyto! I was just wondering: shouldn't the frequency response of an allpass be flat? In your schematic it is not, except for zero feedback. 😮
cyto ·
martinvicanek wrote: I was just wondering: shouldn't the frequency response of an allpass be flat
Let me first qualify things by saying that I am by no means an expert on reverb 😉 The example that I posted is just a simplification of the stock reverb. I would agree with you that the term "allpass" is a bit of a misnomer here. I believe the correct term would be "diffusor" or "smearer". In theory, the AP sections should be designed in such a way that the reflections generated should create a colorless wash of sound that has (ideally) the same frequency spectrum as the input signal. In that sense, you need to look at the series section as a whole and not by its individual components. At least that's my understanding. If I am completely off the mark here, then please somebody chime in and correct me.
-cyto
martinvicanek ·
cyto wrote: the term "allpass" is a bit of a misnomer here. I believe the correct term would be "diffusor" or "smearer". In theory, the AP sections should be designed in such a way that the reflections generated should create a colorless wash of sound that has (ideally) the same frequency spectrum as the input signal.
That's also my understanding. But still, if you analyze the single AP in your OSM the transfer function (in the z-domain) should read
(-q + z^-n)/(1 - q*z^-n)
where q is the feedback and n is the delay (number of samples). So it should be an allpass with a flat response. 😕
martinvicanek ·
Sorry, I think I was chasing ghosts. There is nothing wrong with the allpass, it does have a flat frequency response. For short delay parameters and moderate feedback this is nicely confirmed in the FFT analysis. However, for longer delay times or more feedback the FFT array size is just not sufficient to hold the entire signal, hence the frequency response will not display correctly. It helps to increase the array length to the maximum 16384 samples if the allpass settings are not too aggressive.
First I suspected a similar problem as in Interpolated delay. However, that was not the case. Sorry for the confusion.
cyto ·
martinvicanek wrote: However, for longer delay times or more feedback the FFT array size is just not sufficient to hold the entire signal, hence the frequency response will not display correctly.
That makes sense.
martinvicanek wrote: First I suspected a similar problem as in Interpolated delay. However, that was not the case. Sorry for the confusion.
You know, I was thinking the exact same thing (in fact I even ran my ASM AP from that thread into the analyser to compare), but I didn't want to scare our new friend off with all the esoteric discussion about "staging" and link order and such.
-cyto
tomopey ·
Thanks for the help file you posted, made some good sense. It's a fairly simple concpet once i got my head around it!
Here's my first finished attempt... what are your thoughts?
cyto ·
Very good first attempt! I do have some pointers to help you along the way. First of all I noticed a couple of errors (probably just oversights). In the right comb filter, for each of the delay values you have the "delay" value and the "room size" value connected to the same node of the float multiply primitive and nothing connected to the other node. The result is a "zero" going into the delay (you have it correct in the left comb filter). Also, your "predelay" knob only goes from 0 to 1. Remember, the "delay" values are in samples, so as it is now a 0 or a 1 sample delay is not going to do too much to the sound. Better to bump it up to a more noticeable range.
Speaking of sample delays, if you want to make this effect sound consistent at different sample rates, you might want to consider converting your delay values from static values (ie 2015, 2011, 1960, etc.) into sample-rate-dependent values. I'll explain. The comb and AP filters' frequency response is determined by the amount of delay in time of the feedback loop. So, for instance, the value 2015 samples in a 44.1kHz environment is about 45msec. However, in a 96kHz system, it is only about 21msec. So having that delay value fixed at 2015 samples will result in different frequency responses across different systems. Make sense?
Warning: I'm about to get math-y 😈
The frequency response of these particular comb filters can be calculated as follows: The lowest "tooth" of the comb is at the frequency found by [sampleRate/delayInSamples]. So (to continue from above) a delay of 2015 samples in a 44.1kHz system will result in the lowest tooth being 21.9Hz [44100/2015]. Each additional tooth will be a whole number multiple of that (43.8Hz, 65.7Hz, 87.6Hz, etc.) all the way up to Nyquist (22050Hz). So, in order to make the delay values sample-rate-dependent, instead of putting a fixed value in there, you can put a calculated value in. To do this, just swap your equation around to [delayInSamples=sampleRate/Freq]. The picture below shows how to do this...
FYI, the AP filters will benefit from the same treatment, though they are a slighlty different beast. Instead of having a series of "peaks" and "valleys" like the comb filter, their frequency response is flat (as Martin demonstrated), but the phase response across the frequency spectrum is "twisted". To calculate this, the lowest twist is 180 degrees at [(2*sampleRate)/delayInSamples]. There are also evenly spaced 180 degree twists at whole number intervals up to Nyquist. You can represent this like so...
You should know that one of the shortcomings of the stock reverb is the fact that it is not sample-rate-dependent. Though if you do a quick search, I think this has been discussed here on the forum.
There are a couple other things that could be done to cut down on the amount of CPU this effect uses, but I'll spare you that for now. All in all, I think you did a really good job with this so far. Hopefully, my little diatribe about sample rate dependency made a little sense. Sometimes, you can get a project to sound perfect on your machine, but when somebody else loads it up, it sounds like poop. After you use SM for a little bit all these little tricks will become second nature. Keep on keeping on! 😀
-cyto
trogluddite ·
@Cyto. Just had to say, what an excellent little tutorial that is.
Wrote something here? To have a post removed or your name hidden, write to [email protected].