Page 1 of 1

How do some plugins contain so many filters?

PostPosted: Wed Aug 21, 2019 5:50 pm
by guyman
I've been implementing ZDF filters into a lot of my recent creations, and have many more ideas I'll soon flesh out. I've seen many plugins on the market (waves, fabfilter etc...) contain MANY FILTERS (30+) running simultaneously with NUMEROUS slope values (duplicates in chain??2x, 3x, 6x amount of filters??!) and I've seen some schematics here on the forum that utilize A LOT of filters (spogg, martin) and even after poking around I can't figure out how it is everyone but me is able to keep CPU down to nil in a schematic/vst whilst having it contain so many filters/filter chains....

Also when I start getting into guis, I find my self running 2 chains, one in mono/pack for my filters, another in poly for an impulse response for my visualizer/graph.... is this wrong? how can I max out my level of filters? should I be coding them all at once? should the redundant slope chains be done in code instead of a chain? I think I could use infinite amounts given the chance....

Any advice would be appreciated.

Re: How do some plugins contain so many filters?

PostPosted: Thu Aug 22, 2019 4:05 am
by martinvicanek
There are a few things you can do to cut down CPU load:
1. Updating filter parameters usually does not have to be done every sample. Use hop(16) for modulation and consider green or Ruby for static filter parameters.
2. Avoid using buit-in stream functions like pow(), sin() etc. Use these instead.
3. Pack the signal to mono4 where possible.
4. If you are willing to enter the world of assembly, optimize your code.

Re: How do some plugins contain so many filters?

PostPosted: Fri Aug 23, 2019 6:17 am
by guyman
Thanks Martin.
This hop (16) thing is over my head.

Re: How do some plugins contain so many filters?

PostPosted: Sat Aug 24, 2019 2:20 am
by martinvicanek
guyman wrote:Thanks Martin.
This hop (16) thing is over my head.

It is simpler than what you probably think. A code like this
Code: Select all
hop(16){
// update filter parameters
}

// compute next sample

would process each sample, however the filter parameters would only be updated every 16 samples. Check the manual.

Re: How do some plugins contain so many filters?

PostPosted: Tue Aug 27, 2019 5:07 pm
by guyman
ok Martin, will do.

Thanks !