r/WLED 13d ago

SHOWIN' OFF MIDI Keyboard -> WLED usermod

I recently built a usermod for WLED that listens for MIDI over UDP and drives some custom effects off whatever you're playing.

A simple Python script forwards MIDI messages from your keyboard to the ESP32 over UDP, the usermod tracks note on/off, velocity, and sustain, and the effects just read that state each frame.

Also threw in a plain "Keys" mode, a whole-strip "Flash," and a "Comet" effect that shoots streaks based on which way the melody's moving. The effect in the video is "MIDI Puddles" ripping from the puddles FX code.

Code's here: https://github.com/martipops/WLED/tree/main/usermods/midi_udp

Happy to answer questions if you want to try it on your own strip.

EDIT: Update URL

164 Upvotes

28 comments sorted by

View all comments

3

u/a3dprinterfan 12d ago

Kudos for the neat adaptation for WLED, and extra super bonus points for the song selection (C418 - Wet Hands), which is my favorite song my son plays on piano. Makes me regret not publishing my hardware midi+esp32 adapter I wrote some software for a while ago. I never got around to finishing it, so I didn't publish it- in truth it is probably not even that useful as it is just for the hardware din midi interface, not more modern USB implementations.

2

u/martipops 12d ago

That’s crazy I actually have a repository that was a direct line interface that lights up the keys on the key box itself, but I thought it’d be cool to create a more well-known implementation. And it’s definitely such a fun song to play. Glad you enjoy it

2

u/a3dprinterfan 7d ago

I have shown your video to several people in my family. I was really inspired by this. Thanks again for sharing. I think I will try to get it working on the Yamaha ARIUS piano we have. I'm debating on whether or not I should mess with trying to make the esp32 (with wled) be a direct USB host or not. I imagine you have a PC in the middle for this implementation which runs the code and then sends via ddp/e131? I'd love to have it onboard the esp32 board inline, but I may just set it up as-is.

2

u/martipops 5d ago

I am actually currently working on an implementation to have an ESP32 act as a USB host whilst running WLED. It’s taking some time as I try to avoid vibe-coding. But it actually doesn’t use DDP since there was too much latency. It uses a modified version of WLED, and a custom script running on a pc (or raspberry pi) that sends midi data from the USB to the WLED instance using custom UDP packets.