abcjs
abcjs copied to clipboard
How to play through MIDIOutput
Is it possible somehow to play music through MIDIOutput?
https://developer.mozilla.org/en-US/docs/Web/API/MIDIOutput
There is a hook that you can use - see https://paulrosen.github.io/abcjs/audio/synthesized-sound.html#load-selector-cursorcontrol-visualoptions and look for sequenceCallback. That will give you the set of commands that will be used for output. You could take that and write an adapter to go to the midi output.
If you do that, I'd love if you'd contribute that back! I'll put in a new parameter so that it is built in.
Another possibility is that you can call ABCJS.synth.getMidiFile() and send that to the midi output. I'm guessing there is a library that does that.