I am working on an LED system that responds to MIDI from my electric drum kit. I've been trying to get the LEDs to sync with a drum pattern being repeated by a Boss RC-505 looper. Each drum note corresponds to sections of a DotStar LED strip that will be placed underneath the drum heads. My goal is to create a sort of "ghost drummer" effect from the lights following along to the audio.
To do this, I am needing to basically create a simple MIDI looper with my Arduino UNO. This is due to the RC-505 only recording and playing back audio, not MIDI. The looper communicates with my arduino using control changes each time I hit my footpedal to record into the RC-505. In other words, the arduino is receiving two MIDI lines. One for the drum notes and the other for the looper control changes.
To paraphrase how I am coding this, the program operates in either a record or playback state while receiving MIDI from the drums. When the record command comes from the RC-505, incoming note and velocity bytes are stored in an array and the moment in time is stored. When the playback command is received, the array is fed to the LEDs in the correctly timed out sequence.
There are three issues I am encountering with the looping playback:
- Playing too quickly causes the playback to halt until it starts the loop over.
- Playing two or more drums at once only displays one at a time.
- The storage space of the UNO is a major limiting factor.
I am certain that issues 1 and 2 have to do with my approach to this problem. I am using the MIDI library to handle the incoming MIDI from the drums and getting near perfect response from the LEDs. The looping playback likely has no way of being used by the MIDI library with bytes coming from a stored array rather than a serial port. This means the exact timing of the LEDs to the MIDI is up to my subpar coding skills.
Sorry about the wall of text, I want to share as much of my thought process for this project as I can. Here is a Youtube video I uploaded to better illustrate what is happening:
My .ino file is attached since the code is pretty lengthy. There is also a picture of my circuit and the schematic I followed for each MIDI input.
I'm at the end of my rope trying to get the looping to work with this method. I know that there's got to be a better way to accomplish my goal. Any ideas would be greatly appreciated! Thank you.
LED_Drums.ino (4.87 KB)

