# Last.fm Normaliser
URL: https://www.associativetrails.com/work/normaliser/
Client: Associative Trails
Type: Web application
Summary: Experimentally musical mashup — A little application to rank your favourite artists and albums by an estimation of how long you have spent listening to them.

The first version of the Normaliser was launched in June 2007, and immediately got a bit of coverage on influential blogs, which brought it a decent amount of traffic.

After two years of solid service, we rebuilt the application from scratch using open-source technologies and refreshed the design.

## The challenge

Having been a user of last.fm (http://www.last.fm/) for a number of years, I often found it frustrating that my listening charts didn't accurately reflect my listening habits. The problem was that last.fm uses the "track" as the atomic unit of attention - and last.fm's listening charts are sorted based on how many tracks you have listened to by a particular artist.

This approach can throw up some problems. For instance, some artists tend to record shorter tracks than others. For instance, spending an hour listening to Arctic Monkeys (http://www.last.fm/music/Arctic+Monkeys) will probably log twice as many tracks as the same time spent listening to Pink Floyd (http://www.last.fm/music/Pink+Floyd).

## The solution

After grumbling at length in a blog post (https://www.associativetrails.com/blog/entry/The-atomic-unit-of-attention), I realised that in the age of open data it shouldn't be too much hassle to knock together a little app to apply the "normalisation" calculation I discussed. The resulting application does the following:

- Takes a last.fm username and grabs the XML list (http://www.last.fm/feeds/) of top 50 artists/albums;
- Goes through those artists and grabs album and track data for them from the MusicBrainz web service (http://wiki.musicbrainz.org/XMLWebService);
- Calculates the median track duration for each artist, using it to estimate how much time spent listening to the artist;
- Sorts the artist list by estimated time.

The resulting table shows top artists ranked based on the estimated time spent listening to them.

## The outcome

The first version of the Normaliser was launched in June 2007, and immediately got a bit of coverage on influential blogs, which brought it a decent amount of traffic. After two years of solid service, we rebuilt the application from scratch using open-source technologies and refreshed the design.

We are regularly adding new functionality, including graphical widgets allowing users to display their normalised charts on their own websites and blogs.

In November 2009, we started a small collaboration with the Music Technology Group (http://mtg.upf.edu/) at the Universitat Pompeu Fabra (Barcelona, Spain).

Technologies used

Python, Django, MySQL, RSS, XHTML 1.0 Strict, CSS, RSS, jQuery, Google Chart API. Ubuntu, Apache, WSGI, Nginx, Munin, Monit.

## Screens
- Normalisr homepage: Users enter their last.fm username to generate a chart ranking artists by estimated listening time rather than track count.
- Time-based charts of last.fm music data: Artists are re-ranked by estimated listening time, calculated from track counts and median track duration, showing the change from the original rank.
- The latest news about your favourite artists: Entering a last.fm username fetches recent news stories about the artists in that listener's charts.
- Increased usage since redesign: The site was rebuilt from scratch and its design refreshed after two years of service, with usage tracked over time.
- A widget for users' websites and blogs: Normalisr can generate a graphical widget that users add to their own websites or blogs to display their charts.
- Charts showing artist photos: Chart results can also be displayed as a grid of artist photographs rather than as a table.
