original example by Karsten Schmidt
Toxiclibs ported to js by Kyle Phillips

Usage:
move mouse to rotate view, click to regenerate 2 random waves.

AdditiveWaves demo is showing how to add 2 randomly chosen waveforms to create a 3D terrain. One wave is moving along the X axis and is mapped to the red color channel, the other is propagating along Y and is mapped to blue. In this demo each wave's frequency is modulated by a secondary wave (here hardcoded as sine wave). Three of the possible waveforms chosen have additional options/special behaviour:

- AMFMSineWave also modulates the wave's overall amplitude on top of frequency modulation
- FMHarmonicSquareWave's shape can tweaked by adjusting the number of harmonics used (the higher the more square-like the wave becomes).
- ConstantWave is simply representing a fixed value

Currently available wave forms are:

- SineWave, FMSineWave, AMFMSineWave
- FMTriangleWave
- FMSawtoothWave
- FMSquareWave, FMHarmonicSquareWave
- ConstantWave

For a demonstration how to use these wave generators as oscillators to synthesize audio samples, please have a look at the toxiclibs audioutils sub-package which is being distributed separately.

You can also create entirely new waveforms by subclassing the parent AbstractWave type and overwriting the update() method.