SynthMaker

No FM SVF

Archive · 2006 8 old posts

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

Eska ·

If I replace this part:

rez = 1.0 - resonance; // clamp at 1.0 and 20/44100 cutoff = max(cutoff, 0.00045351473922902494331065759637188); cutoff = min(cutoff, 1.0); // tunable version //f = 2 * sin1((3.141592 * (cutoff / 36.0))); // taylor series version of 2 * sin(x) // cutoff * 1/38.0 x = 3.141592 * (cutoff * 0.026315789473684210526315789473684) * 2 * 3.141592; x2 = x*x; x3 = x2*x; x5 = x3*x2; x7 = x5*x2; // x3 / 6, x5 /120, x7 / 5040; f = 2.0 * (x - (x3 * 0.16666666666666666666666666666667) + (x5 * 0.0083333333333333333333333333333333) - (x7 * 0.0001984126984126984126984126984127));

in the State Variable Filter Code with this:

hop(32) { rez = 1.0 - resonance; // clamp at 1.0 and 20/44100 cutoff = max(cutoff, 0.00045351473922902494331065759637188); cutoff = min(cutoff, 1.0); // tunable version //f = 2 * sin1((3.141592 * (cutoff / 36.0))); // taylor series version of 2 * sin(x) // cutoff * 1/38.0 x = 19.7392088 * (cutoff * 0.026315789473684210526315789473684); x2 = x*x; x3 = x2*x; x5 = x3*x2; x7 = x5*x2; // x3 / 6, x5 /120, x7 / 5040; f = 2.0 * (x - (x3 * 0.16666666666666666666666666666667) + (x5 * 0.0083333333333333333333333333333333) - (x7 * 0.0001984126984126984126984126984127)); }

CPU load drops to 50% ~. I hop-ed the f-calc by 32, so fast Fm is not possible anymore, but for envelope control it is ok.

Cheers

infuzion ·

neat, thanks & welcome to SM Eska!

skOre ·

Highly welcomed people who come here and just drop some code like its hot...

sambean ·

Good show!

You could perhaps increase the hop size up to 128, if you included some sort of interpolation, so you calculate a delta_f value and recalculate the f at SR..

Sam

stefan ·

I recommend using the hop() for all kinds of optimizations, can make a _huge_ impact on lots of stuff 🙂

sambean ·

Here's a snip of a version with interpolation and hop(128). Everything else is as is..

float fnew, fold, fdelta; float start=1; multi = 0.33333333333333333333333333333333; rez = 1.0 - resonance;

hop(128) { cutoff = max(cutoff, 0.00045351473922902494331065759637188); cutoff = min(cutoff, 1.0); x = 3.141592 * (cutoff * 0.026315789473684210526315789473684) * 2 * 3.141592; x2 = x*x; x3 = x2*x; x5 = x3*x2; x7 = x5*x2; fnew = 2.0 * (x - (x3 * 0.16666666666666666666666666666667) + (x5 * 0.0083333333333333333333333333333333) - (x7 * 0.0001984126984126984126984126984127)); fdelta = (fnew - fold) * 0.0078125; //1/128 f = fold + fnew*start; // Filter always starts from input value fold = fnew; start = 0; }

f = f + fdelta;

Seems to work fine with slow mods..

Sam

angstrom ·

a "hop" side issue, is there a limit to Hop ? I seem to remember hitting a ceiling with a project a while back, can't remember whether it was 512 or 1024.

Eska ·

Thx. I will trie hard to understand this. To make clear, I am a beginner, butchering the code snippets I can find and up til now it has been a massacre.

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.