Lighting WS2812 LED strip by parsing a midi file on Raspberry Pi.
https://www.bilibili.com/video/av68328315
-
rpi_ws281x
-
adafruit-circuitpython-neopixel
-
mido
-
python-rtmidi
python-rtmidi compiling needs libasound2-dev & libjack-jackd2-dev packages, use apt-get to install.
sudo pip3 install rpi_ws281x adafruit-circuitpython-neopixel mido python-rtmidi
-
Raspberry Pi
-
WS2812 LED strip (taobao)
74 pixels/m or 144 pixels/m is better, but still has some disalignment to piano keys.
I used 74 pixels/m strip and cut it to 12~15 pixels per segment, then soldering those segments by myself for aligning led pixel to piano key one by one.
-
5V 10A DC power supply (taobao)
-
DC 5.5*2.5MM power jack socket connector (taobao)
-
bread board and wires
sudo python3 play.py -f music.mid [-p audio_port_name]