Blog

Bridging Music and Light

A MIDI-Controlled LED Piano Project

LED Piano

Image: The LED piano in action.

Combining music with visual elements creates an immersive experience that is more than just auditory. In this vein, my latest project aims to connect an LED strip to a piano, controlled by MIDI signals. This initiative allows the audience not only to listen but also to visually engage with the music.

The System

At the core of the system, we have 144 LEDs mapped onto the 88 keys of a piano. The correlation is straightforward: each white key relates to 2 LEDs, and each black key corresponds to 1 LED. Driving this LED ensemble is the NodeMCU microcontroller, a compact device known for its versatility and power.

NodeMCU Microcontroller

Image: The NodeMCU microcontroller that drives the LED ensemble.

Interactive Element

The NodeMCU also hosts a webpage, creating an interactive element that is integral to the project. This interface, designed with user-friendliness in mind for usage on phones, allows audience members to tweak the visual output in real-time. From choosing among different effects to changing the colour, speed, and brightness, users can actively participate in the performance.

Interactive Webpage Interface

Image: The interactive webpage interface hosted by NodeMCU.

Development and Tools

The impetus for this project was a desire to augment the performances of a pianist friend with an additional visual dimension. The journey required the utilization of various tools: A MIDI editor on the PC proved invaluable for testing, while PlatformIO facilitated source code management. Libraries such as FastLED, MIDI, and ESP8266WiFi formed the building blocks of the software architecture.

MIDI Editor and PlatformIO

Image: The MIDI editor and PlatformIO used for development.

MIDI Signal Processing

Processing the MIDI signals is at the heart of the operation. The system reads incoming MIDI data, extracting two key pieces of information: the pitch, indicating which key is pressed, and the velocity, showing the intensity of the press. The pitch maps to a specific position in an array. Based on the selected effect, this information then triggers an update in the LED array. The brightness of each LED varies with the velocity, creating a dynamic light show that mirrors the musical performance.

MIDI Signal Processing

Image: MIDI signals being processed into LED array updates.

Challenges and Future Plans

Overcoming challenges and solving problems is part and parcel of the prototyping process. Ensuring that the processing speed was adequate to maintain the fluidity of effects, even with rapid note changes, was a significant hurdle. Through determined troubleshooting, the prototype has evolved to its current state and is ready for its first real-world test. Looking ahead, my plan involves refining the system by introducing more effects and expanding the scope of audience-performer interaction. I also intend to design a custom PCB and an acrylic case. The transparent case would provide a glimpse into the electronics that power this immersive experience.

Future Plans

Image: Concept sketches of future plans including custom PCB and acrylic case.

Open Source Ethos

While I have no plans to commercialise this project, I strongly believe in the spirit of collaboration and open-source ethos. I intend to share this project broadly, hoping that it may serve as a source of inspiration to others.

Conclusion

The MIDI-controlled LED piano project adds an engaging visual element to the auditory experience of a musical performance. The early feedback has been promising, and I eagerly anticipate its debut before a live audience.

Audience Reaction

Image: An excited audience experiencing the LED piano project.