Scenario: oF 0.11.0 running on Debian Stretch. Audio stuff managed by Qjackctl (jackd).
I managed to write a class for an audio synth that performs a lot of calculations. Taking into account a bufferSize of 256 frames at 48 KHz, there are only 5.33333ms to calculate everything and fill the output buffer. By using and a little coding I estimated the time elapsed for these calculations. Declaring the object as static, like in .h file:
SynthClass synth; it takes not more than 3.2ms, but when I use a std::map<string ID, SynthClass synth> to store and allocate each voice using ‘new’ in the setup method, the calculation time rises to more than 7ms. This does not fill the audio buffer in time and makes jack kill the audio process because it appears to be zombified.
Could it be that the different way of declaring the objects has such an impact in performance? I am quite new to C++ and I’m learning on my own through books, forums and wall headbanging.
Thanks in advance.
BTW: Happy year’s ending!