简体   繁体   中英

How to access and change Pygame.midi?

I'm using Pygame.midi and you can select from 127 instruments.

I want to know how I can change/add midi instruments to this list.

Is there a list of pygame.midi instruments anywhere and if not what libraries is pygame using to actually do midi?

I've seen something called PortMidi and I'm wondering if this is what Pygame is using.

I just want to know how I can access pygame.midi and add instruments.

Pygame is not providing the instruments. It's just sending MIDI commands to your system's built-in synthesizer, usually part of your sound card. MIDI allows for 127 instruments at a time. There is a standard called "General MIDI" that tries to define a baseline of 127 instruments, and that's probably what your system is using.

You use "sysex" (system exclusive) messages to tell the synthesizer to change the instrument-to-channel assignments. pygame supports that with the write_sys_ex command, but you have to know the internals of your synthesizer to know which commands to send.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM