From the original SynthMaker forum (2004–2014), with its members’ names and dates.
aliasant ·
I made some modifications to the Moog filter and optimized it as well.
Input ranges are 0-1 both for the cutoff and the res.
The asm code ends with an ATAN Sat that can be bypassed by removing 1 / before the code.
The original code was about 106.5 cycles with the atan and 80.5 without
the Asm version is 74.8 with atan and 58.7 without atan
The original Moog filter was about 113 and that without the atan sat. The orginal also required you to range and clip the cutoff before the actual filter so in reality it used even more. I think I have more the halved the cpu use but I think there is lot more that can be done to the asm. If anyone wants to give it a shot. Heres the code:
// Moog Filter Mod by Martin Rodensjo
streamin in;
streamin cutoff;
streamin res; streamout out;
To use the Moog filter with pitch input you need the Pitch to Freq.
The stock version of the Pitch to Freq uses 66 cycles.
I made a very rough approximation of that that uses 3.5 cycles.
Works great in a synth as long as your not trying to get accurate pitches in the filter. Its far from that.
It is hopped by 64 and it sounds great even if a rectifies audio signal is modifying the cutoff.
Would be nice to have the stock Pitch to Freq optimized too.
//Pitch to Freq Approximation by Martin Rodensjo 3.5
streamin Pitch;
streamout F;
float x=0;
float x1=0;
float y=0;
float z=0;
float F0P35=0.35;
float F0P000370785=0.000370785;
float F0P00704225=0.00704225;
mov eax,ecx;
and eax,63;
cmp eax,0;
jnz end0;
hop(64)
{
y = 0.35;
z = 0.000370785;
x = 0.00704225 * Pitch;
x1 = x * x;
F = x1 * x1;
F = ((y + F) * F) + z;
}
aliasant ·
BTW.
I there anyone who knows how to make the Moog filter HiPass?
Doesnt work to simply subtract the filter from the original signal or adding or anything else that I have tried.
If I subtract the moog signal from the original it works as a highpass filter until I turn up the resonance.
Instead of amplifying the resonance it adds back what was subtracted minus the res so it acts a bit like a peak filter?
infuzion ·
aliasant wrote: The stock version of the Pitch to Freq uses 66 cycles. I made a very rough approximation of that that uses 3.5 cycles. Works great in a synth as long as your not trying to get accurate pitches in the filter. Its far from that.
It is hopped by 64 and it sounds great even if a rectifies audio signal is modifying the cutoff.
Very interesting!
I wonder if you can just use the accurate "stock formula" of the Pitch to Freq & put it inside the already existing hop() of your filter? That way, you can have reduced CPU & more accurate pitch. I often will tweak a filter's pitch by very small amounts to keep things interesting. Having no, then sudden pitch-jumps won't be fun always.
Thanks very much for sharing your efforts 😇 I'll have to study it more later.
aliasant ·
Yes. if we had the / a real pitch to freq algoritm that could be placed inside the code.
Also if we get it to do Hipass as well as lowpass we can easily get bandpass by adding them together.
That would make a very very nice filter.
infuzion ·
aliasant wrote: Yes. if we had the / a real pitch to freq algoritm that could be placed inside the code.
Does this help?
http://www.phy.mtu.edu/~suits/NoteFreqCalcs.html
aliasant ·
infuzion wrote:
aliasant wrote: Yes. if we had the / a real pitch to freq algoritm that could be placed inside the code.
Does this help?
http://www.phy.mtu.edu/~suits/NoteFreqCalcs.html
Lol
Not really no.
Im not a mathematician. By far. That is rubbish to me. Makes my head spin.
infuzion ·
I'm not so good in math myself (I failed a class since I couldn't prove 1+1=2), but I understand this much:
frequency = 440 * (1.059463..)^(step difference from A4)
So finding C5 is = 440 * (1.059463..)^3
= 440 * (1.059463..)(1.059463..)(1.059463..)
= 523.3 Hz (edit)
aliasant ·
infuzion wrote: I'm not so good in math myself (I failed a class since I couldn't prove 1+1=2), but I understand this much:
frequency = 440 * (1.059463..)^(step difference from A4)
So finding C5 is = 440 * (1.059463..)^3
= 440 * (1.059463..)(1.059463..)(1.059463..)
= 261.6 Hz
Ok. Cant you write that so its understandable? =)
I tried to do this 440 x (1.059463 x 1.059463 x 1.059463) but that was not right.
Then I tried (440 x 1.059463) x 3 And thats also wrong. I just dont get that stuff. I failed Math I think mostly because no one could teach me in a way that I would understand. More likely it was because I wasnt interested. Damn the stupidity of youth.
stw ·
infuzion wrote: I'm not so good in math myself (I failed a class since I couldn't prove 1+1=2), but I understand this much:
frequency = 440 * (1.059463..)^(step difference from A4)
So finding C5 is = 440 * (1.059463..)^3
= 440 * (1.059463..)(1.059463..)(1.059463..)
= 261.6 Hz
Hmm,
you multiply with a factor greater than one and get a lower result?
A new step in mathematical evolution 🙂
The right result here is 523,2511306008
You calculated the C one octave lower, exact the half... 😉
aliasant ·
stw wrote:
infuzion wrote: I'm not so good in math myself (I failed a class since I couldn't prove 1+1=2), but I understand this much:
frequency = 440 * (1.059463..)^(step difference from A4)
So finding C5 is = 440 * (1.059463..)^3
= 440 * (1.059463..)(1.059463..)(1.059463..)
= 261.6 Hz
Hmm,
you multiply with a factor greater than one and get a lower result?
A new step in mathematical evolution 🙂
The right result here is 523,2511306008
You calculated the C one octave lower, exact the half... 😉
Yes. That makes more sense. One of the results I got =)
Especially since 440 is A4 if im not mistaken. C5 should be higher =)
infuzion ·
aliasant wrote:
infuzion wrote: I'm not so good in math myself (I failed a class since I couldn't prove 1+1=2), but I understand this much:
frequency = 440 * (1.059463..)^(step difference from A4)
So finding C5 is = 440 * (1.059463..)^3
= 440 * (1.059463..)(1.059463..)(1.059463..)
= 261.6 Hz
I tried to do this 440 x (1.059463 x 1.059463 x 1.059463) but that was not right.
Oops sorry, I copy & pasted the wrong Hz
= 523.3 Hz
No one followed the link I provided?
stw ·
infuzion wrote: No one followed the link I provided?
Are the two postings above hidden for you?
MyCo ·
what's wrong with my versions?
Filters and optimization
infuzion ·
MyCo wrote: what's wrong with my versions?
Filters and optimization
They are cool!
Do they have built-in Pitch to Freq?
stefan ·
base_frequency * 2^(octave_offset)
or in semitones
base_frequency * 2^(semitones_offset/12)
etc.
aliasant ·
MyCo wrote: what's wrong with my versions?
Filters and optimization
Your Moog24dB uses 199cycles and your Moog 12dB uses 100 cycles.
My version uses 75 cycles.
I dont think they are they same code.
Also. I noticed some problems with mine. If I modulate the freq with anything, Lfo or env,
I get very flawed sounds. So I cant use it with modulation. But it sounds good As long as Im not modding it.
Maybe that goes away if I remove the hop.
Just woke up so I havnt tried that yet.
After some testing I noticed that I get booms and really high pitched wierdness if I modulate the cutoff with eg. the Non bandlimited Saw Lfo but not if I use the stock saw osc. The boom comes when it goes from from a high number quickly back to 0 or <0.
aliasant ·
stefan wrote: base_frequency * 2^(octave_offset)
or in semitones
base_frequency * 2^(semitones_offset/12)
etc.
Oh Stefan. THat looks good but its gibberish to me =)
Can you make a P to F in green so it can be looked at?
stefan ·
aliasant wrote:
stefan wrote: base_frequency * 2^(octave_offset)
or in semitones
base_frequency * 2^(semitones_offset/12)
etc.
Oh Stefan. THat looks good but its gibberish to me =)
Can you make a P to F in green so it can be looked at?
woop! How can that be gibberish? 🙂
pick a base note, for instance A4. It's frequency is 440hz, which then is the base_frequency.
440hz * 2 ^ (semitone offset from A4 / 12 ).
For instance, a C4 would have an offset of -9 semitones
440hz * 2 ^ (-9 / 12) = 261.625565hz
Btw, google is a decent calculator 🙂
http://www.google.se/search?q=440+*+2+^+(-9+%2F+12) (phpbb can't deal with the url though it seems...)
aliasant ·
Lol. Sorry Its just the way its written.
In my tiny head I would write it like this
A4 = 440 Hz ( or is it A3 ? )
Base Value = 1.059463
C5 ( or is it C4 ? 😉 ) = 440 x (1.059463^3) = 523.3 Hz
That is understandable by me. But that is only because Im useless at math. Sort of.
I think I got this part figured out. If you want G4 you would have to do this.
440 x (1.059463^-2) = 391.99548 Hz
The "-2" means you go down 2 steps from A4.
All good. BUT
We want to convert from Pitch to Freq. Not from Hz to Freq.
C4 = 60 I think.
A4 is then 69
aliasant ·
MyCo wrote: what's wrong with my versions?
Filters and optimization
Ok Myco. I made some modifications to the Moog 24dB filter. I think it works better now but these things should be in the code.
When you open the osm you will see some of the mods but I also changed the cutoff Max and Min inside the asm code.
Hope that explains it a bit. Still I think the resonance works much nicer in the code I used. But it doesnt work when modulated like your does.
infuzion ·
aliasant wrote:
MyCo wrote: what's wrong with my versions? Filters and optimization
Ok Myco. I made some modifications to the Moog 24dB filter. I think it works better now but these things should be in the code. When you open the osm you will see some of the mods but I also changed the cutoff Max and Min inside the asm code.
I don't see all the changes you made? I see the MAXCUT & MINCUT values are different, but can you please //comment what you did change, so I can learn?
Also, I don't understand what is going on inside the module, but outside the Code, like why everything is multiplied by 3, why you have a "mix" module, etc.
aliasant ·
infuzion wrote:
aliasant wrote:
MyCo wrote: what's wrong with my versions? Filters and optimization
Ok Myco. I made some modifications to the Moog 24dB filter. I think it works better now but these things should be in the code. When you open the osm you will see some of the mods but I also changed the cutoff Max and Min inside the asm code.
I don't see all the changes you made? I see the MAXCUT & MINCUT values are different, but can you please //comment what you did change, so I can learn?
Also, I don't understand what is going on inside the module, but outside the Code, like why everything is multiplied by 3, why you have a "mix" module, etc.
Ok. I think its a fluke that both are multiplied with 3.
Input is multiplied by 3 because, for some reasons, its gain output is that much lower then all other filters.
Compare it with the SVF filter for example.
The res is multiplied by 3 because it can go that high. Why limit the res if it doesnt have to be limited?
The mix is there because I want to use the Cutoff knobs full range.
the 1-cutoff is because the lower the cutoff freq the higher the Res can be. So at lower cutoff 1-cutoff is added to the res.
All these things should be in the code I think. Its pretty easy to do but the AsM would have to be remade I guess.
I left out any limiters or crazy input modifications(if you need a resonance 3x higher, you should do that in the green data). There is however a 0-1 limit in the code that can be enabled if needed. The output of this filter is 100% same as of the toolbox filter.
infuzion ·
aliasant wrote: That is understandable by me. But that is only because I'm useless at math.
Does this clear things up? 😉 http://www.kvraudio.com/forum/viewtopic.php?p=3317334
KVR Genetic_Junk wrote: Suppose I wanted to compare (in cents) intervals from equal tempered scales to corresponding just intervals. So in an equal tempered scale with 17 notes the fifth 3/2=1.5 is approximated to 2^(10/17)=1.503. To determine the difference in cents we (ln(3/2)/ln(2)-ln(2^(10/17))/ln(2))*1200 cents in an octave. This comes out to about 4 cents. So we know that the fifth in 17 note equal tempered scale is 4 cents wide of the 3/2 interval.
aliasant ·
I did find the formula but I dont quite understand it =(
Here it is as c code:
int n = (int) ( ( 12 * log(f / 220.0) / log(2.0) ) + 57.01 );
Have a look at these sites.
http://www.music.mcgill.ca/~gary/307/week1/mspfeatures.html
http://crca.ucsd.edu/~msp/techniques/v0.08/book-html/node8.html
aliasant ·
I found another way of doing it.
Looks much simpler. Its from Reaktor.
First you take the input in Midi Pitch 1-128 range. Can also go higher.
Then you get the exponential value of that 1.05946
And then multiply it with 8.17742
Now. how do we do the exp thing in SM? I know I have done it before. In green we could use the power float I think. But how to do that in code?
Here is the Reaktor Ensamble if you wanna have a look at it.
kirkagur ·
aliasant wrote: I found another way of doing it.
Looks much simpler. Its from Reaktor.
First you take the input in Midi Pitch 1-128 range. Can also go higher.
Then you get the exponential value of that 1.05946
And then multiply it with 8.17742
Now. how do we do the exp thing in SM? I know I have done it before. In green we could use the power float I think. But how to do that in code?
Here is the Reaktor Ensamble if you wanna have a look at it.
hi
is this what your looking for?
Pitch To Freq From Reaktor OSM
aliasant ·
Sort of Kirk but your version uses 126 cycles and the hopped version I just made uses about 6 cycles =)
But yes. Its basicly the same one.
Here is the osm were you can see what I did.
Interesting that the stock Pitch to Freq float doesnt output the same numbers. Close but not exact.
First I made a Pitch to Hz that uses about 3 cycles. Its hopped by 512 but that can easily be changed in the asm code.
I hooked it all up with a filter so you can test it. I think it sounds pretty good even though its hopped.
I also added a fast lowpass filter that uses about 2 cycles to smoothen the signal before the filter.
The Hz to 01 can also be implemented into the code but I havnt done that yet.
infuzion ·
aliasant wrote: First I made a Pitch to Hz that uses about 3 cycles. Its hopped by 512 but that can easily be changed in the asm code.... I hooked it all up with a filter so you can test it. I think it sounds pretty good even though its hopped. The Hz to 01 can also be implemented into the code but I havnt done that yet.
Is 512 too much for a 44.1k SampleRate? Perhaps bearable for 96k SR, unless one is modulating the Pitch for some reason (I can't think of one yet offhand).
Yes, you might as well put the Mult from the Hz To 0-1 inside that hop, & put a Float Sample & Hold at the end of the green there since you are on a CPU-saving campaign 😉
I'm glad all this gibberish math is sinking into your brain 😀
matti ·
Intresting stuff on the pitch2freq 🙂
matti ·
stefan wrote:
aliasant wrote:
stefan wrote: For instance, a C4 would have an offset of -9 semitones
440hz * 2 ^ (-9 / 12) = 261.625565hz
The stock modules give out 261.62554932 tho.. Is this the exact formula of them?
aliasant ·
Ty Infuzion. Yes Im glad too that some of that gibberish is understandable =)
Ok. I made a Pitch to Hz & Freq. It works well but there is something odd about it.
The code requires a sample rate prim to be added at the input.
If I dont connect that one the code uses about 5.4 cycles but if I connect it ( with a float sample & hold in between )
the cycles go up to 15.5 cycles. 10 extra cycles just for connecting a float number?
The Hz to freq math is all done outside the hop since I couldnt get it in there.
I have made something wrong I guess. Can anyone help?
Here is a osm.
Matti. Look at this osm you will se that the stock modules isnt the same and no. That is not the formula I ended up using.
I used the one from Reaktor and I think maybe that one is a roughr approx and that that is the reason for the numbers not adding up.
matti ·
aliasant wrote: Matti. Look at this osm you will se that the stock modules isnt the same and no. That is not the formula I ended up using.
I used the one from Reaktor and I think maybe that one is a roughr approx and that that is the reason for the numbers not adding up.
No. I ment that the stock modules don't give out the same result as Stefans calculation did, or what my calculator gives. So obviously that is not the same formula as the stock modules have. Or is there just some 32bit Floats vst my TI-86 difference here?
Btw. About that schematic of yours. What processor do you have? On my dualcore P4 the "calibration" with empty analyser won't work, because there's this 100 cycle limit to what it can detect. Every asm or part of a schematic that isn't over 100 cycles will always show a 100 cycle cpu usage on it's own. So everything under 100 cycles with this Analyser setup of yours gives 1.1 cycles. Only way for me to measure cpu usage is to use multiple instances and divide the result of their combined cpu usage...
Btw 2. There's no difference for me if the float is connected or not. I still get a steady 23.5 cycles cpu usage. Maybe you should try my method for cpu usage analysis?
Btw 3. Please remember that your Pitch to Hz and Freq is MONO. So it's not usable as such in synths.
aliasant ·
matti wrote:
Btw. About that schematic of yours. What processor do you have?
I have 2 dual core XEONs And it seems to work very well with this analyzer but maybe I have been tricked all along... Anyone else knows anything about this???
matti wrote: Btw 2. There's no difference for me if the float is connected or not. I still get a steady 23.5 cycles cpu usage. Maybe you should try my method for cpu usage analysis?
Could you post your analyzer and Ill try it?
23.5 seems a lot. What is the stock sine osc use on yours?
matti wrote: Btw 3. Please remember that your Pitch to Hz and Freq is MONO. So it's not usable as such in synths.
Crap. I used the mono power to make this. Should be fairly easy to convert it. Thanx for noticing =)
matti ·
aliasant wrote: Could you post your analyzer and Ill try it?
23.5 seems a lot. What is the stock sine osc use on yours?
Ah, shit. I noticed some irregularities on my method of testing the cpu usage too 😀
It all depends greatly on what way the modules are connected. If they are in serial it's totally different than if they are in parallel(which is faster). And 8 instances of any module seems to be faster per instance than 16, or 4 for example..
Ah. I haven't done comparing like this before i guess. I've just measured some piece of code against another piece of code, with similar connections. That way i know if it's faster than the other, but it seems this method is not that easily generalizable. I'm sure it's just a problem with my cpu. It really sucks with branching 😕
Btw. I used to test cpu usage from the values that came after the first few samples where there's alot of "initalization" stuff going on and the cpu spikes quite high. I later noticed that spike affected ASIO performance in compiled VST's, as the cpu usage spiked in similar way too(start of notes on a synth for example). Later on the cpu spiking got fixed, but there's still that init spike on the SM analyser. Do you think that is something to consider when approximating the cpu usage or not?
When i rewrote some of my effect plugins to C++/asm my estimations without the init spike included seemed to be about right... atleast that's what i recall. I guess i should test this a bit more... 🙂
matti ·
aliasant wrote: I have 2 dual core XEONs And it seems to work very well with this analyzer but maybe I have been tricked all along... Anyone else knows anything about this???
If it works for you it might be just fine. It's very cpu dependant. I just wanted to let you know so you won't be suprised later on when someone reports 1 cycle cpu usage on a sine osc or something 😀
So by all means, don't go trashing it!
I've also did some tests and it seems the best way for me to measure is with multiple parallel instances connected to an analyser. This gives more reliable results than in serial.
Here's my current cpu-cycle analyser if anyone needs one -> link
It's built with the handicaps of P4's in mind, but it will work with other processors too.
infuzion ·
aliasant wrote: If I dont connect that one the code uses about 5.4 cycles but if I connect it ( with a float sample & hold in between )
the cycles go up to 15.5 cycles. 10 extra cycles just for connecting a float number?
Theory: Since you are now doing the divide inside the ASM instead of green like before, that is causing the the extra cycles. Why the jump only after connecting a green input >0? I've read that AMD64 & Intel-Core (maybe only Duos) will cheat (& use fewer cycles) on their divides if they are dividing certain numbers (round, smaller)... so perhaps skips the divide when finding a 0?
IMHO, keep the 2/SampleRate in green, since it is a static number anyhow. I also notice that without the green Float S&H, I get a few peaks at 34cycles, but peaks at only 7 cycles with the Float S&H!
infuzion ·
aliasant wrote:
matti wrote: Btw. About that schematic of yours. What processor do you have?
I have 2 dual core XEONs...
I'm not to familiar with XEONs, is yours based on Core2?
I've tested your mono|poly Pitch to Hz and Freq with the extra mulps but without the divps:
Hop 256: 5.4|6.5 cycles
Hop 064: 9.2|18.3 cycles *on Core2, may be much higher % increase on lesser CPUs
I'm still wondering if your P2F is used attached to a real MIDI stream, if the larger hop can slow down the changes... I guess most computer hosts are 480 or 960 PPQ (Pulses Per Quarter note)? So 480PPQ~=1 MIDI resolution per .0001 of a second, & Hop(256) at 44100SR = 0.00580498866/second, so a pitch change will have to wait up to an extra 5PPQ for it to actually change the output of that code? Then again, a over taxed host due to CPU-hungry VSTs will not be good for MIDI playback either.
If you move back that divide to green, then you can do this to save another 2-4 cycles:
movaps xmm0,fAns;
mulps xmm0,F8P17742;
movaps Hz,xmm0;
mulps xmm0,TwoDivSR;
movaps Freq,xmm0;
aliasant ·
infuzion:
resolution per .0001 of a second, & Hop(256) at 44100SR = 0.00580498866/second, so a pitch change will have to wait up to an extra 5PPQ for it to actually change
Something slightly off in this math 😉
Something nice with Reaktor is the "Control Rate" Isnt that like a built in Hop?
A hop that affects all the processes and not just a selected piece of code.
It is also synced to an internal clock so that all processing happens at the same time thus avoiding problems that would have emerged if they happened without the sync. Maybe someone here knows how this works. I might be completely off but I think it works like this. Would be nice to have in SM....
Back to the PtoF
Matti pointed out that I used the mono power to build it so I need to go back and use the slower power asm code so that we can use it in poly. I dont like to put the samplerate math in green since its hard to understand that part if you only have the code and lost the greens. I often find small codes that makes no sense since ( funny ) there is no description and the inputs are not normalized. If i remember correct the math for this samplerate thing was 2/sr. Not that obvious if you didnt know this. Anyways. I will take it out and leave a description in the code. If it saves cycles it saves cycles 😉
Now. I need another moog filter to optimize. This one sounds great but cant be modded since it then sounds crappy.
Andrew J ·
matti wrote: Here's my current cpu-cycle analyser if anyone needs one -> link
It's built with the handicaps of P4's in mind, but it will work with other processors too.
Matti,
Take a look at my CPU Cyle Tools and how I take a section out of the analyser output. This avoids inaccuracies that occur in the first few measurements of each analysis.
-Andrew
matti ·
Andrew J wrote:
matti wrote: Here's my current cpu-cycle analyser if anyone needs one -> link
It's built with the handicaps of P4's in mind, but it will work with other processors too.
Matti,
Take a look at my CPU Cyle Tools and how I take a section out of the analyser output. This avoids inaccuracies that occur in the first few measurements of each analysis.
-Andrew
Yes, but the question is: Do they count in a compiled vst? I'm thinking they do. The peak seems like it's the data fetching that happens everytime the plugin dll gets called. Vst's basicly work by processing blocks of data(the sample amount of your ASIO latency). Other option would be that it's some internal code generation of somekind and only happens when the plugin gets loaded. Either way only Devs know the answer to this 😕
aliasant ·
OK. I fixed it so that the 2/sr is outside the code. Thanx for the quick way Infusion.
I also made it poly so we can really use it.
Lowered the hop to 128 and it now uses about 9.2 on my machine.
Andrew J ·
matti wrote: Yes, but the question is: Do they count in a compiled vst? I'm thinking they do. The peak seems like it's the data fetching that happens everytime the plugin dll gets called. Vst's basicly work by processing blocks of data(the sample amount of your ASIO latency). Other option would be that it's some internal code generation of somekind and only happens when the plugin gets loaded. Either way only Devs know the answer to this 😕
Yes that is a problem. Seeing as we can't do anything about it as users my thoughts were that its best to measure in a way that skirts that problem and focuses on things where we can actually make a difference. I think the technique is valid for doing A/B comparisons of code optimisations.
Sorry to keep going off topic Martin!
-Andrew
aliasant ·
Andrew J wrote:
Sorry to keep going off topic Martin!
-Andrew
No worries Andrew 😉
I almost forgot what this thread was about.... Hmm. Moog filters.
Ok
About that.
I dont really like any of the moog filters we have so I started to try and fix the Karlsen Filter. Thats a nice one.
But not that fast. Havnt tried to asm it yet though. Should be able to save quite a bit I think.
There is that place http://www.musicdsp.org/archive.php?classid=3
A ton of nice filters and many of them seems to be easy to convert to SM.
Should we start doing that?
infuzion ·
aliasant wrote: A ton of nice filters and many of them seems to be easy to convert to SM.
Should we start doing that?
Sure, maybe in a new thread per filter? Or 1 huge thread & post the *final* result in the WiKi, & the first post or 2 in that thread with an index of chat & files?
aliasant ·
infuzion wrote:
aliasant wrote: A ton of nice filters and many of them seems to be easy to convert to SM.
Should we start doing that?
Sure, maybe in a new thread per filter? Or 1 huge thread & post the *final* result in the WiKi, & the first post or 2 in that thread with an index of chat & files?
I have been busy trying to fix the Karlsen filter. I got the lowpass working and it sounds good but creating HiPass, BP and so on hasnt been as easy.
Here is a pdf with a bunch of filters in it. Its made from http://www.musicdsp.org
What filter should we start with?
What I am personally looking for is a good moog like 24db/oct filter that also has HiPass . Then it should be easy to add BP , Peak and maybe notch to it.
What I do like about the Karlsen filter is that it can be driven very hard but as I said before. I cant get it to make a good HiPass.
MyCo ·
infuzion wrote: Sure, maybe in a new thread per filter? Or 1 huge thread & post the *final* result in the WiKi, & the first post or 2 in that thread with an index of chat & files?
Filters and optimization
Read the first post 😈
aliasant ·
MyCo wrote:
infuzion wrote: Sure, maybe in a new thread per filter? Or 1 huge thread & post the *final* result in the WiKi, & the first post or 2 in that thread with an index of chat & files?
Filters and optimization
Read the first post 😈
Hehe.
Ok. Your stuff is really cool but when its all asm'd its hard to make changes in the codes.
Were did you get the codes from ? Is it from musicdsp.org or ?
MyCo ·
aliasant wrote: Were did you get the codes from ? Is it from musicdsp.org or ?
These are all codes from S|M's own filters. They are also from musicdsp. I left the original code in the OSM as comments at the end of the ASM code. So it shouldn't be a problem. In the thread, I posted only the ASM so it could just be copied.
aliasant ·
MyCo wrote:
aliasant wrote: Were did you get the codes from ? Is it from musicdsp.org or ?
These are all codes from S|M's own filters. They are also from musicdsp. I left the original code in the OSM as comments at the end of the ASM code. So it shouldn't be a problem. In the thread, I posted only the ASM so it could just be copied.
'
Aaah Nice. Will have a look.
There are some filters out there that could be fun to test.
Chebyev, Butterworth and others.
Some of the codes looks very easy to port and some not.
Acrobat ·
aliasant wrote: There are some filters out there that could be fun to test.
Chebyev, Butterworth and others.
Some of the codes looks very easy to port and some not.
Butterworth is great! the name says it all 😉
aliasant ·
OK.
I modded the 24dB Moog filter that Myco provided.
left some notes in it. Sounds pretty good.
And yes. Butterworth is a great name =)
infuzion ·
aliasant wrote: I modded the 24dB Moog filter that Myco provided.
left some notes in it. Sounds pretty good.
Neat. What changes did you do exactly please? Aside from this:
LP=lastout;
lastout = lastout * Q;
Peak=lastout - input;
HP = Peak + LP;
aliasant ·
infuzion wrote:
aliasant wrote: I modded the 24dB Moog filter that Myco provided.
left some notes in it. Sounds pretty good.
Neat. What changes did you do exactly please? Aside from this:
LP=lastout;
lastout = lastout * Q;
Peak=lastout - input;
HP = Peak + LP;
Here is the code with the changes I made. I marked them with "////"
streamin input;
streamin cutoff;
streamin resonance;
streamout LP; ////Changed the name from output to LP
streamout Peak; //// added Peak
streamout HP; //// added HP
hop(32) { //// changed the hop from 128 to 32. The loss was a couple of cycles.
cut1 = (cutoff * cutoff)+0.07 ; ////added this to scale the cut
cut1 = (((cut1*cut1)*0.8)); //// scaling
cut1=min(0.8,cut1); ////set the clip lower to avoid problems. Was 0.99
cut1=max(0.0045,cut1); //// Changed the max from 0.01 to make the filter go lower.
cut2=cut1*cut1;
cut3=cut1*cut2;
// cubic fit by DFL, not 100% accurate but better than nothing...
p = 3.2937*cut1 -0.59515*cut2 -0.69346*cut3 -1.0072;
x=p*99+100;
// square approximation of original gaintable (RL)
gaintable = 0.00002*x*x - 0.0069*x + 0.9597;
Q = ((resonance * 3) - (p*0.5)) * gaintable; //// Multiplied the Resonance by 3 and subtracted half of p.
}
lastout=0.0625 * ( input - lastout ); // negative feedback
LP=lastout;//// Changed name from output to LP
lastout = lastout * Q;
Peak=lastout - input;
HP = Peak + LP;
infuzion ·
aliasant, I'm sorry to report, I'm not so sure about this filter. Upon opening your file, & hitting the same note(s), you'll get different sounds. Most distinguished on the HP selection. 😮
aliasant ·
doublepost
aliasant ·
aliasant wrote:
infuzion wrote: aliasant, I'm sorry to report, I'm not so sure about this filter. Upon opening your file, & hitting the same note(s), you'll get different sounds. Most distinguished on the HP selection. 😮
Very odd. I have no such problems.
Maybe you had the Velocity knob turned up ?
Test this build. Maybe it works better.
stw ·
infuzion wrote: aliasant, I'm sorry to report, I'm not so sure about this filter. Upon opening your file, & hitting the same note(s), you'll get different sounds. Most distinguished on the HP selection. 😮
just a guess...
LFO depth not zeroed?
I was irritated first too. Maybe one should keep shematics for testing purpose as lean as possible and leave everything out (like chorus) what's not needed and select default values that keep the focus on what's mainly presented.
No criticism, just an opinion.
Beside that it sounds fine 😀
MegaHurtz ·
personally i would`nt mind having a raw fhz version.
I`d put up a 2pow for accurate heavy.
and the self multiplied version for cpu friendly.
Nice work.. vrgr Lukas.
aliasant ·
I made some minor changes to allow for more resonance. Can be fun for some sounds.
In this part of the code ( the hop part ) I marked the changes in blue.
I first raised the value I multiply the resonance with from 3 to a 3.4
Q = ((resonance * 3.4) - (p*0.5)) * gaintable;
Then I had to lower the cutoff range a bit to avoid some nasty things in the high frequencies. I lowered them both from 0.8 to 0.6 This means that the freq doesnt go all the way to the top but for a synths filter I dont think thats necessary but I guess thats highly debatable.
cut1 = (((cut1*cut1)*0.6)); //// scaling
cut1=min(0.6,cut1);
infuzion ·
aliasant wrote:
infuzion wrote: aliasant, I'm sorry to report, I'm not so sure about this filter. Upon opening your file, & hitting the same note(s), you'll get different sounds. Most distinguished on the HP selection.
Very odd. I have no such problems.
Maybe you had the Velocity knob turned up ?
Test this build. Maybe it works better.
I didn't turn anything when I opened the old file & had the variance. The newer one does seem more predictable, so congrats.
The typical Moog is much more smoother than yours; yours is closer to a 303 filter without the extra drive to me. But yours does have its uses 🙂
MegaHurtz ·
Old Robbert would`ve been proud 😍
MegaHurtz ·
only you could yust feed it res*3.
Still very nice.
Wrote something here? To have a post removed or your name hidden, write to [email protected].