[Sharing] Growing collection of filters ported to Gen

Ess M's icon

I've been porting a few filters to Gen~ recently for my own work and thought it would be nice to share. I feel like this is something people are often asking for and can be a bit daunting if you're not used to reading papers and/or code. Hopefully it will eventually be a great source of different filters to allow for deeper exploration and instrument design.

First out is the excellent TPT SVF by Vadim Zavalishin from an implementation by Will Pirkle. Read more about it here and here. This one is great if you want to experiment with audio rate modulation.

I'll be continuously adding more: https://github.com/ess-m/gen-filters

mp's icon

Great!

Lance Simmons's icon

oh yea fm sounding v sweet
thank you!

Holland Hopson's icon

Nice work, Ess. Quick question: why use Massberg's tan approximation instead of the built-in tan function? Is this for efficiency?

Ess M's icon

Yes, it's for efficiency. I got almost twice the performance when using the approximation. Good for things like:

Cascading for a steeper roll-off

Max Patch
Copy patch and select New From Clipboard in Max.

Or running multiple in parallel as a resonator

Max Patch
Copy patch and select New From Clipboard in Max.

John J.A. Jannone's icon

Great project! Going to try these on my Daisy Patch.

I get an error from the Test Tone Generator gen~:

gen~: audio processing exception: Too many iterations (runaway loop?)

Everything works fine if I use my own audio source.

Max 8.5.5 - M1 Max - 13.2.1

Ess M's icon

Weird – not getting that same issue here and I'm on an M1 Pro. Can't seem to reproduce the error. I'm thinking it should be solvable by setting the partial count in that gen~ patch to a smaller value like 256 though.

If you're running these on the Daisy it's probably a good idea to use an approximation for tan, in case you're not doing that already - e.g

tan_a(x) {
    x2 = x * x;
    return x * (0.999999492001 + x2 * -0.096524608111) / 
    (1 + x2 * (-0.429867256894 + x2 * 0.009981877999));
}