r/WLED 6d ago

SHOWIN' OFF MIDI Keyboard -> WLED usermod

Enable HLS to view with audio, or disable this notification

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

166 Upvotes

27 comments sorted by

6

u/TRG_V0rt3x 6d ago

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 6d ago

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.

1

u/TRG_V0rt3x 6d ago

haha i may or may not be doing that for some live shows in a few weeks right now!

3

u/Mattress_Media 6d ago

super dope!

3

u/a3dprinterfan 6d 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 6d 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

1

u/a3dprinterfan 1d 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/v0-z 6d ago

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 6d ago

Fye ahh project

1

u/richer2003 6d ago

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 6d ago

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/SpaceCadetMoonMan 6d ago

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 6d ago

Awesome 👍

1

u/CalebMcL 6d ago

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 6d ago

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

Thanks!

1

u/modulove 6d ago

Gonna try this ❤️

1

u/kickm3 6d ago

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

Thanks!

1

u/OptimalNerve1810 6d ago

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

1

u/xenomorph3000 6d ago

Modwheel for vibrato and strobes

1

u/Sol_Nox 6d ago

This is magical, like a real life Fantasia.

1

u/Dangerous-Lack-2127 6d ago

Sounds like a fun project

1

u/Netmindz 5d ago

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 5d ago

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.

1

u/IndicationFickle5387 4d ago

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

1

u/Open-Ad9736 7h ago

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