Last active
August 5, 2016 23:41
-
-
Save jahpd/f7ebcc2c499d7d64576d2192277b73ef to your computer and use it in GitHub Desktop.
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
# A global variable | |
sound = {} | |
# Like processing | |
# we can setup the things | |
@setup = -> | |
sound.freq = [Math.random() * 22, 22+Math.random() * 220] | |
sound.offset = [Math.random(), Math.random()] | |
# tau ant t are preloaded variables, | |
# tau is equal to 2 * Math.PI | |
# t is the current sample in seconds | |
@dsp = -> | |
i = 0 | |
for freq in sound.freq | |
s = perlin1D(sin, freq, sin(freq,0.71), sound.offset[i]) | |
sound.offset[i] += 0.00001 | |
i += 1 | |
s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment