xxxxxxxxxx
24
let pianos = [];
function preload(){
for(let i = 0; i < 10; i++) {
pianos.push(loadSound('humming-galuppi.m4a'))
}
}
function setup() {
createCanvas(400, 400);
textAlign(CENTER, CENTER);
}
function draw() {
background(220);
text('Click here to start new voice.', width/2, height/2)
}
function mousePressed(){
let randomPiano = random(pianos);
let randomTime = random(randomPiano.duration());
randomPiano.jump(randomTime);
randomPiano.play();
}