Vinyl Emulator š¶
This post is 100% GenAI-free. Read here why.
This is a recap of a hobby project I intermittently worked on in the past 5 years and that only recently reached a ādeploymentā state worth sharing. While writing my dissertation in spring 2020, my brain started to find anything that wasnāt the dissertation.tex extremely interesting⦠and in particular one thing really caught my attention.
The Idea
As summarized in this article later published on the Raspberry Pi Magazine, people on Reddit were connecting Sonos speakers with NFC/RFID readers to stream music from Spotify. By placing a nice illustration of a music album (with a hidden tag inside) in a predefined spot, the corresponding music would stream from the speakers, giving you back the tactile feeling of handling a vinyl record or a cassette tape. Writing about this in 2025, when the Offline and other digital detox movements are booming, makes me realize how headed of time these tinkerers were for desiring to manually go through a curated music collection in a dedicated space in their homes.
Long story short, I wanted to build something similar to have a kind-of vinyl collection of those albums that I always go back to, like John Coltraneās My Favorite Things or Bob Marleyās Catch a Fire.
My Vinyl Emulator
Here is an attempt at separating the project in components and features that over the years were considered.
Music Server: I wanted something running locally on my Raspberry Pi 4, so that I could have the music server accessible both via the āfake vinyl recordsā and a browser interface. I opted for a Mopidy music server to which I could talk to with any mpd client (ultimately I used python-mpd2) and Iris as browser frontend. All wrapped in a unnecessarily extendable Python interface that handles the card reader ā album database ā mpd server pipeline. Overall, the easiest and chill part of the project, given my background.
Vinyl Interface: I like tinkering with electronics, but Iām not super comfortable with it. I therefore opted for a MFRC522 RFID reader that seemed simple to use. Yeah, seemed⦠I had a couple of hiccups:
- being afraid of burning my RPi4 and triple checking the wiring at every test with the sensorās datasheet. Very time consuming, until I basically taped the jumper wires and create my own connector. Like that I only hat to check that the top-left connector was going on the correct RPi pin.
- switching to a Raspberry Pi Zero 2 for the sensor side of things, because debugging on the RPi4 was cumbersome (I have other stuff running on that machine, above all a Pi-Hole instance).
- a sudden sensor failure, cause by a jumper wire that randomly died (do wires fail? apparently).
- inconsistent card readings, only to find out that there are 2 standards of RFID cards, and the
rc522only works with 13.56 MHz NFC Type 2 tags. - other inconsistencies in the readings, this time caused by not high enough antenna gains.
- using sketchy Python library interfacing to the sensor before finding the great
pi-rc522.
Many rookie mistakes, made me really appreciate the saying You gotta break a few eggs to make an omelette.
Audio Interface: Here as well I was in unfamiliar territory. Iām not a hardcore audiophile and hooking an audio system to the RPi seemed a bit beyond my skills. I therefore opted for a Sony Bluetooth speaker we were not heavily using anyway, and made it the default audio sink of the RPi4.
Overall Setup: Here is where the real hybris happened. I liked how people were hiding the sensor (plus sometimes the music server) inside elegant wooden boxes, but I wanted something more personal. Inspired by this DIY project, I wanted to lean into the retro-computing vibe and have a Commodore 64ās (the first computer I ever interacted with) Datassette (the device that reads the cassette tape) as the case for the emulator. Furthermore, I wanted to re-purpose the buttons of the Datassette for the classic music commands: play/pause, next, repeat, and so on. Yeahā¦
If for electronics Iām a cautious amateur, Iām a complete rookie about anything mechanical. I bought a not-functioning Datassette on Ebay, made space inside for sensor+pi+ssd, made a small circuit to wire push-buttons to the pi (with a pcf8574), and then hit a wall. I could not get the push-button to stay in place inside the case under the original Datassetteās buttons, I did not have a 3D printer to make some holders (that I doubt I could anyway 3D model them in the first place)ā¦
This side of the project almost killed the whole thing, until earlier this year my wife wanted for our kid āsome speakers that play music/stories when you place a little toy on themā. I complained that that was basically what I was doing with my emulator, to what she answered āwell, then build it before Xmasā.
The End Result
And thatās where I stashed my Millennialās nostalgia about retro-computing, dropped the Datassette idea, and speed-run the setup. The PiZero2 hidden in a low cabinet and RFID cards (sticked inside card-game sleeves, with paper covers made with a handy LaTeX template ā sticking to my knitting again here) placed on a target area. Done. Some minor bug/pain points fixed, some feature requests from family members, but the vinyl emulator is smoothly running since September now. Not as fancy looking as the OG ones, but functional and childproof (for now).
Miscellanea
- Kanban board on Notion: Having a dedicated space for a project that saw work done on it maybe once a week was really helpful. The Kanban was not exactly used for the intended purpose of ātracking task through different stages and prioritiesā but rather as a project status reminder, where each task was packed with links to relevant material and information.
-
Shout-outs to Puddletag, a handy software for tagging music files.
-
Every time I add some music to the RPiās SSD, a little voice in my head whispers āthis drive will fail, where will your music go?ā. Ultimately Iāll need to setup a proper NAS at home and give the RPi a honorable retirement.
-
Of course, anything āgit-ableā has been versioned. If anybody is interested in this, I can make the repo public.
Closing Remarks
No poetry here. It just feels good to have done something that is far from perfect but that essentially works. Get out of here now š
(Dis)liked what you read?
Let me know! Drop me an email at mattia dot rh at gmail dot com with [BLOG] in the subject. Some other posts: