Closed mobeets closed 8 years ago
Ah, it's the ProgramChangeEvent
:
midi.ProgramChangeEvent(tick=0, channel=11, data=[33])
And the channel apparently doesn't matter unless it's 10, which is reserved for percussion.
(Got it from here, along with a list of instrument patch numbers.)
Well it's all going to depend on what device you're communicating with. You're correct that those are the program numbers for the main bank of General MIDI (for GM-compatible devices and programs), but beyond that there are few guarantees unless you know you're operating within a standard. For example, a lot of devices might actually be using the "drum kit bank" rather than channel 10 to define percussive sounds. (See Wikipedia:General MIDI Level 2 for some info on that and other extensions to the spec.) You also might have channels hard-set to different devices and never actually observe what program/bank those devices are running, so channels would be your only cue about instrument selection.
But yes, for the majority of cases they will use the GM format. It just isn't guaranteed, which is one reason I suspect the maintainer didn't build the names in.
This is ignorance on my part and not an "issue" really, but how can I tell which instrument a track is defined as? I suspect it might be somehow in the
ControlChangeEvent
, but I'm not sure exactly. Thanks for your help.