Now Playing
3 min read
On this page
This is my Now Playing Raspberry Pi + LED matrix. There are many like it, but this one is mine.
I've always liked the tactile nature of a vinyl, the whole ritual of it all, but these days most of my music consumption happens in my office. I have a stereo HomePod pair in here, headphones I use from time to time, and no shortage of ways to listen to music while I work. None of it is vinyl. When I have a record playing, I always have the sleeve propped up on the shelf next to the turntable and the speaker, that's what I wanted to capture for my office.
Faking a speaker
Most of the now-playing projects I found were built around Spotify, which was a dealbreaker since I use Apple Music. MusicKit doesn't give me a clean global view of whatever happens to be playing on the HomePods. pyatv looked promising because it can observe an Apple TV. The HomePods were less cooperative. They would pair, complete the handshake, and then report that nothing was playing. Repeated attempts eventually earned multiple timeouts, leaving the pair unresponsive for a time.
Eventually I gave up on trying to observe the HomePods and made the Pi a speaker. It runs shairport-sync and advertises itself as an AirPlay 2 endpoint called Office Panel. AirPlay 2 can target multiple endpoints, so I select it alongside the Homepods. They handle the sound and volume while the Pi's dummy audio backend stays silent and handles the metadata.
A small Python client crops the artwork with Pillow, and sends it to a 64x64 HUB75 LED matrix. At 4,096 pixels the artwork gets pretty thoroughly wrecked, but I can look over at the shelf, and see it there. That gives the music some presence in the room again.
Between albums
For about five years I've had a first-generation Pi Zero connected to a tiny 3x3-inch LCD in another corner of the office. Back in 2021 I trained an early StyleGAN model on about a thousand images from my drone photo library, then used it to generate a few latent walks. One became a thirty-minute loop of morphing ocean flowers.
The new panel borrows the loop whenever nothing is playing. The video has been rendered down and retimed specifically for the 64x64 matrix. It pauses in place when music starts, then resumes from there when the music stops.
A small NOAA calculation on the Pi tracks solar elevation, holds the matrix at full brightness while the sun is up, then fades it down through twilight. It comes back up with the sun. No schedule to adjust as the days get longer and shorter.
Still not vinyl
The panel scratches an itch. I'm scheming up a way to make my music catalog more tactile. I have a stack of blank NFC cards in a desk drawer, and each one could become tagged as an album. At first I thought I could tap one against my phone and trigger an iOS Shortcut. Then I started thinking about an NFC reader inside the frame with a slot for the card.
Inserting a card would start its album playing from the beginning. As long as the card is physically there, the album keeps playing. Pull it out and the music stops.