Page 1 of 1

MIDI Shield is missing notes, playing ghost notes

Posted: Fri Apr 05, 2019 7:13 pm
by blender
hey there
i am messing around with the midi shield. while basic functions work just fine i am having issues i think stemming from the serial TX baud rates.

running th sparkfun midi monitor i actually see how the incoming midi data is skipping a lot of note offs, not ons too, probably CC and everything else too. only when i play a couple notes at the same time. so it seems to be a timing issues to me. midi controller & cable are definately 100% ok.
also when playing a lot of notes i sometimes get random ghost notes that get stuck without a note off. these notes sometimes even were out of the note range of my controller so definately not coming form there.

so yeah i suspect a serial comm issue. or could sloppy soldering be the cause? i don't have the shield wrapped on the arduino with all pins, just VCC,GND, RST, TX/RX pins and SCL/SCA/AREF for good measure.


i tried several baud rate settings both for SoftSerial and opening the HW Serial which is used for monitor debugging. also tried the 32150 MIDI baud rate. no success.

i tried using the hardware TX ports instead as iirc they are able to run at much higher baud rates. but couldn't get the demo codes to run on the HW pins. i assume that might have to do with the bootloader/RUN/PRG switch which also is confusing.

every now and then after resetting and recompiling it was running perfectly smooth for a couple minutes just to start missing and adding notes out of nowhere again.

any ideas?

Re: MIDI Shield is missing notes, playing ghost notes

Posted: Sat Apr 06, 2019 5:40 am
by blender
fwiw i finally managed to get it running on the hardware serial ports insterad and it seems fine for now. i think it was an issue with the software serial missing some bits due to wrong baud rates or just being too slow.

Re: MIDI Shield is missing notes, playing ghost notes

Posted: Mon Apr 08, 2019 9:08 am
by TS-Mark
Hi blender,

That's great to hear you were able to pinpoint the cause of the issue. SoftwareSerial is a great library for a lot of applications but as you have seen here, it does have some limitations when it comes to high-speed communication as well as some hardware compatibility issues. The AltSoftSerial Library is a good, "upgraded" version of the SoftwareSerial library but it does have its own limitations compared to the HW-UART.

You should have no issues using the HW-UART port on the MIDI Shield but just in case you end up adding other things to the circuit on that UART, it is a good practice to disconnect the shield or move the switch to the SW-UART position to avoid corrupting the firmware of any devices on that bus during programming/serial communication. The MIDI Shield does not have anything on it that can be affected by that, though.

If you have any other questions or issues with your MIDI Shield, please reply to this post and we would be happy to help as much as we can.