2858浏览
查看: 2858|回复: 2

[求助] Arduino做midi键盘出现问题

[复制链接]
Arduino做的midi键盘,然后用loopmidi来生成port口,然后再用hairlessMidi来转换,但是出现问题,求大神解决!

+0.89 - Warning: got a status byte when we were expecting 1 more data bytes, sending possibly incomplete MIDI message 0x80


可能是串口的收发不稳定?


void setup() {
  // Set MIDI baud rate:
  Serial.begin(31250);
}

void loop() {
  // play notes from F#-0 (0x1E) to F#-5 (0x5A):

    //Note on channel 1 (0x90), some note value (note), middle velocity (0x45):
    noteOn(0x90, 0x3C, 0x45);
    delay(100);
    //Note on channel 1 (0x90), some note value (note), silent velocity (0x00):
    noteOn(0x90, 0x3C, 0x00);
    delay(100);
    Serial.write(cmd, ,pitch, ,velocity);
}

// plays a MIDI note. Doesn't check to see that cmd is greater than 127, or that
// data values are less than 127:
void noteOn(int cmd, int pitch, int velocity) {
  Serial.write(cmd);

  Serial.write(pitch);

  Serial.write(velocity);
}
这是上面的示例程序

帅猫  高级技师

发表于 2020-5-3 17:56:06

Arduino只有ATMega32U4,ATMega8U4(如Pro mini,Pro micro,Leonardo)才支持USB MIDI哦
回复

使用道具 举报

gada888  版主

发表于 2020-5-16 18:20:47

arduino leonardo性价比高
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

为本项目制作心愿单
购买心愿单
心愿单 编辑
[[wsData.name]]

硬件清单

  • [[d.name]]
btnicon
我也要做!
点击进入购买页面
上海智位机器人股份有限公司 沪ICP备09038501号-4

© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed

mail