utdgrant wrote: ↑Sat May 14, 2022 11:32 am
Ah, reading back, I may very well have misled you. My bad.
Nah, I think I understood you. I was just thinking about the details and whether this might actually be a better approach than using timer threads for some stuff.
I typically use a 480 sample buffer size (as it's a good compromise between throughput and latency) so calling control code every 64 samples wouldn't make much sense but I can see that using a divisor of something like 960 might be useful (i.e. every 20 ms) or 1920 (i.e. 40 ms) .
In fact dividing by 1920 is something I might test as it would produce a 25 FPS frame rate for some operations that I currently do in a timer thread. Obviously anything that might block shouldn't be called from inside ProcessSample() but there are dozens of tasks in my timer threads that can't block and might be better handled like this.
Food for thought.