QR music player
Based on an idea from Dave Murray-Rust, this is a set of small scripts that lets you get 'hands on' with your digital music collection.
Print out your album art on one side and a version 1 (smallest size) QR code on the other (not yet automated).
A webcam on your computer/Raspberry Pi picks up the QR code using zlib and starts the album playing.
A Raspberry Pi with 640x480 usb webcam responds within a second of showing the QR code.
See a video demo here.
- Starts the webcam, uses PIl to convert an image from open cv format to something zlib understands,
- Uses zlib to search for QR codes,
- If one is found, search database and pass album name to mpc.
- Defines a single function that will start a new album playing if it isn't already
- Creates a new QR code using QR code python module, just picks a random number ATM.
- This is a proof of concept - pretty shoddy code!
- With my 640x480 webcam it works up to about 1m away with a 15cm QR code. A higher def camera will increase this distance.
- Only works with mpc
Want to make it better?
- A real database, and way of generating it,
- Auto generate pdfs with QR and album art for printing,
- Extra QR codes to stop and start,
- Chop off bottom of image to make scanning quicker,
- Other music controllers (currently only works with mpc),
- sudo apt-get update
- sudo apt-get install python-pil
- sudo apt-get install python-zbar
- sudo apt-get install python-opencv
- pip install qrcode # only needed for creating qr codes
- sudo apt-get install mpc mpd # for music playing
ws2812 status leds
use SPI so doesn't interfere with i2s
need core_freq=250 in the bootconfig for rpi3
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.