Another little sinewave fix

8 is a good downsample value, downsample is now being Math.floored and
I've added a little debug mode.
waves.length = 0
waves.maxlength = 200
waves.debug = true
Enjoy.