soundfont-player
soundfont-player copied to clipboard
How to play a note and specify its velocity?
I agree that this would be a nice feature, especially since I did not find any way to implement this with oscillators or other libraries.
Passing velocity to the gain option seems to work e.g.
let envelope = tone.play(
note,
when,
{
gain: velocity,
sustain: 3.5,
})