Can ESP32 translate incoming midi notes (usb) to data output? (LED on/off & brightness)

Phrenetik
Posts: 3
Joined: Sun Dec 31, 2023 6:05 pm

Can ESP32 translate incoming midi notes (usb) to data output? (LED on/off & brightness)

Postby Phrenetik » Mon Aug 12, 2024 12:43 am

Hi, I hope this is the correct forum for this question. I've searched for days, not finding specific answers yet.

My project is to send midi notes & velocity data from my E-drum sound module, via USB, into a MCU, that will then translate those notes/velocity into on/off/brightness for UV LEDs I have installed in the drum shells. I need latency as low as possible, and I need to control 10 different LED units (1 for each drum), 4 of which are UV spotlights that don't have a data input (so I plan to use a relay for on/off signal from the MCU). This means I need at least 5 data pins outgoing, possibly as many as 10.

My limited experience in MCU has been using ESP32's to run LED effects (WLED) in my studio lighting. So I am hoping to use some of the ESP32-wroom units I have lying about. But i've seen mentions that only S2 or S3 boards can run usb/midi, and i believe these wrooms are S1...not sure.

So, is there a way to do this, perhaps thru a ESP32-s3 with hairless midi or ?
Or should I ditch the ESPs and use a Teensy 3.6 or Arduino Nano33 BLE/Micro/Due or Pi Pico? Trying to keep costs down, but I can upgrade if it means a quality result.

Thanks for any tech advice, and if there's a better forum I should move this to, please lmk.
- another noob-in-need

djixon
Posts: 113
Joined: Sun Oct 01, 2023 7:48 pm

Re: Can ESP32 translate incoming midi notes (usb) to data output? (LED on/off & brightness)

Postby djixon » Fri Aug 16, 2024 11:31 am

Well, there are potentialy 2 issues with that.
1. USB output from your drum module can (or can not) be fully MIDI compatibile. If it requires any kind of drivers for example on windows PC to allow PC receives midi events (note ON/OFF, velocities events etc) then similar kind of driver code would be needed on MCU
2. Latencies under 1 ms can be achieved only if your MCU USB MIDI driver code is properly written (requires some with MCU coding experiance because by MIDI 1.0 standard definition, 3 MIDI messages sent in sequence last longer than 1 ms. So if your drum module sends Note ON + Note Vel + Note Off that sequence last longer than 1 ms and your custom driver must react on first NoteOn message after which it will send ie. RESET signal to LED strip followed with some representation of velocity ..... by other words your LED driver and MIDI driver must work interleaved. Solutions where MIDI messages are buffered, then buffer processed and sent to LED driver will introduce latencies usually above 10 ms)

Also you didn't specify if your drum module is MIDI 2.0 or MIDI 1.0 device. (MIDI 2.0 standard is established in 2020 while MIDI 1.0 exists for more than 40 years) Even compatibility is preserved (ver 2.0 is compatibile with 1.0) signals on 2.0 are completely different and utilize extremelly high frequencies for data transmition.

My suggestion would be:
1. Buy some hardware USB MIDI -> SERIAL aadapter (or, if your drum module is already equiped with that 5 pin DIN (circled) MIDI connector then buy DIN MIDI -> SERIAL adapter)
2. Use UART module on MCU to READ/WRITE MIDI messages
3. You can write UART receive interrupt routine to do what you need, ie controlling LED strip or whatever

Who is online

Users browsing this forum: Niyazuddin and 50 guests