Dynamic playlists in MusikCube

On Windows, my music player of choice is musikCube. It’s fast, clean, elegant, and powerful. Oh, and it has an embedded SQL engine underlying its song library.

musikCube in action

It has conventional playlists, but it also has dynamic playlists based on queries of the underlying SQL database. For example, this query gives the Top 10 Most Played songs:

 timesplayed > 0  ORDER BY timesplayed DESC  LIMIT 10

And this gives 50 songs with a rating of 4 stars or better in random order:

 rating > 3 ORDER BY random() LIMIT 50

Once created, a dynamic playlist is only a mouseclick away.

The documentation is incomplete, but the database schema is easy to look up by saving a copy of the library and opening it up with a tool like sqliteman:

musikCube database schema

I wanted to subdivide my music into playlists, and then find any song not on a custom playlist. A query similar to this did the trick:

songid NOT IN (
  SELECT songid
  FROM std_playlist_song
  WHERE std_playlist_id IN (
    SELECT std_playlist_id
    FROM std_playlist
    WHERE std_playlist_name IN ('Gnarly', 'Radical', 'Tubular')

It finds every song not added to the Gnarly, Radical, or Tubular static playlist. Using this, I finally got my music library sorted and organized.

Published by

Leons Petrazickis

I'm a full-stack developer at IBM Digital Business Group. I do Ruby, Node, Python, Hadoop, Spark, as well as web scale devops with Docker and Terraform. My opinions are my own.