Hey there!
I just started programming with Juce and tried to create a simple sine synth as a AU. But i keep getting these strange fragments. Link to a Audio Example First i thought it might be some kind of imprecisely casting or something but i cant find a solution.
Here is the algorithm in the processBlock:
auto* channelData = buffer.getWritePointer (0);
auto* channelData2 = buffer.getWritePointer (1);
for(int i = 0; i < buffer.getNumSamples(); i++) {
auto currentSample = (float) std::sin(phase);
phase += (synthPitch / getSampleRate()) * 2.0f * float_Pi;
channelData[i] = (float) currentSample * synthVol;
channelData2[i] = (float) currentSample * synthVol;
}