onlaj / Piano-LED-Visualizer

Piano LED Visualizer: Connect an LED strip to your Raspberry Pi and create an immersive visual experience for your piano playing
MIT License
494 stars 107 forks source link
led midi midi-device piano visualization visualizer

Piano LED Visualizer

Join Discord

contributions welcome

Everything Is AWESOME

The Piano LED Visualizer is a project that enables you to connect an LED strip to your Raspberry Pi and enhance your piano playing with captivating visual effects. This repository provides detailed instructions on how to set up the LED strip, connect it to a digital piano, and synchronize the lighting with your playing. Additionally, it offers integration with external software such as Synthesia for an enhanced learning experience.

Features

Detailed feature showcase with images

What you need:

Not required but worth having, to make everything look neat:

Total cost (excluding piano and tablet) should be 75-100 USD Disclosure: All of the links above are affiliate links, which means that without additional costs for you, I will earn a commission if you make a purchase by clicking through it.

Software preparations

There are two ways, you can use preconfigured system image or install everything manually.

1. System image

If you don't need to connect your RPi to Wi-Fi you can eject SD card from your PC and put it in Raspberry Pi. After 3-8 minutes (depending on how fast your SD card is) you should see Visualizer menu on RPi screen.

For version 1.5 and above:

The Raspberry Pi sets up a Wi-Fi hotspot named 'PianoLEDVisualizer' with the password 'visualizer'. Once connected, open your browser and go to "pianoledvisualizer.local" to access the web interface. Use the "Network" tab there to link the Raspberry Pi to your regular network.

You can also connect Raspberry Pi to your network manually

2. Manual installation

Instructions

Connecting LED Strip to Raspberry Pi and enabling SPI

There is no point to reinvent the wheel again, here is a nice tutorial (do only the hardware part). Double check how your LED strip is wired. Most strips use G-D-V (ground, data, voltage), however in the wiring diagram shown in the tutorial the voltage and data lines are swapped. Connecting voltage directly to your data pin might seriously damage or kill your Raspberry!

Optionally, you can connect a switch to BCM pin 12 and GND. Attach the switch to the key cover, if available. When it is closed, the animations are automatically switched off.

If you are wondering how to connect wires to RPI if screen hat is taking all pins here is a picture of how I did it. There should be a gap between RPI and screen so you can solder your wires or just wrap cables around the pins and separate them with heat shrink bands.

After connecting all cables as described above everything should fit nicely to case. Scroll down to see some photos of the setup I made If you don't have a 3d printer, try to find some company or private person who will print it for you. I paid 12USD for my print. RPICaseModel.stl

Web interface

The visualizer comes with a web interface with which you can control the colors of the LED strip, change port settings, run animations of the strip, control sequences and manage midi files, including downloading, uploading, renaming, deleting, and playing. To connect to the web interface, type the local address of your raspberry pi in the browser, for example http:/192.168.1.10 Both devices must be connected to the same network. By default, web interface works on port 80, but if needed it can be changed with the script's argument --port

sudo python3 /home/Piano-LED-Visualizer/visualizer.py --port 5000

Although in my tests I did not notice any deterioration in performance, if necessary, you can disable the web interface with the --webinterface parameter

sudo python3 /home/Piano-LED-Visualizer/visualizer.py --webinterface false

FAQ

Q - Can I use Raspberry Pi 1/2/3/4 instead of Zero?

Q - What about Raspberry Pi Zero without Wi-Fi and bluetooth?

Q - Can I use other screens or no screen at all?

Q - Does the color of LED strip PCB matter?

Q - Can I use other led strip?

Q - Do I need power supply for LED strip?

Q - Do I need soldering skills to make it?

Q - How do I access recorded files?

For web interface: Open internet browser on device connected to the same network and type RPi's local address pianoledvisualizer.local Then from the menu on the left choose "songs management" tab.

For SFTP: in any FTP program (like Filezilla) connect to your RPi local address (for example: sftp://192.168.1.10) and navigate to /home/Piano-LED-Visualizer/Songs.

Q - How do I update visualizer?

After the update, a reboot is required.

cd /home/Piano-LED-Visualizer and then

git pull origin master

If for some reasons it does not work try to remove whole project and clone it again.

cd /home

sudo rm -rf Piano-LED-Visualizer

sudo git clone https://github.com/onlaj/Piano-LED-Visualizer

Image Image Image

sidebar homepage changing led colors ports settings songs_management

Image Image Image Image Image