soundfont-player icon indicating copy to clipboard operation
soundfont-player copied to clipboard

instrument.play() works, how do I turn a note off?

Open fornof opened this issue 6 years ago • 1 comments

How do I turn a note off or set the duration of the note? for notes on: piano.play(event.noteName, ac.currentTime, {gain:event.velocity/5}); I have a midi off event, I would like to turn the note off I tried piano.stop(event.noteName, ac.currentTime, {}); but this obviously doesn't work. Any suggestions would be appreciated. Thanks for your help.

fornof avatar Apr 21 '18 17:04 fornof

This library uses sample-player:

const note = piano.play(...);
note.stop();

Hope it helps

danigb avatar Apr 21 '18 18:04 danigb