Open zstolfi opened 7 years ago
loadSound()
You can draw the keyboard with P5.JS. Then you can import the key sounds with loadSound()
. Here is some example code for loadSound()
:
function preload() {
mySound = loadSound('assets/doorbell.mp3');
}
function setup() {
mySound.setVolume(0.1);
mySound.play();
}
Not sure if anyone has suggested this topic before but here it is in case it hasn't. The piano should use equal temperament tuning (this) where each note is multiplied by the twelfth root of 2 to get a half step up. Also an A is at 440 hertz.