简体   繁体   English

尝试发送控制更改消息时,无效的MIDI消息数据

[英]Invalid MIDI message Data when I'm trying to send Control Change Messages

I'm using pygame.midi library to send MIDI Messages (Control Change messages, not notes). 我正在使用pygame.midi库发送MIDI消息(控制更改消息,而不是音符)。 The idea is to send from the output (from this python program) to the input of another program. 这个想法是从输出(从这个python程序)发送到另一个程序的输入。

>>> import time
>>> import pygame.midi as midi
>>> midiout = midi.Output(3)
>>> midi.init()
>>> midiout = midi.Output(3)
>>> midiout.write_short(0x74,124,0)
PortMidi call failed...
  PortMidi: `Invalid MIDI message Data'
type ENTER...

As you can see, i'm sending 0x74,124,0. 如您所见,我正在发送0x74,124,0。 I'm taking those numbers from rakarrack (the application that i want to control) implementation chart: http://rakarrack.sourceforge.net/midiic.html 我从rakarrack(我要控制的应用程序)实现图表中获取这些数字: http ://rakarrack.sourceforge.net/midiic.html

What am I doing wrong? 我究竟做错了什么?

MIDI status bytes (the first byte of the message) must have the high (0x80) bit set. MIDI状态字节(消息的第一个字节)必须设置高(0x80)位。 the linked chart is a bit confusing, but I'm guessing 0x74 is a data byte and must be preceded by the proper status byte. 链接的图表有点混乱,但是我猜0x74是一个数据字节,必须在其前面加上正确的状态字节。

>>> import pygame.midi as midi
>>> midi.init()
>>> midiout = midi.Output(0)
>>> midiout.write_short(0xb0, 0x74, 124)

some basic MIDI documentation: http://www.midi.org/techspecs/midimessages.php 一些基本的MIDI文档: http : //www.midi.org/techspecs/midimessages.php

control change is 0xbn, where n is the channel number, so 0xb0 is a control change message for channel 0. 控制更改是0xbn,其中n是通道号,因此0xb0是通道0的控制更改消息。

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

相关问题 如何使用Pygame.midi发送具有3个字节以上数据的元消息? - How do I send Meta Messages that has more than 3 bytes data with Pygame.midi? 我正在尝试创建 function,当有人在消息上发送链接时,它将被删除 - I'm trying to create function, when somebody will send link on message, it will be deleted 如何将 Midi 消息发送到 python 中的 midi controller - How to send Midi messages to a midi controller in python 如何从 Ableton Live 控制界面脚本向我的 Arduino 板发送 MIDI 数据 - How do I send MIDI data to my Arduino board from Ableton Live control surface script 我无法发送消息 - I'm not able to send message 如何使用pygame midi发送NRPN消息 - How to send NRPN messages with pygame midi 我正在尝试使用 Selenium 将 integer 输入到网站框中,并且在发送键上出现无效语法错误 - I'm trying to input an integer into a website box using Selenium and I'm getting an invalid syntax error on the send keys 我试图让我的 discord 机器人等待用户在执行原始命令后发送另一条消息 - I'm trying to get my discord bot to wait for the user to send another message after they did the original command 我正在尝试让用户回复机器人响应,然后发送另一条消息 - I'm trying to make a user reply to a bot response then send another message pygame midi 读取 PC(程序更改)消息 - pygame midi read PC (program change) messages
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM