简体   繁体   中英

How do I send Meta Messages that has more than 3 bytes data with Pygame.midi?

I'm trying to send Meta Messages has more than 3 bytes data. But an error is appeared.

Too many data bytes (8) in event no. 0.

It's because pygame.midi write method can send data till 3 bytes.

Is it impossible?

i use python 2.7, pygame 1.9.4 and OSX 10.13.6(High Sierra)

根据源文件 ,您的消息字符串的长度超过了允许的最大长度4 (8> 4)

Write is used only for channel messages.

To output SysEx messages, use WriteSysEx :

out.WriteSysEx(0, '\\xF0\\x7D\\x10\\x11\\x12\\x13\\xF7')
out.WriteSysEx(0, [0xF0, 0x7D, 0x10, 0x11, 0x12, 0x13, 0xF7])

Meta messages are not MIDI messages, and are never sent over MIDI. Your program itself has to handle them.

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