BlogProjectsVideosMusic
|
Spotify­Analyser
a music breakdown web app
2021/06/10
link

I made an app that collects your spotify data, and aggregates your most listened to genres. I know of many apps that do this for your top artists and songs, but I wanted to give this a go for genres. An issue I ran into almost immediately was that the genres stored by the Spotify API were overly specific to the point of being useless for the average person.

There are 5,071 genres recognised by the Spotify API, and I wanted to reduce this to a more manageable number. My first step in reducing the number of genres was to write an algorithm that recorded every genre that was a substring of another genre. For example, indie rock is a substring of other genres indie and rock. So I would increment a counter for each of these "base" genres.

This left me with a list of mostly one word genres that I could use as individual umbrella terms to group the rest of the genres. I then wrote another algorithm that would allocate each genre that contained the word of one of the base genres to that base genre.

After this, I extrapolated the leading and trailing words from each genre, named them 'modifiers', and re-ran the first algorithm with the modifiers in place of the base genres. Finally I wrote a switch statement where combinations of modifiers and base genres would be mapped to a tier of complexity. This tiered system was supposed to represent how unlikely the average person was to have heard of the genre before. Genres like pop and rock could be considered as tier 1, whereas something like indie folk would be tier 2 because of the modifier indie and the base of folk.

In the web app, users would sign in with their Spotify account, and it would show them their most listened to genres. They are given a slider, starting at 1, where they can traverse the tiers of complexity up to a maximum of 5 and see genres they like but have never heard of.

I also made a video recounting my development efforts, which you can watch below. Though, you will have to excuse my attempts at comedy. This was definitely a lockdown project.

Good effort making it through that one...