submission by jtoy for fast fourier transforms - playing with sound (View the other submissions)
var fft,mic;
function setup(){
  var myCanvas = createCanvas(windowWidth,windowHeight); //you must keep this line unmodified
  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);
  last_time = millis()
}

function draw() {
  background(0,5)
  //noStroke()
  if(millis()-last_time> 50){
      s = fft.analyze(256)
  spectrums.unshift(s)
  if(spectrums.length > 40){
    spectrums.splice(-1,1)
  }
  last_time=millis()
  }
  for(si=spectrums.length-1;si>0;si--){
    push()
    //shearX(-radians(10))
    beginShape()
   // noStroke()
   vertex(si*20,height/2)
  fill(spectrums[si][0]%100,spectrums[si][0]%100,100)
    for(i=0;i<spectrums[si].length;i++){
      v = spectrums[si][i]
      y = height/2-(si*20)
      x = si*20+(i*10)
    //line(i,y,i,y-v)
    //noStroke()
    //  fill(spectrums[si][i]%100,100,100)
      //ellipse(x,y,si*5,-v) 
     vertex(x,y-v)
    }
    endShape()
    pop()
  }
}