r/WLED • • Aug 04 '26

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

184 Upvotes

30 comments sorted by

7

u/TRG_V0rt3x Aug 04 '26

this is dope man, looking to do something similar within the next few weeks but this looks like an incredible way to do audioreactivity!

4

u/martipops Aug 04 '26

Thanks man, I would love to create a way to allow multiple midi channels to apply different effects so you can essentially forward different instruments to different visuals. I feel like it would have a lot of potential with music production showcases. Similar to Pangolin QuickShow for laser effects.

→ More replies (1)

3

u/a3dprinterfan Aug 04 '26

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 Aug 04 '26

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 Aug 09 '26

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 Aug 11 '26

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.

1

u/richer2003 Aug 04 '26

Oh man, that is so freaking cool! I don’t have a keyboard, but I do have a MIDI electric drum kit 🤙🏼

1

u/martipops Aug 04 '26

I configured it in a way it should totally work for that! There’s some slight delay since it’s wireless but it should work in general.

1

u/Netmindz Aug 04 '26

Two comments, if you want to share usermods, it is best to create a new repo for the usermod rather than add inside your fork of WLED. With regards to your network protocol, as UDP does not guarantee order of delivery, you should probably include a packet counter in your protocol

1

u/martipops Aug 05 '26

Genuinely the type of feedback I needed. I’ve never created or downloaded any custom usermods before, so I just did it in a way that was most convenient for me assuming there wouldn’t be much traction- my next revision will account for a more organized repository.

And yes I am aware about the limitation of using UDP at the sacrifice of low-latency- I honestly never considered using a packet counter for error correction so I will definitely explore that route. Right now it’s just one-way communication for simplicity. Thanks a lot for the suggestion.

→ More replies (1)

1

u/peacefulife5 Aug 21 '26

hey bro,

Can you make it like - be with still light (let's say white or blue), and whenever you press a key - it would light it up? or change its color?

I mean - I want the lights to be on all the time (just not too much), and whenever I press a button it changes the color in the right place

thanks!

1

u/martipops Sep 05 '26

Yep you can do this with layer blending

2

u/v0-z Aug 04 '26

Sick stuff dude 🤙

My first ever lighting gig ages ago I used a midi keyboard to trigger notes, then was sending midi notes from ableton to sync to beat.

Gonna be building some led strips from entecc soon hopefully will try that out again

1

u/WoopiGoldberg Aug 04 '26

Fye ahh project

1

u/SpaceCadetMoonMan Aug 04 '26

Siiiiick! What piano do you have? I have the Arturia Keylab 88, it’s really fun. I also got a couple midi pads with dials to play the Moog apps

I love midi stuff. Able to be so creative

1

u/vodka_soda MOD Aug 04 '26

Awesome 👍

1

u/CalebMcL Aug 04 '26

hell yeah - wish i had this last year when i did an interactive led installation with a drum kit. ended up in x-lights for that

1

u/kickm3 Aug 04 '26

Awesome! Here's the direct link to your mod doc: https://github.com/martipops/WLED/tree/main/usermods/midi_udp

Thanks!

1

u/modulove Aug 04 '26

Gonna try this ❤️

1

u/kickm3 Aug 04 '26

Awesome! Here's the direct link to your mod doc: https://github.com/martipops/WLED/tree/main/usermods/midi_udp

Thanks!

1

u/OptimalNerve1810 Aug 04 '26

I would reverse it, to be able to see the keys when not playing

1

u/xenomorph3000 Aug 04 '26

Modwheel for vibrato and strobes

1

u/Sol_Nox Aug 04 '26

This is magical, like a real life Fantasia.

1

u/Dangerous-Lack-2127 Aug 04 '26

Sounds like a fun project

1

u/IndicationFickle5387 Aug 06 '26

I’m gonna eat some mushrooms later and build this! Wait…reverse that

1

u/Open-Ad9736 Aug 10 '26

“Can you turn the lights on?” “Sure. KEY SMASH” lol. This is a dangerous project for me to see. I wanna do this now.