xxxxxxxxxx
26
var offset = 0;
var strum = 10;
function setup() {
createCanvas(1200, 50);
}
function draw() {
background("#FFE1DC");
stroke(1);
noFill();
beginShape();
vertex(0, 100);
for(var x = 0; x < width; x++){
//var angle = map(x, 0, width, 0, TWO_PI);
var angle = offset + x * 0.01;
// map x between 0 and width to 0 and Two Pi
var y = map(sin(angle), -strum, strum,0, 50);
vertex(x, y);
}
vertex(width, height);
endShape();
offset += 0.01;
}