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:
Or is there any other way to make the ladder filter a bit less of a CPU hog?
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)
Or is there any other way to make the ladder filter a bit less of a CPU hog?