Actually, something else I just discovered - it seems that the if(!MIDI.read()) conditional itself is actually interfering with the incoming MIDI somehow. When I repeatedly play a single note on the keyboard, occasionally a MIDI message will get missed, say roughly 1 out of 5. With the "shown" boolean added in, at least 4 out of 5 are missed (usually more). Yet when FastLED.show() function is called on its own without a conditional, every note on/off message gets received no problem.
At this point, I'm not which problem I should be solving then - it seems like there are two different options to explore:
- All MIDI messages are received, but there is a perceptible delay in displaying simultaneous notes - I would need to figure out how to eliminate the delay.
- There is less perceptible delay with the conditional, but then MIDI messages are frequently missed - I'd need to figure out how to stop messages from getting dropped.
I'm not sure which would be easier to troubleshoot. One thing I don't understand is, why would having if(!MIDI.read()) around the show function cause missed MIDI messages?