submission by jtoy for fast fourier transforms - playing with sound (View the other submissions)
var fft,mic;
function setup(){
  var myCanvas = createCanvas(800,800); 
  fft = new p5.FFT();
  ellipse(400,400,50,50)
  colorMode(HSB,100)
  spectrums=[]
  mic = new p5.AudioIn();
  mic.start();
  fft = new p5.FFT();
  fft.setInput(mic);
}

function draw() {
  background(255)
  s = fft.analyze(16)
 for(si=0;si<s.length;si++){
   fill(s[si]%100,100,100)
  rect(si*10,0,si*10,s[si]) 
 }
 spectrums.push(s.splice(0))
  if(spectrums.length > 5){
    spectrums.splice(-1,1)
  }
  console.log(spectrums[0][0]) //this prints 0 always
for(si=0;si<spectrums[0].length;si++){
   fill(spectrums[0][si]%100,100,100)
  rect(si*10,400,si*10,spectrums[0][si]) 
 }
}