please don't laugh too hard, after all, i am just a lowly actionScripter 😆
I am extremely (hopelessly) curious about this stuff, but know just about nothing - probably my math deficiency doesn't help either...
so if there is someone who can explain in total retard terms, i would be greatful 🙂
basically, this uses a feedback loop; well, obviously 😆 and i am actually surprised to find that it doesn't sound too bad, considering i translated it from a modular patch (DeltaSP) and also because i don't really know why the computer understands what to do with it.
the problem is, frequency; it cacks out if the cutoff goes above a certain amount, or if the audio goes above a certain frequency. and unfortunately that amount is well within human range - about middle G 😆 well, a bit higher.
so how about it? anyone feeling patient?
cheers, all.
rl ·
Hi Spoonboiler
your lowpass filter has a problem when cut=1.0 causing a divide by zero error. with cut < 1.0 the maximum cutoff frequency is ~7kHz at 44100Hz sampling rate. With a little 2x oversampling trick (see below) your filter remains stable upto 14kHz (cut < 2.0). With 3x oversampling (cut < 3.0, using one third of cut and three calculations for f0, f1) you could nearly reach nyquist.
// RL: half cutoff for 2x oversampling
cut2=0.5*cut;
// RL: calculate section twice for oversampling
feed=reso+(reso/(1.0-cut2));
f0=f0+cut2*(in-f0+feed*(f0-f1));
f1=f1+cut2*(f0-f1);
// caluclating feed a 2nd time is not necessary
// feed=reso+(reso/(1.0-cut2));
f0=f0+cut2*(in-f0+feed*(f0-f1));
f1=f1+cut2*(f0-f1);
out=f1;
cheers,
Rudolf
edit: small mistake corrected
spoonboiler ·
🙂 🙂 🙂
thanx, rh!
that is very kind of you. i am still at that "holy shit, this is just so far over my head" stage, but hopefully i will start to understand eventually. Your reply has helped me on my way, and i am grateful.
-g
edit: it goes much higher now.
what is the most one would want to oversample a simple filter like this?
would u say it would be better to just try to write a better filter than to go any higher than 3x?
just for fun i went up to 8 😆 but then i have a simple synth using 3% cpu (on athlon64/3500+, probably not good...)
😀
spoonboiler ·
now i have another question...
i was getting a pop followd by no sound if the mod amount plus the cutoff knob amount went above a certain level, so i went:
float max=2.5;
cut=min(cut,max);
it works.
if i have the theory of how SM works, then max could have been as high as 3.0, with three times oversampling, and still managed to limit the data coming in the cut pin to 1?
so.... SM works with levels between 0 and 1 under normal circumstances, right, unlike SynthEdit which uses a CV paradigm with levels between 0 and 10 (virtual volts 🙂 ) ???
anyway, the sound is nice with four times oversampling right up to the top of the keyboard, which was making my dog uneasy 😆
can someone tell me if i am way off base here? it's really about time i started to understand this program, so i am trying to find the time (and patience).
cheers
Wrote something here? To have a post removed or your name hidden, write to [email protected].