xxxxxxxxxx
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
background(220);
}
function mouseClicked() {
P5tCube.connectNewP5tCube().then( cube => {
// Play sequence C-D-E
cube.playMelody( [
{ note: 0x3C, duration: 0x1E },
{ note: 0x3E, duration: 0x1E },
{ note: 0x40, duration: 0x1E }
] );
} );
}