I would like to discuss my challenge for development ![]()
There are 40 mono signals @44.1 KHz. For each of them I need to do a fft. Then I will do a polyphonic filtering of some of these signals with about 48 filters, each of them with independent envelopes. I want to do compositional/control computation in a different thread reading the fft data written by the audio thread. This altogether builds a plugin which is integrated in Unity for visualization/interaction purposes.
As I am coming from Max (cycling74) and java programming now diving into c++ and Juce I have some questions concerning software and hardware architecture. I implemented a similar structure in Max 8 using the parallel option for poly~. After some recherche on Juce I have the impression that this approach could be very complicated to implement.
Is it reasonable to put all the audio stuff into ONE thread resp. one core. So it would make sense to use a pc with maximum speed per core. Or would it more advisable to use concurrency programming rendering each audiosignal in its own thread. Then it would be better to have more cores rather than maximum speed per core. Concerning the fft analysis: the audiosignals could be rendered quite independently, they are not dependent from other computations. The filtering needs access to multiple or all of these signals at the same time.
Why don’t you just try first doing it in the audio thread (single one) with SIMD? while 40 FFT + 48 filters may seem too much, you’d be surprised how far you can go by optimizing it (specially if using a good performing FFT optimized with SIMD directives [AVX2 or AVX512], and a modern CPU that usually have strong single thread performance). Filters can be optimized aswell depending on the filter type and the number of poles you use. If that isn’t enough you can always pivote to multithread processing
1 Like
Yes thanks for your reply. I was thinking about SIMD as well and sure: first implementing for single core than extending does make sense. Especially as I start learning Juce and c++.
