xxxxxxxxxx
19
let osc;
function setup() {
createCanvas(400, 400);
osc = new p5.Oscillator();
osc.start();
}
function draw() {
background(220);
let pitch = map(mouseX, 0, width, 200, 800, true);
osc.freq(pitch);
let vol = map(mouseY, 0, height, 0, 1);
osc.amp(vol);
}