I'm using MIDI.js to build a music app that allows users to play piano through their keyboard. Everything is working, but the problem I'm having is that the notes (called with MIDI.noteOn) only last 3 seconds, then just cut off. I'm trying to find a way to: 1- Make the note last for longer. 2- Make the note fade to nothing as opposed to just cutting off.
Could anyone point me in the right direction with there? There is so little documentation & discussion on MIDI.js.
Thanks in advance!
EDIT: The instrument name is acoustic_grand_piano
In theory, you need to call
noteOff
at the proper time.In practice, MIDI.Plugin.js has this: