Low Frequency Oscillator

hi guys,

i’m an absolute newbie and i wanna write a lfo with code blocks. can anybody tell me how to write it or give me some hints? i used the search function but got no results.
answers would be very appreciated!

best regards.

An LFO is just a low frequency (below 20Hz) sound wave, often a sine, square or saw wave. It is not audible itself but if it is mixed into another sound it will create modulation.

Have a look at the audioOutputExample in the examples folder. Open up the codeblocks project, compile then run it. It’s just playing a sine wave at various frequencies.

To mix in an LFO to the sine wave, generate a second sine wave in just the same way except lower frequency. Remember though that mixing is done by multiplying two signals, not adding.


output = sinewave * lfowave;  

i’ll have a go at this.