I’d like some opinions on a design decision in a multiband Mid/Side processor I’ve been working on.
The plugin has two crossover modes: minimum phase (LR4) and linear phase (FIR). I wanted users to be able to switch between them while the track plays, without clicks. What I ended up doing is running both engines in parallel all the time, with the same fixed latency (~96 ms at 48 kHz), so switching is just a short crossfade.
The cost is that the min-phase path carries the same latency as the linear one, which kind of defeats one of the reasons to use min-phase. For a mixing/mastering tool I chose consistency over low latency, but I’m not sure it’s the best approach.
Some questions:
Would you report different latencies per mode instead, and accept a dropout/reset when switching?
Is running both engines in parallel a common approach, or is the CPU cost usually not worth it?
For the linear-phase engine I use a partitioned FFT convolution and crossfade between the old and new filter (from the same input history) when a crossover moves. Is there a better way to handle moving crossovers in linear phase?
I’m a producer/mastering engineer who started coding recently, so any comments on the approach are very welcome.
once the cross-fade is complete you don’t have to run in parallel any longer.
start processing the inactive engine again only if you need to cross-fade back to it.
I add a small ‘pre roll’ to the inactive one before the cross-fade to hide any ‘clunk’ from starting up the filter from cold on a non-zero input signal.
> Would you report different latencies per mode instead
You can, but you need to inform the DAW. and some DAWs handle this poorly or not at all.
Changing latency while running is a pretty delicate operation if you care about reducing glitches or messy behavior. I’ve gone to great lengths in Dynamic Grading to make that work.
The thing is this: you can change latency while the plugin is running, but it’ll depend on the host what happens then. Pro Tools is quite good at making the switch invisible, but most other hosts aren’t. They’ll only rebuild PDC delays when the sequencer stops and leave the old ones while it’s still running. So when you change latency with running sequencer, tracks will go out of sync and you’ll hear glitches. So the result becomes unbearable until you manually stop and restart the sequencer.
What I’ve done is to build a mechanism that defers the latency change until the sequencer is stopped. That’s fully transparent when the new latency as required by the algorithm is smaller than the current one (you just add extra delay to keep the old larger latency). When it’s the other way around, you’ll still run into problems, and in your case you probably can’t solve it.
Or just the very short version: you have absolutely no control over when the host actually applies your updated latency.