Wireless Midi using nrf24l01 modules

I am working on a project using two Arduino Pro Micros and two nrf24l01 modules along with the corresponding hardware to accept MIDI input for the transmitter and MIDI output for the receiver. I will attach the schematics below.

The issue is that I can get it working for slow single key presses, however when I try to play multiple keys at once, the message is either incorrect or not received. I believe I need to create some sort of error checking and resending method to ensure the correct bytes are received. I know this is somewhat built in to the RF24 library, however I can’t seem to find a useful guide on how to use the appropriate functions. I will attach my code below.

Any help is greatly appreciated. Thank you.

TRANSMITTER_MIDI.ino (1.24 KB)

RECEIVER_PRO_MICRO.ino (777 Bytes)

Not sure if this fixes your problem, but you check if there's one byte available, and then go on and read 3. Change if (radio.available()) to if (radio.available() >= 3).

void loop() {
  if (radio.available() >= 3) {
    radio.read(&incoming, 3);   // Read the incoming message and store in array
    swSerial.write(incoming,3); // Send message through hardware MIDI port
  }
}

That being said, using the MIDI library seems completely unnecessary. It's just reading serial data, parsing it, and sending the same exact serial data over the RF link, converting it back to the same serial signal.

Also, don't use SoftwareSerial for the MIDI, you have a harware UART, so use it.

Pieter