abcjs icon indicating copy to clipboard operation
abcjs copied to clipboard

How to play through MIDIOutput

Open holden321 opened this issue 2 years ago • 1 comments

Is it possible somehow to play music through MIDIOutput?

https://developer.mozilla.org/en-US/docs/Web/API/MIDIOutput

holden321 avatar Jan 19 '23 21:01 holden321

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.

paulrosen avatar Jan 21 '23 14:01 paulrosen