If, in the year of 2013, you set out to put a lot of time and Python and some hardware into building a CD player rather than a streaming service you have some explaining to do.
Last: the result
It took a year and a half of on-and-off coding, and one complete refactoring of the player core, before codplayer 0.9 entered full-time CD player duties in my living room, looking like this:
It’s now housed more elegantly, as described in this post.
Earlier: a name
It’s a COmplicated Disc Player, so codplayer. But the short form also has the benefit of being unique, and suitably silly for the endeavour. Naming code is often harder than writing it.
Initially: pop artefacts
The concept goes back to a realisation that I probably should start migrating from primarily listening to music from physical media before it is too late. Not that vinyl is threatened, but on that format I mainly collect second hand pop record from the 80s, and aren’t convinced about buying newly pressed LPs. The bulk of my active music collection is thus on CD, and that is clearly unhip.
At the same time I much prefer listening to pop albums, records with a start, an end, and an internal structure. On long travels my ipod might get told to play random tracks, but listening to an infinite stream of random tracks at home is not my preferred mode. If I want that, I put on an Avalanches mix.
iTunes does a half decent job playing albums as albums, Spotify is just useless at anything but spamming your play queue with unwanted tracks. Neither provide any kind of user interface equivalent of standing in front of the record shelves and deciding what to listen to based on the physical organisation of records. That I’m a sucker for the physical artefact is evident by the four CD copies I have of Pet Shop Boys Very, each one different and bought for a good reason.
The codplayer idea
The core idea of codplayer is thus to be a digital music player where the main UI is the physical disc and a good old-fashioned remote control, rather than having to fiddle with a laptop or touch screen UI. The first time you play a disc it gets ripped to a file server, and subsequent times the disc just identifies the sound files to play in the ripped disc database. This enables several features:
Respecting album boundaries. My mid-90s copy of The Rise and Fall of Ziggy Stardust and the Spiders From Mars has some B-sides and demos as bonus tracks, which are nice to have. But after the closing chord to Rock’n’Roll Suicide, there should be silence, not John, I’m Only Dancing. Codplayer can force the playback to pause there.
Removing tracks. Who needs a “schizo mix” of Just Can’t Get Enough on the bonus tracks to Speak & Spell? And while I do extol the virtues of pop albums, there are some plainly awful tracks out there which are sometimes a blessing to cull.
Symlinking discs. Now we’re into deep disc fetischism, but I really, really prefer to pluck the original jewel case off the shelf and put the 1990 disc of Behaviour with the Mark Farrow typography in the player, but having it play the 2001 remaster.
Getting a high-fidelity backup of the record collection (not even flac! just pure samples and table of contents!).
Triggers and enablers
The final trigger to put these sentiments into code was that I was about to join Commons Machinery as lead developer. After five years as a solution architect using Microsoft Office as my main tool and not doing much coding at all, I wanted to refresh my developer skills before starting the new job. This was a suitable project for that.
At the same time all those cheap Linux platforms were proliferating, so it was suddenly feasible to have a small, fanless computer in the hifi rack shuffling samples with Python code.
That little Raspberry Pi sounds brilliantly. I was afraid this was hifi placebo, but the rational explanation is that my DAC can do a much better job when fed samples over USB than an RCA S/PDIF cable. On USB it has control of the all-critical clock, but on S/PDIF it’s just a slave to the clock in the CD transport (in this case a half-decent DVD player).
Finally, the knowledge that all those bits shuffling to the DAC are now fully under my own control and perform excellently is almost as rewarding than the sound itself.