soundcloud/waveformjs — pull request #5 by ccoenen (2012-11-08 14:04:37+00:00)
Title: Interpolation will add up over time.

We are using your script in a case, where we need to scale and redraw the waveform a few times. Over time, the waveform will lose all it's definition. The local variable `data` will be overwritten and is itself source for the next iterations. Think of the effect as down- and upscaling images repeatedly. It's basically the same.

The supplied patch fixes this behaviour. We store the original JSON in `data`, every interpolation or cropping thereof will be stored in `drawData`. Drawing reads from `drawData`. This way, you'll always have the unscaled, original data in the waveform-object. This is also neat if you'd like to use that data for other purposes.