Out, Damn’d Spot-ify!

Out, I say!

There is so much about the R Community that I love-the sharing, the creativity, the support.  And, like me, other R users are using music to inspire their data analytics.  Trying to recreate these analysis posted to websites and blogs, but using my own data, is really helping me master many parts of the R language.  
Adding Spotify data to my analysis was intriguing, because it would help me with the ever elusive performance metric that I desire.  Is there a lyrical template that leads to a successful U2 song?  And success is defined as popularity – a variable found in the Spotify database.

Again, the R Community is amazing.  Low and behold, some R savant created an R ‘package’ to help easily extract the Spotify data.   So with my Spotify API log in credentials and the R package ’spotifyr’, I was all set to gather data.  
I gathered three database: popularity by album, popularity by song track and  track level audio features.  Let’s tale a look at what insights these databases provide

Track Level Audio Features

Spotify has created several proprietary variables around a track’s danceability, energy, valence, etc.  Other R users have created visuals around these audio features for other artists, so why not U2!
Although there are 295 U2 tracks where these audio features have been calculated by Spotify, I needed at least three observations of a single track to create a meaningful visual – three points to ensure a curve.
So my 295 observations resulted in just 11 tracks to analyze.  And, these tracks  had to each be unique, in other words, not the same recording.  So for example, Sunday Bloody Sunday shows up multiple times in the dataset because it is also on multiple albums.

Sunday Bloody Sunday Valence Danceability Energy
Original .721 .544 .932
Live .432 .412 .935
Remastered .727 .545 .947

The graph titled ‘Joy Division’ represents Spotify’s calculations of valence:

A measure from 0.0 to 1.0 describing the musical positiveness conveyed by a track. Tracks with high valence sound more positive (e.g. happy, cheerful, euphoric), while tracks with low valence sound more negative (e.g. sad, depressed, angry).

Sunday Bloody Sunday’s data points for valence includes 2 that are similar, thus creating a plot with two ‘mounds’, one centered around 0.432 and the other centered around the two observations near 0.72.

Spotify’s definition of danceability:

Danceability describes how suitable a track is for dancing based on a combination of musical elements including tempo, rhythm stability, beat strength, and overall regularity. A value of 0.0 is least danceable and 1.0 is most danceable.

Looking at danceability, the plot for Sunday Bloody Sunday is also twin peaked.  And similarly, the remastered version is very close to the original. I really could have used this chart back in the 80’s when I was making mix’d tapes for aerobics classes.  

Finally, the energy for all Sunday Bloody Sunday tracks are similar, thus a single hump plot.  U2 songs are definitely full of energy:

Energy is a measure from 0.0 to 1.0 and represents a perceptual measure of intensity and activity. Typically, energetic tracks feel fast, loud, and noisy. For example, death metal has high energy, while a Bach prelude scores low on the scale. Perceptual features contributing to this attribute include dynamic range, perceived loudness, timbre, onset rate, and general entropy.

The audio features were amusing and entertaining, but by themselves, they are not very insightful.  However, when I return to my database of U2 lyrics and begin the ‘sentiment’ analysis (joy words, positive words, fearful words), it will be interesting to see how the music and the words align, or perhaps, don’t align. Will I see songs with joyful lyrics that have a low valence? Hmmm. Perhaps yet here’s a spot-ify use.

U2 Love and Logic

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s