xxxxxxxxxx
var song;
var inc = 0.02;
var start = 0;
var col;
function preload(){
song = loadSound("wave.wav");
}
function setup() {
createCanvas(windowWidth, windowHeight);
strokeWeight(10);
song.setVolume(.1);
song.loop();
song.play();
}
function draw() {
background(120);
var col = color(100, 40, 0);
background(song.currentTime()*20, 90, 255);
noFill();
beginShape();
stroke(col);
var xoff = start;
for (var x = 0; x < width; x++){
var y = height/2 + sin(xoff)*height/5;
vertex(x, y);
xoff += inc;
}
start += inc;
endShape();
}