xxxxxxxxxx
var angle = 0;
function setup() {
createCanvas(windowWidth, windowHeight);
background(0);
noStroke();
fill(255, 255, 255);
}
function draw() {
background(0, 0, 0);
var frequency = map(mouseX, 0, width, 1, 10)
var amplitude = mouseY/2;
angle += frequency;
var osc = sin(radians(angle)) * amplitude;
var ySin = height/2 + osc;
ellipse(width/2, ySin, 10, 10);
}