This week I added a simple tremolo effect to my mini-keyboard project Monokeys. Tremolo is a trembling effect, and sometimes seen in Low Frequency Oscillators.
I found an example of Coding some Tremolo and wrote the formula as an F# function:
let tremolo freq depth i = (1.0 - depth) + depth * (sineWave freq i) ** 2.0
Then I added sliders for the frequency and depth to compose the shape of a sound:
let tremolo i = tremolo tremoloFreq.Value tremoloDepth.Value i
let shape i = sineWave freq i * fadeOut i * tremolo i
Full source code is available on BitBucket: https://bitbucket.org/ptrelford/monokeys