p = play the song, s = stop the song, right arrow = speed it up, left arrow = slow it down, 1,2, and 3 buttons = different parts of the song
xxxxxxxxxx
let session32;
let session32_rate = 1;
function preload(){
session32 = loadSound("session32.mp3");
}
function setup() {
createCanvas(500, 500);
background(138,62,123)
session32.play();
}
function draw(){
session32.rate(session32_rate);
}
function keyPressed(){
if (key == 'p'){
session32.play();
}
if (key == 's'){
session32.stop();
}
if (keyCode == LEFT_ARROW){ //speed down
session32_rate -=0.20;
}
if (keyCode == RIGHT_ARROW){ //slow up
session32_rate +=0.20;
}
if (key == '1'){
session32.jump (10)
}
if (key == '2'){
session32.jump (30)
}
if (key == '3'){
session32.jump (70)
}
}