From the original SynthMaker forum (2004–2014), with its members’ names and dates.
Shifrin ·
Hi,
I've ported over the Robert Bristow-Johnson EQ Cookbook Biquad filters to SM with the code component. They're Lowpass, Highpass, 2 x Bandpass, Notch, Peaking, Low Shelf and High Shelf filters! Here's a schematic with the individual filter modules and a basic test synth with the filters there to be tried out.
Get it here :- RBJ-Filters.osm
The Cutoff input is in Hz. Res/Q ranges from something small, but not zero, to something big 🙂 Gain (for the peaking/shelving filters) is in dB. All filter inputs are calculated inside the knob components in my schematic.
Any bugs etc let me know!
Shif.
Shifrin ·
Oh yeah,
Bandpass1 is constant skirt gain, peak gain = Q.
Bandpass2 is with a constant 0 dB peak gain.
Shif.
Nu Audio Science ·
Too cool 🙂
jorge ·
I think this is really great.
Here's a slightly modified version for looking at the frequency response of the filters:
[old link]
unkargherth ·
Wowowow !!!!!!
Nice work Shif. Very Nice
I tried a bit diferent approximation a month ago, but left it unfinished
Anyway, and only for completeness, here is the version i Made, in a distributed form. Took you version and moved coeff calculations outside
the filtering engine. So instead of one module we have two. One for calculating coefficiens and one for filtering
This appproximation it's suposed to be better when not modulating Cut/Rez/gain at audio rates
Get it here
Shifrin ·
unkargherth wrote: Anyway, and only for completeness, here is the version i Made, in a distributed form. Took you version and moved coeff calculations outside the filtering engine. So instead of one module we have two. One for calculating coefficiens and one for filtering
Ah, cheers! Very useful for saving some CPU cycles when, as you say, not modulating params 🙂
Shif.
unkargherth ·
Shifrin wrote: Ah, cheers! Very useful for saving some CPU cycles when, as you say, not modulating params 🙂
Shif.
Hmmmmm. I also think that when modulating them, in some cases, this should be a bit faster. For example when cascading Biquad sections for same Cut/Res/Gain. Calculate once, filter n
EDIT:
Shif, asking myself if is posible to complete the pack with the LoShelf and Hishelf ? or there's still something missing in SM the precludes to do it ?
Shifrin ·
unkargherth wrote: EDIT:
Shif, asking myself if is posible to complete the pack with the LoShelf and Hishelf ? or there's still something missing in SM the precludes to do it ?
I'm pretty sure they're do-able! I'll have a look at it later tonight and, if I have any luck, will post them 🙂 (unless you beat me to it 😉 )
Shif.
unkargherth ·
Not trying to beat You. It's only that when i tried what you ahave done , I remember something that stopped me for this two types
If i have time, i 'll give it a second look toknow waht it was....
Shifrin ·
They're up now, the Low/High Shelving filters that is! Also, fixed an important bug :-
I said the 'Gain' input took a value in dB, i.e. -6, 0, +3 etc. This was wrong, I was actually calculating a coeffecient based on the gain 'inside' the gain knob component - this has been moved to inside the filter module, where it belongs!
So the 'gain' inputs to the Peaking/Low SHelf/High Shelf do now indeed take a value in dB 🙂
Shif.
Tom7777 ·
OMG Amazing stuff everyone, thanks 🙂
unkargherth ·
OK. Updated distributed version acoording to Shifrin changes
Get it at same place
Shifrin ·
I gotta go to bed now (sleep needed!), but I shall have a little update tomorrow adding a 'Sample Rate' input for each filter (Thanks Unk for mentioning it to me!!! They're hard-coded at 44100 ATM).
There is also an issue with the filter parameter types showing as 'poly', the Gain parameter *has* to be a float input for now as some float maths are done on it before it enters the code component, hence you can't AFAIK modulate it at sample rate (as you can the filter freq/res) anyway, off to bed!
Shif.
stefan ·
Shifrin wrote: I gotta go to bed now (sleep needed!), but I shall have a little update tomorrow adding a 'Sample Rate' input for each filter (Thanks Unk for mentioning it to me!!! They're hard-coded at 44100 ATM).
There is also an issue with the filter parameter types showing as 'poly', the Gain parameter *has* to be a float input for now as some float maths are done on it before it enters the code component, hence you can't AFAIK modulate it at sample rate (as you can the filter freq/res) anyway, off to bed!
Shif.
I was lazier than you when I made my RBJ peaking eq, I just let it use a normal gain input (linear) 🙂 Will take a look at your stuff when I get the time, really great work you've done here!
Shifrin ·
Ok, last update for a bit. All filters now have a 'SRate' i.e. sample rate input! And the 'Gain' inputs have been modified to a type 'float'
There may be a bug or two with the high/low shelf (code wise) so I'll have a look at it!
Shif.
Shifrin ·
Shifrin wrote: There may be a bug or two with the high/low shelf (code wise) so I'll have a look at it!
Ok, fixed it - so the shelf slopes are now modifiable - don't have time to update the schematic - will do so later today 🙂
Shif.
Shifrin ·
Updated again! Now instead of a 'q' value the shelving filters have a 'slope' value which alters the slope of the shelf - mellow to steep 🙂
That should be it now for the RBJ filters! Unless there are any bugs etc. It is more efficient to use them the way Unk has describe, i.e. seperate the filter coefficient calculations from the rest of the filter. So they're only calculated when changed, and not every sample! (Unless you want to modify them at sample rate - Cutoff/Res).
Enjoy 🙂
Shif.
Shifrin ·
Updated these :-
* Sample rate no longer required.
* Cutoff value lies in range 0..1 which gets mapped to 0..Nyquist
* Moved all 'float' declarations to start of code (it was screwing up santax highlighting before)
* Moved the scaling I perform on the input values (Cutoff,Res,..) outside of the knob components.
Shif.
Tom7777 ·
Thanks, Shifrin these are great 🙂
skOre ·
Could somebody please please upload some working rbj filters ?
Shifrin ·
Umm, the .osm linked on the first page of this thread has working RBJ filters, just downloaded it (to check the file is ok) and tried in the latest version of SM (0.9.4f iirc). It worked fine, the filters work fine!
What is the problem you're having with them?!
Shif.
skOre ·
Indeed, must have had old versions on my pc, will change those in my module pack for sure!
aiit ·
Hi Shifrin,
I've been playing around with the filters. Very cool stuff. I have a question. Since they don't require a sample rate input, are there any issues with using them at 48K versus 44.1K?
Thanks,
Leslie
Shifrin ·
aiit wrote: Hi Shifrin,
I've been playing around with the filters. Very cool stuff. I have a question. Since they don't require a sample rate input, are there any issues with using them at 48K versus 44.1K?
Thanks,
Leslie
I've not looked at these for a very long time. My guess would be that I used the S|M module that reports the hosts sample rate 😉
Shif.
unkargherth ·
As it seem missed until now, here are the coeff calculation for an RBJBiquad AllPass as per document RBJ Audio-EQ-Cookbook
Shiffrin, please update your osm as you evolved to de-facto RBJ-filters Guru and maintainer 🙂
Also, as discussed here, I'm Trying to find the "correct way" to build casacaded biquad sections. Any idea on how to "convert" Q , gain and Slope ( where it applies) to get brid of unstabilities when using n cascaded sections ?
to Devs: I Think time has come to make RBJ Biquads a "standard, of the shelf" SM Module.
Maybe in Version 1.0.6?
Acrobat ·
I'm revamping this thread 'cause these are good ONLY for SSE2 and NOT for SSE.
Don't know if I had old versions and the codes were already updated, but it's better to have a look back at this thing... If they're still coded that way, it's just the case to move some declaration of variables upper in the code and they work well for every computer.
A.
Shifrin ·
Acrobat wrote: I'm revamping this thread 'cause these are good ONLY for SSE2 and NOT for SSE.
Don't know if I had old versions and the codes were already updated, but it's better to have a look back at this thing... If they're still coded that way, it's just the case to move some declaration of variables upper in the code and they work well for every computer.
A.
I'm going to have a look over these, been ages since I last messed about with them 😉
Shif.
Acrobat ·
Shifrin wrote: I'm going to have a look over these, been ages since I last messed about with them 😉
Shif.
Great!
It happened my synth, the one in KVR Competition, having some highpass RBJs. Athlon XP and old Pentium 3 CPUs go nuts with those and gave the "no sound" issue I had.
Malc spotted the issue, he knows the whole story...
🙂
BUT my guilt copy/paste roughly, maybe they were an ol' version too..
A.
ronaldpassion ·
Shifrin wrote: Hi,
I've ported over the Robert Bristow-Johnson EQ Cookbook Biquad filters to SM with the code component. They're Lowpass, Highpass, 2 x Bandpass, Notch, Peaking, Low Shelf and High Shelf filters! Here's a schematic with the individual filter modules and a basic test synth with the filters there to be tried out.
Get it here :- RBJ-Filters.osm
The Cutoff input is in Hz. Res/Q ranges from something small, but not zero, to something big 🙂 Gain (for the peaking/shelving filters) is in dB. All filter inputs are calculated inside the knob components in my schematic.
Any bugs etc let me know!
Shif.
hi shifrin...
the filter is in POLY SECTION..
Do i switch into mono section?????
so i will combine into EQ section then it will complete solution
thanx
rl ·
No problems, just replace all polyin with streamin and all polyout with streamout and you can place the filters everywhere. I guess Shifrin did his work, when streamdata was not yet implemented. It's pretty ole' code (May, 2005!). Lots of room for improvement (e.g. replace sin1 calculations with faster code)
Shifrin ·
rl wrote: No problems, just replace all polyin with streamin and all polyout with streamout and you can place the filters everywhere. I guess Shifrin did his work, when streamdata was not yet implemented. It's pretty ole' code (May, 2005!). Lots of room for improvement (e.g. replace sin1 calculations with faster code)
Indeed, just like rl says - replace polyin/out with streamin/out. These were made quite some time ago and as rl says there's room for improvement. I'm already aware of several changes I could make to save CPU and that's without replacing sin1 for something else lol!
Shif.
aliasant ·
Well then Shiff =)
If you ever do get that time and do them fix's ...... would you even consider posting them for the rest of us idiots ?
I would love them. Can never get enough of filters.
Shifrin ·
aliasant wrote: If you ever do get that time and do them fix's ...... would you even consider posting them for the rest of us idiots ?
Sure, I tend not to use them myself so no point in updating them if I'm not going to post them 😉
Shif.
aliasant ·
sounds fair 😉
ronaldpassion ·
Shifrin wrote: Hi,
I've ported over the Robert Bristow-Johnson EQ Cookbook Biquad filters to SM with the code component. They're Lowpass, Highpass, 2 x Bandpass, Notch, Peaking, Low Shelf and High Shelf filters! Here's a schematic with the individual filter modules and a basic test synth with the filters there to be tried out.
Get it here :- RBJ-Filters.osm
The Cutoff input is in Hz. Res/Q ranges from something small, but not zero, to something big 🙂 Gain (for the peaking/shelving filters) is in dB. All filter inputs are calculated inside the knob components in my schematic.
Any bugs etc let me know!
Shif.
Hi shifrin.. i really interest in this RBJ filter....
The default one is in POLY section...
how do i change into Mono section????
is it just simple rigt click the Line on?? to mono [blue connection]...
This RBJ filter that is in the topic is so nice...
I mean, is it OK if i use the scheme for any use?? to build new one with only skinn change..
Best regards
ronaldpassion ·
Oh, i forgot one...
What is actually the SLOPE do???
Resonance???
thanx
Best regards
Shifrin ·
ronaldpassion wrote: The default one is in POLY section...
how do i change into Mono section????
is it just simple rigt click the Line on?? to mono [blue connection]...
Once you have chaged the 'polyin' and 'polyout' in the code component to 'streamin' and 'streamout' you can then connect either mono OR poly signals to it. If that makes sense! I'll try to post an updated bunch of filters tonight.
ronaldpassion wrote: This RBJ filter that is in the topic is so nice...
I mean, is it OK if i use the scheme for any use?? to build new one with only skinn change..
Feel free to do what you want with them, all I did was port them to S|M using the following information :- http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt 😉
ronaldpassion wrote: What is actually the SLOPE do???
Resonance???
Directly from the txt file I just posted the link to...
S, a "shelf slope" parameter (for shelving EQ only). When S = 1,
the shelf slope is as steep as it can be and remain monotonically
increasing or decreasing gain with frequency. The shelf slope, in
dB/octave, remains proportional to S for all other values for a
fixed f0/Fs and dBgain.
HTH
Shif.
ronaldpassion ·
Shifrin wrote: If that makes sense! I'll try to post an updated bunch of filters tonight.
i am still waiting my bro ..... LOL
thanx
Shifrin ·
Here they are (sorry for the delay) :-
Download :- RBJ-Update2.osm
I've removed most of the 'divides' that were in the old ones and optimised them somewhat. Still room for improvement but faster than they were. The cutoff input is the standard S|M normalised frequency range, i.e. 0..1 instead of 0..Nyquist. Any tips for speeding up/error reports/questions/etc just fire away 🙂
Oh yeah, there is a basic denormal remover in these - a rather inelegant 'truncate to zero if less than some small number' lol. Better/efficient suggestions welcomed!
Shif.
Shifrin ·
Just to add, the 'slope' input is given in dB, i.e. -6 or +3 etc. The 'res' input must be greater than 0 but you can scale it higher than I have done. The 'slope' input should be somewhere between 0.5ish and 1.875ish (other values aren't sensible - display a filter response to see...)
My 'scalers' are just rough and ready for demonstration purposes 😉
Shif.
Acrobat ·
Shifrin wrote: Just to add, the 'slope' input is given in dB, i.e. -6 or +3 etc. The 'res' input must be greater than 0 but you can scale it higher than I have done. The 'slope' input should be somewhere between 0.5ish and 1.875ish (other values aren't sensible - display a filter response to see...)
My 'scalers' are just rough and ready for demonstration purposes 😉
Shif.
Great Shif!!!!
😀 😀 😀
sunsynth ·
Shifrin wrote:
The cutoff input is the standard S|M normalised frequency range, i.e. 0..1 instead of 0..Nyquist.
Hmm, how can i display/read the correct cutoff-Frequency?
May i use this 0-1 to Hz Modul?
SUNsynth
Acrobat ·
About these last version available:
It's alright, but there's a line of code moved on the "Stage 0"
part of the code,
so when you have 2 different filters and you switch from one
another with a selection, the held key stops playing.
Tzarls ·
unkargherth wrote: Wowowow !!!!!!
Nice work Shif. Very Nice
I tried a bit diferent approximation a month ago, but left it unfinished
Anyway, and only for completeness, here is the version i Made, in a distributed form. Took you version and moved coeff calculations outside
the filtering engine. So instead of one module we have two. One for calculating coefficiens and one for filtering
This appproximation it's suposed to be better when not modulating Cut/Rez/gain at audio rates
Get it here
It´s been a year since the last post in this topic, and almost 4 years since this post I quoted, so as expected the green hipass is no longer available (the one with the coeffs calculations in green). So I tried to make my own version of it, but somehow managed to do it wrong... 🙁 Could you guys please check my osm and see if you can spot where the error is? Resonance seems to be ok, but cutoff isn´t.
Thanks!.
stw ·
Hi Tzarls,
One part of the differences:
The sin1 and cos1 code functions are normalized calculations. Means they need an input of 0..1.
The green maths primitives are radian measured. Means you need an input of 0..Pi.
You have to multiply your green inputs with PI, to get the same results.
If you do that the curve looks pretty much the same. However there's a difference at low CF values. I can't figure that out right now. Another thing is that the asm version scales and min/max the cf input which isn't implemented at the green version too.
Tzarls ·
Thanks stw, I´ll implement your suggestions. But in my green version, I´m applying the min/max to the cf, and also the result of every coeff is being scaled (I tried to make this green formula from the ASM).
Thanks again.
Tzarls ·
I´ve noticed that both filter (with stw´s addition) seem to be identical now, except when Cutoff Frequency is around or under 50HZ (again, just as stw said). Then my filter beings to act very differently. Any idea on why is this happening? I haven´t got a clue.
infuzion ·
Test OSM please with A/B.
Tzarls ·
Here it is.
aliasant ·
Tzarls wrote: Here it is.
As far as I can see when I do A - B there is always a difference between the two.
The way you look at them only shows the difference at very low freq.
Tzarls ·
Even worse then....... maybe it´s a thing of link order in green?
Tzarls ·
So I took another direction: instead of trying to dissect MyCo´s already optimized HP, I worked on the original RBJ HP by Shifrin. This time I feel I´m almost there, but there´s still a difference between the original and my green version. Would you guys care to look at this please? Thanks 🙂
MichaelBenjamin ·
if you put in pi as 3.1415927 instead of 3.1415901 (01 is a bit off) the difference seems to be minimal - so the code sin1 maybe uses a double precision for pi, so this seems to be as close as you can get with green.
Tzarls ·
Funny - I never entered 3.1415901, just 3.14159, but I didn´t have the "Floating Point Numbers" option checked in the app´s setup.
Anyway, thank you MichaelBenjamin - now I can use my filter instead of the "fast" one. This green version uses about 50% less CPU!
tor ·
I have made a attempt on a equalizer using Shifrin's RBJ modules as building blocks. Thank you 😀
Note: It is far from finnished.
See this thread: VST equalizer demo.
datsound ·
These filters are in Hz compared to the SM ones that are in O-1 sr... if i have midi pitch data on a stream line, how to convert to Hz for keytrack etc?
MichaelBenjamin ·
you can use the normal pitch2freq and then multiply with samplerate*0.5 (so instead of going 0-1 it then goes 0-22025 at 44.1)
djbrynte ·
Can some one post a fully working link for the working filters. Do i need to read whole thread to check those filters out and thnx for making this RBJ. Very nice. Some one pls make a new link. with latets update---
tor ·
If any interest. Here is the DoublePrecisionEqualizer as it is ATM. It is based on the RBJ cookbook.
Feel free to use elements from it 🙂
I would appreciate some feedback.
Dell ·
Hi Tor!
You should display the new GUI on KVR.
If you like, I could make video of it in action so others can see it in on your website. All I ask is for you to send me an audio file to use as reference.
I've noticed the CPU has reduced so maybe my old Pentium 4 will not overload this time. 🙂
MichaelBenjamin ·
tor wrote: If any interest. Here is the DoublePrecisionEqualizer as it is ATM. It is based on the RBJ cookbook.
Feel free to use elements from it 🙂
I would appreciate some feedback.
at the "mix and tube module" you got this code:
streamin x;
streamin t; //this is the fat value betwen 0 and 10
streamout c;
float d,e;
d=x*(1-t); //this gets x*-9 at t=10
e=((x/(2.8+(x*x))*9+(x*x*0.02*x))*0.36-0.01*x)*t;//and here its x*10
c=d+e; //x*-9+x*10
at first i thougt this was just a saturation crossfade, but the mul 10 the t value gets makes it a bit wierd, maybe its intended maybe not. the interface acts quite sluggish here. i like the noise, but tbh i dont really get the double precision sweetness compared to simple eqing. the time travel thing doesnt seem to work, or the effect is too subtle.
if you release this at kvr everyone will bitch about the cpu usage. for private use this thing is very nice, but sms double precision performance is pretty bad at the moment and you cant really do anything about to fix this.
Dell ·
MichaelBenjamin wrote:
if you release this at kvr everyone will bitch about the cpu usage. for private use this thing is very nice, but sms double precision performance is pretty bad at the moment and you cant really do anything about to fix this.
Tor released it on kvr I believe a month ago and surprisingly the response was civil. I do recall some commented on the GUI. This one is more flashier so, they may prefer it over the older look.
I do believe I found something that is draining the CPU however, I will need the check all the modules to make sure.
He really put a lot of time and effort in this design so, it really would be a waste if he just tossed the whole idea in the rubbish bin.
Tor, I have designs that I made in the beginning that I am now optimising. Sometimes, the problems can be fixed however the answer just takes time. As I mentioned to you on kvr months ago if, I am willing to help if I can so, I will try to reduce the CPU on your design.
Cheers!
tor ·
MichaelBenjamin wrote:
tor wrote: If any interest. Here is the DoublePrecisionEqualizer as it is ATM. It is based on the RBJ cookbook.
Feel free to use elements from it 🙂
I would appreciate some feedback.
at the "mix and tube module" you got this code:
streamin x;
streamin t; //this is the fat value betwen 0 and 10
streamout c;
float d,e;
d=x*(1-t); //this gets x*-9 at t=10
e=((x/(2.8+(x*x))*9+(x*x*0.02*x))*0.36-0.01*x)*t;//and here its x*10
c=d+e; //x*-9+x*10
at first i thougt this was just a saturation crossfade, but the mul 10 the t value gets makes it a bit wierd, maybe its intended maybe not. the interface acts quite sluggish here. i like the noise, but tbh i dont really get the double precision sweetness compared to simple eqing. the time travel thing doesnt seem to work, or the effect is too subtle.
if you release this at kvr everyone will bitch about the cpu usage. for private use this thing is very nice, but sms double precision performance is pretty bad at the moment and you cant really do anything about to fix this.
Hey MB. Thank you for your time. Here is my repsonse:
-The "fat" value is in the range of 0-0.1. Thats why it is *10. Please do not take my module and primitive names to seriously. Some times copy from one place to another and forget to rename and so. It is a tan-proxish saturation with crossfade yes.
-The cpu usage is not that bad due to double precision. It use 2-4% (depending on the host used) with my core 2 duo at 2.4ghz. It is the GUI that is CPU heavy. Help and hints is more tha welcome 🙂
-Time travel does indeed work. It is subtle when no eqing is done yes but more perceptable when eq is applied. But it could probably be better 🙂
Thank you 😀
tor ·
Dell wrote:
MichaelBenjamin wrote:
if you release this at kvr everyone will bitch about the cpu usage. for private use this thing is very nice, but sms double precision performance is pretty bad at the moment and you cant really do anything about to fix this.
Tor released it on kvr I believe a month ago and surprisingly the response was civil. I do recall some commented on the GUI. This one is more flashier so, they may prefer it over the older look.
I do believe I found something that is draining the CPU however, I will need the check all the modules to make sure.
He really put a lot of time and effort in this design so, it really would be a waste if he just tossed the whole idea in the rubbish bin.
Tor, I have designs that made in the beginning that I am now making them better. As I mentioned to you on kvr months ago if, I am willing to help if I can so, I will try to reduce the CPU on your design.
Cheers!
Thank you Dell, it is very welcome 🙂
Dell ·
No problem mate. 🙂
I had to download the original again to make a comparison.
I'm sure I am overlooking a few more things. At the moment the current CPU status on my Pentium 4 is the following:
20% Non Modified
13% Modified
http://www.youtube.com/watch?v=V-EOXYHuvVo
I have a nice bag of parts waiting for you to have once I'm done. 🙂 The bag may get bigger as time progress. 😉
Cheers!
tor ·
wow... sounds great 🙂 In what part of the schematic do you archiev this? Cool track you use is the youtube video 😉
Dell ·
Hi Tor.
The average is now 9.4% with an idle of 9.2% on a 2.8 GHZ Pentium 4.
I have removed 54 parts and, reduced the visual display from 4096 to 2048
I also added some tension to the knobs. I am more than certain there are more things however I felt those were more suited for you. I doubt the load time will get faster, for I remember it did take some time to load in it’s Alpha/Beta stage with no GUI. With the amount of filters inside, it is expected.
The white noise filter is dodgy. I disconnected it and the idle time increased by 42%
The song is by the woman who sung “Young Hearts Run Free.”
Cheers!
tor ·
Thanks for your effort Dell. I have already tried without dezippers but sweeping the filters then get noise so they are needed for smothing out the changes. About the fft display I have also tried different resolutions and found that some times lowering it was less effective and the difference between 2048 and 4096 in my computer was minimal. But it might be more evident in less powerful computers so I guess I will lower it in the next update.
Thanks again 😀
Dell ·
The noise only occurs when the knobs are set to respond extremely fast. This is why I added resistance to the knobs.
Slower knobs also makes attaining the correct frequency easier. Feel free to attach a dezipper to the offending knobs. However, having a dezipper connected to streamed input/outputs will just create a lot of idle consumption since you are creating more delay in the circuitry.
One dezipper can be used as four separate channels. So you can use one dezipper for four knobs.
Cheers!
tor ·
yes i could pack them... think I maybe have thought of it earlier but then forgot. thank you for that one 😀
i guess there are several ways to optimize the eq. but i was to eagre to get it tested and get other peoples opinions. thats why i released it... but as beta 😉
Wrote something here? To have a post removed or your name hidden, write to [email protected].