How can I send MIDI messages out from a C++ program and have them play the sound from the General MIDI bank?
I’ve looked around and there doesn’t seem to be a simple answer, and my brain starts to melt after reading long manuals about CoreMIDI and things like that.
I have a simple C++ game/synthesizer project, and all I want to do is, for example, when this ball hits the floor, trigger a C4 from the Grand Piano bank. I’m fine with the majority of the program, but the integral MIDI part has so far been utterly opaque to me.
I’d like to use CoreMIDI, because it seems like it might be simplest, but something multi-platform would be a bonus.
Thank you very much for any help!
Another option would be rtmidi
It’s aimed to be simple and crossplatform
I’ve used the similar rtaudio for realtime audio i/o, and it was relatively easy to use.
You should be able to list all midi devices with the example code, then select the GM bank, and send the appropriate MIDI message (note on/off message), after you select the piano with a program change message. Wikipedia has a helpful page to get started