Designing a Concert Playlist Popularity Algorithm

I’ll start by saying that this article might not be for everyone. But I love following along when people are thinking through complex problems, so this might be interesting to some people.

Here’s the deal

I have a make-believe band called Enthusiastic Panther. They have a catalog of make-believe songs and play make-believe concerts in real cities around the world. And each show has a real playlist. Read all about it here.

So I want to write some code that automatically creates a playlist for each concert and awards scores based on how well each song was played.

The current algorithm

Here’s a screenshot of last night’s show, with each song rated on a scale from 1–100. Blue songs are ones played better than usual, and red ones are ones played worse than usual.

The current algorithm is super simple. Each song has an average score based on previous performances. So if I play a song 3 times and the scores are 45, 50, and 55, that averages out to 50. Then I take that number and pick a random number on a bell curve. So it’s more likely to get a number close to 50, and less likely to get a number a lot higher or lower.

Then I randomise the playlist every night. There are no special considerations for the popularity of a song, how long it’s been since it’s been played, songs that match well with each other, etc. It’s completely random, which leads to sort of boring shows. I want to fix that.

New algorithm idea #1: song gaps

First things first, the band doesn’t like playing the same songs every night. They have about 40 songs, and in each concert, there are about 10–15 songs performed. The algorithm should know how long it’s been since a song has been played so songs aren’t performed too often.

#2: New songs

The audience likes hearing new songs from the band. In fact, part of the lore of the band is that any new song the band has is always played at the beginning of the concert. And sometimes they play entire shows of new songs, as a way of releasing new albums of music.

So the code should do two things. It should put new songs first, and it should make sure new songs get a fair shot so the band can practice them more.

#3: Fan favourites

Some songs are more popular than others, of course. And as much as the band likes to play new stuff, they have some go-to songs that they know the crowd will always appreciate. So that’s an important part of the logic.

#4: Song types

This will come later. Maybe I decide that “Reload” is a fast song, and “Greypeak Range” is a slow song. With that data, I can run through some logic that makes sure the set isn’t too fast or slow, but balanced well.

#5: Machine learning insights

This is a fun idea. The band has already played 57 shows, meaning we have data about what performances worked well and which ones didn’t. It would be fun to factor that data into the algorithm.

So that’s what I’m working on

Now I need to figure out how to take these ideas and put them into code. Wish me luck!



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store