Is it possible to make a poly synth with ladder filters?

whannah

Member
After a week of debugging some odd behavior I'm just now realizing how CPU intensive the ladder filter emulation is!

I'm using a Teensy 3.5, and I boiled my code down to a very simple 3-voice poly synth with output to the onboard DAC (very handy!), but every time I played a 3rd note the thing would go berserk and freeze, making a very loud/distorted sound until I reset it. The behavior was consistent despite substantial changes I made to narrow down the issue, which had me convinced that it was just a problem with my code.

I finally started printing the CPU usage and realized that each voice was adding ~40% to the total usage. So that explains why two voices was managable, but the third voice always threw everything into chaos.

Now I'm trying to decide what to do, and there's a few obvious options:
  • switch to using the state variable filter
    (maybe just when the synth is in poly mode)
  • Put the ladder filter at the end of the chain and give up on using filter tracking and a filter envelope
    (similar to a paraphonic synth)
  • Give up on making a poly synth and just stick with a mono synth
    (I'll probably use the mono mode most of the time anyway)
However, I'm wondering if the newer Teensy 4.x models would handle multiple ladder filter instances better? Ideally I want 4-voices, so if a newer Teensy could handle this then I would just upgrade for this project.

Or is there any other way to make the ladder filter a bit less of a CPU hog?
 
T4's can do 1200 instructions per microsecond on a good day - yes it will make a huge difference to throughput.
 
You could also try using the more CPU friendly version of the ladder filter as Richard van Hoesel outlined here. I recently used it on a Adafruit ItsyBitsy M4 Express board and it worked well. I applied his changes and stuck the files on my GitHub, if you want to give it a try.
 
Thanks for the comments, I ordered a Teensy 4.1, so I should be good to go! I'll probably try out those mods to make it more efficient at a later stage.
 
Back
Top