The 'Arduino MIDI library' seems to be corrupting MIDI messages which arrive in rapid succession.
I've:
1/ Installed the FortySevenEffects MIDI library V4.3.1.
2/ Loaded the example 'MIDI-sniffer.ino' into the development environment Arduino 1.8.9
3/ Installed the SparkFun MIDI shield onto a 4duino Uno Pro (Uno compatible)
4/ Programmed the Uno Pro with MIDI-sniffer
5/ Connected an M-Audio Radium 49 keyboard to the shield MIDI In
6/ Connected the shield MIDI Out to a generic MIDI-to-USB converter
7/ Set Pocket MIDI (a MIDI message analyser) on my PC to show the incoming MIDI messages from the Arduino
Thus the MIDI message path is (software in italics):
keyboard -> shield -> Uno -> MIDI-sniffer (displaying to serial monitor) -> shield -> MIDI USB converter -> Pocket MIDI (displaying to PC screen)
--> Please note that MIDI-sniffer example program can display messages in hexadecimal form directly from the serial port, or in text form via the MIDI library functions. It also invokes 'thru mode' so it copies incoming messages to the MIDI out connector. <--
When pressing individual keys on the keyboard:
a/ MIDI-sniffer shows the correct hexadecimal and text-form MIDI messages
b/ Pocket MIDI shows the correct hexadecimal messages
c/ Pocket MIDI plays the correct notes on my soundcard's synth.
So, all would seem to work correctly.
HOWEVER:
If I press-and-release two keys simultaneously:
a/ MIDI-sniffer shows the correct hexadecimal messages from the serial port (i.e. two Note On messages in succession), but shows random, incorrect text-form messages
b/ Pocket MIDI shows scrambled hexadecimal messages, and plays random notes
When pressing two keys simultaneously MIDI-sniffer reports various weird messages, including 'Stopping', 'PolyAT', 'PropChange', 'Clock', etc. Usually one key is correctly reported, and the other corrupted.
Pressing the same two keys with two fingers in rapid succession results in correct behaviour - to induce the fault I must use one finger to press the two keys.
It seems as if the MIDI library cannot handle MIDI messages received in rapid succession and corrupts the second one if it arrives too close to the first.
QUESTIONS
Has anyone else noticed this problem? Could it be due to a lack of processing power on the UNO? Is there anything else that could be causing the problem?
All comments, advice and jeering gladly received!
Regards,
Steve