Fun With Sinus Waves (More Organic Waves)

121 views
Skip to first unread message

Mathieu

unread,
Feb 2, 2016, 11:32:50 AM2/2/16
to Lightjams
Maybe you've already used the organic function? I'll show you how to create your own.

Start by trying this formula for the power of your source:

sin(0.02*cos(10)+0.2)

What you get is a sinus wave with a varying speed. It goes from 0.2 second to 2.2 seconds. The sin function takes as an argument the time it takes to do one cycle (the period). So the trick to get funny results is to use another function (cos in this case) to change the period dynamically. Since the outputs of the sin and cos functions range from 0 to 100, this is why 0.02 * cos(10) + 0.2 has a minimum of 0.2 and a maximum of 2.2.


Next, replace the 10 in the cos function by 0.02*cos(10)+0.2:

sin(0.02*cos(0.02*cos(10)+0.2)+0.2)

As you can see, we can get very wild results pretty quick :)


Another thing to know is that you can add multiple waves together. Just make sure to change the period of the waves you're adding:

0.5*sin(0.02*cos(10)+0.2) + 0.5*sin(0.02*cos(33)+0.2)


And you can continue adding more waves:

0.4*sin(0.02*cos(10)+0.2) + 0.4*sin(0.02*cos(33)+0.2) + 0.2*sin(0.02*cos(48)+0.2)


From there, feel free exploring:

sin(scale(cos(3)*sin(5)*sin(34), 0, 100*100*100, 0.5, 10))


And eventually, you'll find good formulas like this one:

0.4*sin(0.02*cos(10)+0.2) + 0.3*sin(0.02*cos(33)+0.2) + 0.3*sin(scale(cos(3)*sin(5)*sin(34), 0, 100*100*100, 0.5, 10))


One last trick, you can use inputs like the music intensity to dynamically change the wave period. For example, to generate a fast wave when the music is loud and a slow wave when it's quiet:

sin(20/max(1,music.1.avg)+0.2)


Have fun!

 
Reply all
Reply to author
Forward
0 new messages