That worked - it looks like the MIDI was all being received, but by the time it got to the show function, MIDI.read() was not giving it the desired value, and so it wouldn't display anything.
Now all the MIDI messages are getting there, but we're back to the delay issue again - the display timing of the LEDs looks like they're about the same as if it were just the show function by itself. To see if I could maybe force all the MIDI to be stored at once before calling the show function, I tried using "while" instead of "if" for the MIDI input portion:
while (MIDI.read()) {
MIDIread = MIDI.read();
location_byte = MIDI.getType();
channel = MIDI.getChannel();
note = MIDI.getData1();
if (location_byte == midi_on || location_byte == midi_off) newNote = true;
if (newNote) {
if (location_byte == midi_on) {
midiNote[channel][note] = 1;
}
if (location_byte == midi_off) {
midiNote[channel][note] = 0;
}
newNote = false;
}
}
...but it doesn't seem to have any effect. I'm trying to figure out the error in logic here - I'd think that the steps would be:
- Store all incoming MIDI messages
- Update the LEDs based on those messages (i.e. the chunk of "if" statements following the MIDI.read() section)
- Call FastLED.show() once to display update the LEDs all at once.
The only thing I can think of is that maybe the loop is going faster than the MIDI is actually coming in, so the "while" is possibly still only reading one incoming message at a time?
On another note, I realized I unfortunately will not be able to use shown boolean for the more complex wave functions I want to use that require the LEDs to be constantly updated, so that had to be scrapped.