indigodarkwolf / box16

A fork of the official X16 emulator, converted to C++20 and with a bunch of features tweaked and added.
MIT License
41 stars 18 forks source link

Feature Request: Integrate MIDI input with RtMidi #2

Closed indigodarkwolf closed 3 years ago

indigodarkwolf commented 3 years ago

It would be useful to be able to pass MIDI inputs to the sound chips, to help with authoring music for the X16. RtMidi appears to be cross-platform and light on dependencies, so it may be a good fit for use here.

https://github.com/thestk/rtmidi

indigodarkwolf commented 3 years ago

@akumanatt I know I said I'd work on other things, but I wound up getting a start on this. At first it was just meant to be making sure RtMidi compiled in the project, since I was already partway done with that when we discussed it on Discord, but one thing led to another...

It's still in pretty rough shape, basically just a start at conveying the ideas I had. For instance, instead of listing of all the PSG channels (and other potential devices) and then trying to give an option to bind them to MIDI, maybe that should be flipped around to list all of the current MIDI devices and then offer a way to bind them to PSG channels, the YM2151, and eventually some hypothetical user expansion card or something.

Mostly I wanted to prove out that the midi input was working, and that's certainly the case.

indigodarkwolf commented 3 years ago

Also, TIL that my MIDI keyboard doesn't actually do "key off" messages -- it just sends "key on" with a velocity of 0. I wonder how common that is.

indigodarkwolf commented 3 years ago

There's room for iteration, I'm sure, but I've put a prototype of this in with f84755b14780c3ebc8be810fc77069061b7d71d7. Playing with the YM through MIDI is kinda fun.