I have reached a point where I have the beginnings of a useful synthesizer application and interface from JUCE. However, I note that something is throttling the amount of CPU that this JUCE application can access.
Here are some screencaps of the function when built in standalone mode from Visual Studio. The knob seen here is a “partial count” for an additive sine wave synth. It is currently set at 6 polyphony. That means that at a # partials of 5, there are 30 sine waves running. For a #partials of 100, there are 600 sine waves running.
Case #1: Knob set to 5 (30 sine waves) running normally, using low CPU:
Case #2: Set to >100 partials, garbled output, but still only using ~32% CPU:
The odd behavior I’m noting is that it works perfectly fine up to around 29 on my laptop (desktop is down currently), but past that becomes severely glitchy in its output. Monitoring it in Task Manager and a 3rd party CPU monitor both show that no more than ~32% of each core or my total CPU is ever being recruited. It reaches around this utilization from 35 on the knob and up and never takes more CPU no matter how much higher I turn it.
ie. Something is preventing it from using as much resources as it needs to run.
I tried setting the Performance in Task Manager to “Real Time” in case Windows was throttling it there. But that didn’t help.
What ought to happen is I should be able to turn that Partial Number knob up until my CPU is completely maxed out. Yet it never lets me get there. Instead the sound starts degrading and becoming garbled way before that point (ie. around 34% CPU or >30 on the partials knob).
Is there any reason in general this might be happening? There is nothing in the synth design that specifies any limit to the number of partials, and the degree of “garbling” of the sound changes as I go up and up on partials, which tells me it’s responding to the increased partials in its own way. It’s just not getting the resources to produce them.