I am relatively new to Arduino and I am looking to implement a simple system that uses a MIDI keyboard to
(i) detect key presses (via MIDI messages) from the keyboard
(ii) store the information of the MIDI messages (note pressed, velocity)
(iii) Light up LEDS on the keyboard based on what key was pressed
I am currently in the planning stage and I am considering using an Arduino Mega. I have two issues I am not sure about:
(i) My keyboard only has a Male USB A to Male USB B connection with the former connecting to the computer and the latter to the keyboard. So far in my search, I have seen that all Arduino-MIDI projects require a 5 pin MIDI cable to interface with the Arduino using the circuit in this webpage (https://www.instructables.com/id/Send-and-Receive-MIDI-with-Arduino/). Is there any way to detect MIDI messages that does not require the additional circuit and just uses the USB cable?
(ii) Although in theory control of the LEDs should be easy in the program, I am concerned that the delays in the serial communication and hardware interrupts would make it difficult to simultaneously receive the MIDI messages and control the LEDs.
One way I thought of avoiding these problems is to use MATLAB MIDI package (https://uk.mathworks.com/help/audio/ug/midi-device-interface.html#mw_80dc54f4-867c-43c0-a159-e56ee62ec4ab) to interface with the MIDI device and use the MATLAB Arduino package to control the Arduino. I am not sure, however, if MATLAB is suboptimal compared to the standard Arduino IDE.
This is my first question in Arduino StackExchange (or any StackExchange site), so I appreciate the answers and feedback on my question.