Thank you, this is really useful!
I’m really only nitpicking here, but when you say “add”, do you mean it adds that on top of the default ksmps
(so total latency reported to the host will be ksmps
plus the value specified in latency()
), or does the value given to latency()
replace the default (ksmps
) as stated in the documentation? (I assume the latter, just wanted to double-check.)
Furthermore (with apologies, as I’m new to Cabbage and csound): is there way to have this value come from a single definition somewhere (think C++ constant expressions) that can be used both by latency()
as well as actual csound code? And maybe math be done on it? In my plugin I’m doing a convolution, and during development I’m trying to optimize the length of the impulse response, and it would be less mistake-prone if I could just set the value at one place in the script and have it effect both latency()
and the ftgen
table size, than having to not forget writing the same value to both places. Not essential at all, totally a lazyness thing on my part.
However this also then raises the idea of putting the setting of the length of the impulse response into the hands of the user of the plugin later down the road as a speed/quality tradeoff. In which case the latency()
value would need to change (as well as csound function tables to get resized) while the plugin GUI is open – not necessarily during performance though. Just food for thought.