简体   繁体   English

如何访问和更改Pygame.midi?

[英]How to access and change Pygame.midi?

I'm using Pygame.midi and you can select from 127 instruments.我正在使用 Pygame.midi,您可以从 127 个仪器中使用 select。

I want to know how I can change/add midi instruments to this list.我想知道如何将 MIDI 乐器更改/添加到此列表中。

Is there a list of pygame.midi instruments anywhere and if not what libraries is pygame using to actually do midi?是否有 pygame.midi 乐器的列表,如果没有,pygame 使用哪些库来实际做 midi?

I've seen something called PortMidi and I'm wondering if this is what Pygame is using.我见过一个叫做 PortMidi 的东西,我想知道这是否是 Pygame 正在使用的东西。

I just want to know how I can access pygame.midi and add instruments.我只想知道如何访问 pygame.midi 并添加仪器。

Pygame is not providing the instruments. Pygame 不提供仪器。 It's just sending MIDI commands to your system's built-in synthesizer, usually part of your sound card.它只是将 MIDI 命令发送到系统的内置合成器,通常是声卡的一部分。 MIDI allows for 127 instruments at a time. MIDI 一次允许 127 种乐器。 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.有一个名为“General MIDI”的标准试图定义 127 种乐器的基线,这可能就是您的系统正在使用的。

You use "sysex" (system exclusive) messages to tell the synthesizer to change the instrument-to-channel assignments.您使用“sysex”(系统专有)消息来告诉合成器更改乐器到通道的分配。 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. pygame 支持write_sys_ex命令,但您必须了解合成器的内部结构才能知道要发送哪些命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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