Thursday 27 March 2014

Moodbar and playlist creation - Part I

I like music! I listen to music everyday since it helps relax,  get inspired and even lifts me up when I have the blues.

Unfortunately I can't access online music services during the day (damn proxies...) so I have to rely on my own music collection for all my needs.

You can imagine that listening to the same tracks day in and day out can get a bit tiresome...

I always tried to use players that had "smart" playlist generation in order to create some nice coherent playlists. However these "smart" playlist creating apps only work well to find similar artist/bands to the one you're listening to or to suggest popular tracks from other similar artists/bands.

That's great when you have a huge music collection with lots of artists/bands and albums or for web services that have artists and bands you never heard of...

Besides, different tracks from the same artist/bands don't always have the same "mood".
I'll illustrate this with an example from my favourite band: Pearl Jam

Listen to the following songs:

Do the Evolution: http://www.youtube.com/watch?v=aDaOgu2CQtI
and
Sirens: http://www.youtube.com/watch?v=qQXP6TDtW0w

They are in completely different contexts and can easily have been from two distinct bands.
This is something that usually happens within a band, songs that translate into completely different states of mind and that can really mess up a playlist and your mood :-)

So how can you make this less of a problem?

A few years ago I was introduced to a great music player for the KDE desktop: Amarok (amarok.kde.org). Amarok had a nice feature that almost went unnoticed but had great potential, the moodbar.

What is a moodbar you might ask?
Read this: http://blog.randomprocesses.net/2007/02/moodbar.html
and this: http://cratoo.de/amarok/ismir-crc.pdf
and maybe this as well: http://userbase.kde.org/Amarok/Manual/Various/Moodbar

Making a quick summary, a moodbar is a graphical representation of the different frequencies in a song as they occur over time.

It looks something like this for the songs I mentioned earlier:

Moodbar for "Sirens"

Moodbar for "Do the Evolution"


You can easily identified when something happens in the song since the vertical bars are ordered with the song's duration. You can also see that the two moodbars are very different in overall aspect/hue, just like the songs.

So this got me wondering if we could use this to select similar songs....


Turns out you actually can... :D

I used a simple Python script to read moodbar files generated by my current music player, Clementime (http://www.clementine-player.org/) which is based on Amarok, and select songs that have a similar "mood" to a given song.

I started by creating a playlist of Bands/Artists I wanted to listen to and then run the script to process the files in that list and created a new list of songs that had a similar mood to my selected song.


This is what I came up with:


Playlist based on "Sirens" (first 20 songs):

Pearl Jam - Sirens
Rage Against The Machine - Year Of Tha Boomerang
The Black Keys - I Got Mine
Pearl Jam - Supersonic
Nirvana - Spank Thru
Pearl Jam - Swallowed Whole
The Black Keys - The Breaks
The White Stripes - Screwdriver
Rage Against The Machine - Down Rodeo
Ramones - Rock 'N' Roll High School
The White Stripes - Black Math
The White Stripes - Instinct Blues
Nirvana - Come As You Are
Pearl Jam - Mind Your Manners
Pearl Jam - Even Flow
Ramones - Sheena Is A Punk Rocker
Pearl Jam - Why Go
Nirvana - Beeswax
Rage Against The Machine - Down Rodeo
The Black Keys - Nova Baby

And the combined moodbar look like this:



Playlist based on "Do the Evolution" (first 20 songs):

Pearl Jam - Do The Evolution
The White Stripes - Now Mary
The White Stripes - Jack The Ripper
Nirvana - Rape Me
The White Stripes - Hotel Yorba
The Black Keys - Stack Shot Billy
The Black Keys - Keep Me
Pearl Jam - State of Love and Trust
Led Zeppelin - Dazed And Confused
Pearl Jam - Corduroy
Temple Of The Dog - Pushin Forward Back
Nirvana - Moist Vagina
Pearl Jam - Arc
Pearl Jam - Help Help
Rage Against The Machine - Microphone Fiend
Rage Against The Machine - Sleep Now In The Fire
The White Stripes - I Think I Smell A Rat
Rage Against The Machine - Microphone Fiend
Nirvana - Radio Friendly Unit Shifter
The Black Keys - Just Got To Be

Moodbar for the playlist:


Not bad, the process can be refined a bit but you can immediately see that the overall hue of the playlists is different and so are the songs but they are similar in overall sound.



I'll post the Python screen in another post since I still have to clean it up and optimize some stuff.







1 comment:

  1. Hello Marcos-

    Great project! Did you get the chance to clean up the Python Script?

    ReplyDelete