# Help with understanding some code

**URL:** <https://forum.juce.com/t/help-with-understanding-some-code/45650>\
**Category:** Audio Plugins\
**Created:** [April 22, 2021, 8:31am UTC](https://forum.juce.com/t/help-with-understanding-some-code/45650 "2021-04-22T08:31:34Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [April 22, 2021, 10:59am UTC](https://forum.juce.com/t/help-with-understanding-some-code/45650/6 "2021-04-22T10:59:03Z")

</div>

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:

> [@\#1 most common programming mistake that we see on the forum](https://forum.juce.com/t/1-most-common-programming-mistake-that-we-see-on-the-forum/26013):
>
> This post is here so that we have something we can link to when this same issue comes up, because the JUCE team is getting very bored of spending time replying again and again to the same damned problem! This isn’t a JUCE bug - there’s nothing we can do in our codebase that would stop people making it, which makes it painful for us to watch beginner after beginner come along and fall headfirst into the same trap! It’s also understandable that people will post a new topic when they hit it, beca…

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 😉

---

_[View the full topic](https://forum.juce.com/t/help-with-understanding-some-code/45650)._
