How To Make A Popular Song? — A Data-Driven Approach

Shreyas Chaturvedi
Analytics Vidhya
Published in
6 min readFeb 15, 2021

--

Last night I had the curious idea that I should create a song and inform every step of the process — the key of the song, the genre, the tempo, everything — with the power of statistics!

THE DATA

To do this, I first had to find data on current music that I could analyze. Luckily, Spotify has made a ton of data on their songs public. The information out there is really vast and extremely friendly to use.

I have linked my data sources here and here.

THE TOOLS

I used the programming language, R, for all of my analysis. You could probably do a similar analysis using Excel if you wanted, but I just prefer to use R.

I used Apple’s GarageBand to produce and record the song [lol].

POPULARITY

Alright, let’s begin!

The dependent variable we’re dealing with here is called “popularity,” which is a value that ranges from 0–100.

This value is calculated by Spotify’s internal algorithm and is based primarily on the total number of plays a song has and how recent those plays are.

As a result, this value is biased to newer songs. Tracks that are being played a lot now will have a higher popularity than songs that were played a lot in the past.

OTHER FACTORS

But what makes a popular song “popular,” you might ask. Well, a host of different factors:

  • Key: The key has a total of 11 values starting with C (0) , C# (1) , D (2), and so on.
Keys are represented based on the following integer notation.
  • Acousticness: This value ranges between 0 and 1, with 1 representing the highest degree of acousticness a song can have.
  • Danceability: Danceability describes how suitable a track is for dancing based on a number of factors including tempo, rhythm stability, beat strength, and overall regularity. Values range between 0 and 1.
  • Energy: Energy represents a perceptual feel of how energetic — in other words, lively, loud and intense — a track is. Values range between 0 and 1.
  • Duration: How long the song is.
  • Loudness: Loudness values (given in decibels) are averaged across the entire track and are used to compare the relative loudness of tracks. Values range between -60 db and 0 db.

(You can check out the full list of variables on Spotify’s official website here.)

HOW TO MAKE A POPULAR SONG?

So, let’s get to it.

The first thing I had to determine is: what genre should my popular song be in?

GENRE

The most common genre, expectedly, is pop. However, if we take a closer look at the most popular* songs, we learn that a sub-category of pop actually takes the cake.

(*For the purpose of this study, I’ve defined “popular” songs as those with a popularity rating of more than 60.)

What’s the difference between dance pop and pop, you ask? Well, here are the numbers explaining exactly this:

It is observed that “dance pop” songs are typically

  • faster
  • more danceable (duh)
  • happier, and
  • longer

than regular ol’ pop songs. And, from domain knowledge, it is known that dance pop songs also are more techno heavy than pop music.

So I picked a dance pop beat on GarageBand from their “Vision and Verse” Live Loop package and decided to roll with it.

TEMPO & KEY

The next question I had to answer was: what key and tempo should my song be in?

It is observed that popular new songs are mostly in the C# key, which is the key I decided to go with for my song.

It is also observed that popular songs — overwhelmingly — have a tempo of 119 beats per minute. I decided to adjust my beat to this tempo, making the original beat much slower than the GarageBand original.

The beat so far sounds a little like this:

Admittedly, the beat isn’t exactly an inspired work of art, but! It’s something. And for a beat inspired totally by statistical analysis, I’m quite proud of it.

LOUDNESS

Popular music has become louder and louder since the 1960s till it hit the 2000s, after which the curve flattened a bit. Now, popular music is actually less loud than some years ago.

What did this mean for my beat? It meant I had to lower the decibel level to make it softer, even quieter, perhaps.

LYRICS

There is a very interesting variable in this dataset called valence. Valence is an attribute that measures happiness in a song and works like a score that rates songs on what is known as “musical positivity.”

Tracks with high valence sound more positive (happy, cheerful, euphoric), while tracks with low valence sound more negative (sad, depressed, angry).

As you can see, popular music has become sadder over time. It hit its peak during the late 70s, which marked the end of the hippie movement. It’s interesting to note that music has consistently become less happy since the 80s, with it hitting its lowest point now in 2021.

But does this mean that popular music has to be sad?

No, it does not. If you look at the above chart, the music today has a valence score of a little less than 0.5. This means that popular music isn’t either overly happy and nor is it overly sad or angry.

What did this mean for my beat? Well, quite simply it meant that I needed to come up with lyrics that ranked somewhere in the middle of this valence metric. Neither too happy, nor too sad, like I said.

This is what I came up with:

Yeah I like apples, yeah I like fruits

When I go out I wear my boots, I wear my suits

I’m a man of my roots

That’s my attribute, no substitute.

Bitch, I’m absolute like vodka

Thoughts abstract like Kafka

Got a voice like I’m Sinatra

Number one, baby, like Prada (x2)

I know, I know: such inspired piece of writing, is it not? No, I’m kidding. I’m fully aware that these lyrics make no sense! Yes, but that’s also kind of the point.

These lyrics are about nothing in particular, conveying no particular emotion or feeling. And that’s what sells these days: nothingness, to a dance pop beat of 119 BPM.

END RESULT

Putting it all together, this is what I came up with:

To summarize:

  • This song is in the dance pop genre.
  • It has a tempo of 119 beats per minute.
  • It’s in the C-sharp key.
  • It has a valence (happiness) rating of approximately 0.5.
  • It has high values of danceability and energy.
  • It has low values of acousticness, loudness, and duration.

This was one of the more fun projects I have had the opportunity to work on, and I must say I thoroughly enjoyed myself!

Let me know what your thoughts are and if you have any feedback.

Cheers,

Shreyas.

--

--

Shreyas Chaturvedi
Analytics Vidhya

Data Analyst trying to answer life's questions with the aid of numbers.