I'm following the basic steps on the README, but when I play a tone I hear a low, rumbling sound instead of piano samples. I installed toneHere's my entire JS file:
import { Piano } from '@tonejs/piano';
document.getElementById('play-button').addEventListener('click', function() {
const piano = new Piano({
velocities : 5,
}).toDestination();
piano.load().then(() => {
piano.keyDown('C4', '+1');
});
});
What am I doing wrong? I noticed that the code in the example folder passes the path to 'samples'. Not sure if I need to be passing that value as well. I looked in the @tonejs/piano folder inside node_modules/ and I didn't see any audio files. How are the samples being installed?
I think the API has changed a bit- you have to supply a js object to piano.keyDown() with the proper keys. Eg. piano.keyDown({note: "F5"})
Samples are loaded from https://tambien.github.io/ unless you supply a url.
I'm following the basic steps on the README, but when I play a tone I hear a low, rumbling sound instead of piano samples. I installed toneHere's my entire JS file:
Here's my package.json for reference:
What am I doing wrong? I noticed that the code in the example folder passes the path to 'samples'. Not sure if I need to be passing that value as well. I looked in the @tonejs/piano folder inside node_modules/ and I didn't see any audio files. How are the samples being installed?