3450| 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); } 这是上面的示例程序 |
© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed