I wrote an audio plugin in faust. It has a defined latency because of a lookahead function.
As the faust2juce architecture has no option to report latency to the projucer, my question is: Where and how can I set the latency which the plugin reports back to the DAW?
You should use the method AudioProcessor::setLatencySamples().
Thanks. Where in the projucer code would I put that?
And is there a way to make this dependent on the samplerate?
My lookahead in faust is defined as 0.001 seconds.
There is no way to do it from the projucer, you’ll have to code it in the
processBlock() methods. You should have a look at the example DSPModuleDemoPlugin.
thank you, will try
Just a note that from my experience, putting setLatencySamples() in processBlock() is not handled well by a number of Windows hosts, resulting in audio artifacts. PrepareToPlay() is a safe place to do it.
And this is not well supported by Cubase on macOS either Indeed, it seems that
prepareToPlay() is the best place to do it.
@trummerschlunk We could possibly code that at Faust DSP level using a syntax like:
declare options [latency_frames:<frames>]or
declare options [latency_sec:<sec>]
the have the C++ architecture uses this metadata with
Would this work?
That would be awesome
latency_samples would also be great.