Created
August 5, 2017 15:01
-
-
Save davidreyburn/1af1d704897bcb9d946e9d063c4fbd8b to your computer and use it in GitHub Desktop.
a simple function in processing which takes a float, uses that as the amplitude of a wave, and returns a smoothly undulating value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float lfo(float amplitude) { | |
float x = sin(theta) * amplitude; | |
theta = theta + 0.01; | |
if (theta > 2 * PI) { | |
theta = 0.0; | |
} | |
return x; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment