fftSize = 64 b = EDrums('x*o*x*o-') b.amp = .75 fft = FFT( fftSize ) a = Canvas() a.draw = function() { a.clear() var numBars = fftSize / 2, barWidth = ( a.width - 1 ) / numBars, barColor = null, value = null for( var i = 0; i < numBars; i++ ) { barColor = Color({ h:( i / numBars ) * 255, s:255, v:255 }) // read FFT value, which ranges from 0-255, and scale it. value = ( fft[ i ] / 255 ) * a.height*0.5 a.rectangle( i*barWidth, a.height-value, barWidth, value ) a.fill( barColor.rgbString() ) } }