Help with understanding some code

Reading the code from Josh again there is a mistake:

The loop only processes the LFO in form of fmMod. That is rather pointless if you don’t call setWaveFrequency (sorry, I think @karota pointed that out).

But another mistake is, the fmOsc is processed per channel in a loop, which brings us to:

The fmMod is advancing twice (or channels times) as fast as it should. Since it doesn’t call setWaveFrequency, we don’t know if it would do only once after the loop is done or each time inside.

Given that osc.process() is done outside, the only problem is the double speed of the LFO.

I really should read more carefully, you noted some of the issues yourself already… sorry, need more coffee :wink:

2 Likes