Guest Post: Serato Scrobbler Deep-Dive and Backstory
Serato Scrobbler: What is it?
SSL Scrobbler is a tool I made – which I have used myself, every week, for over 10 years – to live tweet the tracks I play on my radio show, as well as logging them to my Last FM history (“scrobbling” as it’s known on Last FM), amongst other bonus features.
One of the things I’ve always loved the most about DJing on the radio is the audience interaction, whether you have 10 listeners or 1000. But some tasks, such as answering requests for a Track ID, are a distraction and take you away from the craft – likely why few DJs do live tracklists at all. Indeed, some DJs purposefully enjoy the mystery of keeping people guessing – but I’ve always wanted to share what I like, and perhaps help support the artists when listeners go out to buy something that they’ve heard. After all, that used to be me – in the late 90’s and early 2000’s that was the main way I discovered new music myself.
The Last FM element is also important to me (and actually the original motivation for making this tool), and I’ll explain why shortly.
Here’s a video of it in action!
What motivated me to make this?
If you’re a fan of drum & bass radio you may or may not know that I’ve been doing a show on bassdrive.com for the past twenty years. At the beginning, my weekly routine was to buy vinyl records and then have fun playing them on air – for myself, and a few hundred listeners, to enjoy. That’s been my routine every Tuesday evening ever since; but in around 2007, I switched my energy and focus to buying digital. After all, you can get more for your money that way.
My radio journey actually started a few years prior, when I had a Friday night show on one of London’s best pirate radio stations. It’s always felt good to have an audience enjoying the music I like to play. It’s great knowing that the music you play means something to people. That’s been especially relevant since lockdown, and I’ve received a number of messages from people to let me know that the music is what keeps them going.
Despite this, the DJing is not actually my day job. I’m a software engineer by trade, and have worked for Last FM since 2008. If you don’t know Last FM (and many don’t), it’s a site that lets you keep a history of everything you’ve ever heard (when, and how many times) and it uses that information to work out new music you’ll probably enjoy. There’s a primer here – but millions of people use it, and Last FM has a very deep and very broad knowledge of music in every genre from any decade.
The key to this process is “scrobbling” – the process of automatically logging your listening history, from wherever that may be, to Last FM. One of the Last FM mantras is “if it doesn’t scrobble, it doesn’t count”. Last FM has apps which support logging your listening history from many of the most common places people listen (the most popular ones are linked from here). In the early days of Last FM this was CDs and MP3 collections. Last FM supported WinAmp and iTunes by installing the desktop app. These days, it continues to work extremely well with Spotify, YouTube and Apple Music, as well as any media player on Android. There are also browser plugins to support logging your playback from sites like Mixcloud, Soundcloud and many others as well.
And so, my motivation becomes clear. As someone who has been committed to this mantra for so long – both professionally and for my own listening and music discovery experience – the big hole in my listening history was the music I was playing on the radio each week, through Serato.
In 2010, there was no app which would allow this (and, Serato didn’t have the “public playlist” function either). I had to see if I could crack the problem myself.
How does this differ from Serato’s live playlists?
Serato’s live tracklist feature covers some, but not all, of the uses I had in mind. It only posts the tracklists to one play, which is the Serato website itself. Also, my preference is to tweet the title of a track once we’re a little way in – Serato’s live playlists only update once the track is marked as “played” inside Serato (which corresponds to when you progress from one deck to the next with new songs).
Last FM also has quite specific rules about what counts as a “play”, although they weren’t written with DJ mixes in mind. Ideally, if you only play a short part of the song (perhaps you dropped it in as a teaser), that doesn’t really count as a play.
There are a couple of other features I’ve added too, such as the ability to pop up a warning when you queue up a track that would break the DMCA streaming rules. If you’re unfamiliar with those, there are a few summaries here (live365) or here (djcmedia). In practise, this means it’s best to avoid more than four songs in a mix from the same artist, or three from the same album – and breaking these rules could make your mix unplayable on Mixcloud, for example.
How does it work?
As a developer, you always hope that perhaps there’s an API you can use to extract the information you want. WinAmp, Windows Media Player, iTunes / Apple Music and even Spotify have fairly comprehensive APIs which let you access certain aspects of what song is being played.
However, Serato DJ does not. (You have to sign an NDA in order to be given access to create plugins).
So, I took another approach. Serato writes a history file as you play songs – it corresponds to what’s in the “History” view in the app. There is no documentation for this, it was painstakingly reverse engineered 🙂 For more information on how it works, please take a look at the github link.
Things that may disappoint you 😉
As I mentioned earlier, the great news is that this works, and has continued to work, for the last 10 years (with a few tweaks here and there along the way). The “bad” news is that, as something I originally made for myself, it does not have a clickable interface – it’s an app which runs in Terminal. Hopefully that won’t put you off. (Making a UI has always been on my to-do list – but I don’t need it myself).
I hope you found it interesting. I’ve also more recently made an app which has these same functions for tracks played on CDJ2000+ from USB sticks – something that many thought was impossible. That, however, is for another blog post!
Frequently Asked Questions
Can you make one for Traktor?
I mean… I probably could. But I don’t use Traktor myself, so it would be hard to find the time to do it. The deepest layer of the app, extracting the playback information from Traktor, would be completely different to Serato.
Why did you write it in PHP?
There’s no good answer to this. In 2010, PHP was the language I knew best. It is not the right tool for the job, but it works. There have been some other projects which have adapted this into other languages such as Java.