HISE FX and delay compensation
-
I could use some suggestions on how to improve my approach to handling latency in my projects. I've currently been manually measuring latency and compensating for it based on which DSP nodes and oversampling are active. While this works well for static latency, I’m running into a challenge when I need to dynamically update the latency.
Right now, I’m using:
prepareToPlay() to get the initial latency with Engine.getLatencySamples()
processBlock() to set latency using setLatencySamples()
This works well for static latencies, but now that I’m introducing multiple oversampling filters, I need to adjust latency dynamically, depending on whether the user selects Linear-Phase or Minimum-Phase filtering. Since Linear-Phase filtering can add up to ~120 samples, I don’t want to set a fixed latency that high, as it would negatively impact real-time usage.
I need a way to recalculate latency when the processing mode changes. For example, when switching between oversampling filters. The goal is to update latency based on active DSP modules.
@Christoph-Hart or anyone else have suggestions on how to dynamically recalculate the latency? -
@Dan-Korneff can you measure the latency of your modules, put it in consts and make the call to set the new latency to report whenever the user changes any of the controls that affect it?
-
I would not trust every host to support dynamic latency so I‘d definitely check this thoroughly.