OctoWS2811, FastLED and MIDI limits on speed

adictoetico

Member
I am working on a project that involves LED strips driven by MIDI notes, after a lot of research I came to build it using a teensy 4.0 and OctoWS2811 parallel output for speed, everything works as I intended as long as I press one note at a time, when the stream of MIDI data gets bigger (2 or more concurrent notes, things begin to slow down, and 3, 4 or more notes will crash the code execution). It seems to me my MIDI data starts piling up as the code is not able to flush it to the LEDs fast enough. My main doubt is, I am driving 900 total LEDs, distributed along 6 pins, for 150 per pin, all of the documentation I've seen points to that not being too much for the teensy to handle, but I am still new at this so my code could also be at fault here. I have also considered changing my LEDs from WS2812b to SK9822 for faster LED refresh.
you can find the repository at the following link:


any light that can be shed on this will be appreciated. thanks to this awesome community I have learned a lot from this forum.

the repository includes a video showing the test rig and the speed issue.
 
Last edited:
I have not looked at your actual sketch, but something to consider/try would be to have your MIDI receiver (e.g. handleNoteOn) to just put the received notes into a circular buffer. Then (in your loop() function), have the function responsible for updating the LED strip to read those notes & send them to the LEDs as fast as it can. A generic approach like this should prevent backing up the MIDI receive while the LEDs are updated (assuming that is the problem that you are seeing). Assuming all of this processing can keep up in general, then you might see some slight (visually perceptible ??) delay between the reception of the MIDI note & the reflection in the LED display.

Mark J Culross
KD5RXT
 
thx for the reply. I realized I was drawing the LEDs every time a single pixel was updated in my CRGB array, instead of updating all the pixels first and then drawing the LED. Will check into your suggestion as well
 
Back
Top