Manage digital clipping?

Hi, I’m trying to create a basic “supersaw” style set of oscillators. 8 saw waves that can be detuned. When the saw waves are close to in tune with each other (only a few cents difference) everything sounds good, but as I increase the range of detuning, I get a bunch of crackle/clip sounds. It sounds like digital overloading / clipping, but it seems to happen even when the oscillator amplitudes are all set very low and the output volume shows low as well… which leads me to believe something else is happening.

Is there anything else off hand that could be contributing to this crackling sound? If it is digital clipping, is there an agreed upon convention for preventing this in the audiocallback function?

Anything I could try to do to identify the issue?

Additionally, it seems to be more present with 8 saw waves than 8 sine waves, though still moderately present with the sine waves.

Thanks!

Another possibility is you’re running out of CPU - you could try adding the oscillators one by one to see where you run out, maybe decrease the sample rate, or ‘instrument’ the code to keep track of cpu usage.

It could be a CPU issue as tunagenes suggested.

You can measure the CPU with a code like the one I shared here: Hansy Synth and Daisy seed - #7 by Takumi_Ogata