Act! Addict! Actors! — Analyzing Spotify Song Data using Tableau

Ordinary Twilight
Analytics Vidhya
Published in
15 min readSep 17, 2021

--

A3! x Spotify Data: What does Spotify’s API data show us about song popularity?

Tableau Dashboard showing a basic summary of the songs.

I love music, and Spotify recently called me out on how often I’ve been looping A3’s songs… oops. This got me thinking: Actually, Spotify collects a lot of data, such as data about what people like and data about the songs themselves… A quick Google search led me to really interesting analyses of Spotify’s all-time hits, which inspired me to make an A3!-focused version!

Yeah… definitely called out here.

In this part of my A3! x Data series, we’ll be looking at my attempt to process Spotify’s A3! song data using the Spotify API and Tableau. If you’re not familiar with the A3! game, do check out this series’ prologue for a quick explanation as well as the first part of the series, which goes through compiling and analyzing all of the characters’ basic information. The other parts of the series go through topics such as teambuilding and past event results, so if you’re more interested in data which is directly related to gameplay, do check those out! This story is the first part of the A3 x Spotify data series, which gives an overview of the Spotify data which I collected in Part Zero: Spotify’s API for non-coders!

Before we begin, open the A3! Spotify Song Data spreadsheet for the raw data, the Tableau workbook for the interactive data visualizations and maybe the A3! playlist for ambience…

Data Collection

My analysis included nearly 300 songs from 4 A3-related Spotify playlists, which cover the official Spotify playlist, Spotify songs with English versions of the song titles (to account for international fans), song instrumentals, and music from the stage adaptation of A3, Mankai Stage. The data was collected in July 2021, and here are the playlists:

A3! Songs from Spotify
A3! Instrumental Songs
Mankai Stage Songs
A3! Songs with English titles

Interestingly enough, this stage didn’t take quite as long as I expected… First, I searched a Kaggle dataset of Spotify songs for A3! songs in the hopes that I wouldn’t have to extract the song data myself. Unfortunately, only the artist data was available as the dataset covered more than a million artists but only about 600 thousand tracks. The dataset was extremely interesting, however, and I might revisit it someday!

The dataset also revealed that A3! was considered as a Spotify genre for some reason, which made searching for artists much simpler. After filtering for the “A3” genre, I managed to extract this table from the huge dataset.

Artist Data from Kaggle.

The table shows each artist’s unique Spotify ID, followers, genres, popularity and name. I created the Readable Name field by converting the raw Unicode text to Japanese characters.

Next, I tried out a few websites which featured Spotify playlist analysers and automatically generated charts based on them which worked very well. However, some of the data was still missing so in the end I used Spotify’s API to obtain as much raw song data as possible. The API returned the data in JSON format, which I converted to a spreadsheet using an online converter. Finally, I cleaned up the data to include only the relevant variables in the A3! Spotify Data (Combined) sheet, and made charts from that table (do zoom out as they are quite big). For more details about how I used Spotify’s API without writing a single line of code, check out my guide to Spotify’s API for non-coders!

This looks a lot less scary if you open the full spreadsheet…

Data Visualization with Tableau

Before we jump into the combined data, let’s take a look at what I got from the Kaggle dataset, which primarily contained A3 artist data. Do note that the dataset doesn’t cover the 2021 song releases while the combined data from Spotify’s API does.

Click to see the full charts!

Something that made analysis by artist really difficult was how A3’s Spotify artists are often based on individual characters or the role they’re playing as in a song, which resulted in a really long list of artists. The A3ders immediately stand out as the most popular artist, probably because their songs are the theme songs for the game and anime and hence the most recognisable in the entire franchise (Any A3! fan would be very familiar with “Yume o ippai sakaseyou, kimi to PAPPATTOPATTO PATTO☆ MANKAI!”…) According to the Kaggle Dataset, Summer Troupe is the next-most popular A3! Spotify Artist, followed by Banri Settsu, which I guess makes Mr “Super Ultra Easy Mode” A3’s popular solo artist. However, in terms of followers Mankai’s gamer-in-chief Itaru Chigasaki has the crown for most followed solo artist while the A3ders retain the overall crown. Considering how terrifying ranking for Itaru’s events gets… I’m really not surprised by the follower count. The other three charts just track album release dates, track count and show that in general the number of followers isn’t really correlated to an A3! artist’s popularity (R-squared value of 0.336 with slight correlation observed only for the more popular artists). The A3! Original Soundtrack album collects all of the in-game music, which explains its higher track count.

If you’ve been following this series of stories, you would’ve realised that I’ve used a mix of Google Sheets’ native charts and Tableau. However, most of the time I used Tableau simply for the prettier aesthetics, even though Google’s charts were perfectly serviceable. However, the Spotify dataset was much bigger than any of the other A3 datasets I’ve worked with, and it’s notable that it’s the first time in this project where I do a deep dive in data which I didn’t compile on my own (thank goodness for that). To answer why I defaulted to Tableau for the Spotify project, here’s what happened when I tried to make charts with Google:

Spaghetti charts…

… That’s way too messy. Coupled with the how setting the data range for each chart with Google Sheets was really troublesome, I decided to go with Tableau to create my visualisations. Here’s the dashboard which you saw at the beginning of the article:

Tableau Dashboard showing a basic summary of the songs. Visit the workbook to scroll through the charts!

This dashboard groups all the songs in the playlist by common metrics such as Troupe, Date, Mode (Major/Minor key) and Song Popularity, which was what I was the most interested in. We can see that Spring Troupe has the most songs so far, but that’s mostly because the dataset was collected shortly after the A3! SUNNY SPRING EP was released and before the other troupes’ EPs were released. Additionally, since the troupe count includes solo songs from each troupe’s members, it’s natural that Spring Troupe has more songs since Sakuya does sing a few extra songs (e.g. Monologue) as A3’s “main character” and point of entry to the franchise. The other three troupes have relatively similar discography sizes, while other groups such as mixed troupe songs and God-ZA’s songs complete the list. The “All Songs” and “A3! Music Drops” charts mostly serve as a directory for all the songs in the dataset. The interactive labels only work in the Tableau Workbook, so I hope you have it opened up somewhere by now! A3 has been steadily releasing songs on Spotify since the game was released in Japan in 2017, and the albums/EP releases typically follow the standard “Spring, Summer, Autumn and Winter” order. (“Kimi to mata haru natsu aki fuyu peeji o meku tara—” Right, sorry. Got carried away for a bit there…)

The dashboard didn’t show the colour legend for the “Keys by Mode” chart, so please note that Blue = Major key and Orange = Minor key! We can see that many of A3’s songs are in G major, which actually fits closely with Spotify’s most common key in general! Interestingly enough, the second-most popular key on Spotify was C major, but it’s only the fifth-most common key in A3’s discography. At this point I should probably note that I have absolutely no experience in music theory, so the most I could comment was that major keys sound happier in general which suited A3’s mostly-happy story. Another interesting thing I noticed was how the instrumental and studio versions of a song might not have the same key according to Spotify. For example, SCARLET GAME’s instrumental is classified as D♯ major while the version with vocals is in G♯ minor…

The “Keys by Troupe” chart is the same data coloured according to troupe, and it’s pretty cool to note that each troupe favours different keys! For example, you’ll find a lot of Winter Troupe’s songs in A# but barely any Autumn Troupe songs, and the reverse is true for F#. This probably helps to reinforce each troupe’s distinctive image, and the contrast between Winter Troupe and Autumn Troupe actually makes sense since Winter’s members are mostly “cool and mature” adults, while Autumn Troupe’s members are… very competitive ex-delinquents (Such variety in Mankai, amazing!). You’ll find more Spring Troupe songs in A or B keys, while Summer Troupe seems to have a fairly even distribution between the keys. All I know is that Spring’s songs have a pretty high likelihood of eliciting warm and fuzzy familial feelings, while Summer’s songs will “raise the vibes through the roof”, as Kazunari would say. (I think, I’m terrible at Kazu-speak.)

The “Song Popularity” chart is a ranking of how popular Spotify found each track. According to Spotify and this Spotify popularity analysis, song popularity is highly dependent on the number of times a song was streamed, as well as how recently they were streamed which more accurately captures what’s currently trending. The A3ders top the list with quite a few of their songs with a popularity level of 36, which pales in comparison to one of the most popular songs on Spotify at the time of writing (Bad Habits by Ed Sheeran), which had a popularity of 97. To be fair, A3 is one of the most popular games of its genre in Japan but the international server only has an average of 13,700 active players each event. Looking at the chart, we see two distinct clusters around single-digit popularity levels and levels in the twenties, which represent the instrumentals and normal versions of the songs. It makes sense that the instrumentals are much less popular than the version with one’s favourite character’s voice… additionally, the bulk of songs with a popularity level 17 seem to be from the Mankai Stage play adaptation of A3! Troupe distribution seems pretty even, and the unusual number of Spring Troupe songs with a popularity level of 0 would be because the SUNNY SPRING songs were only a few days old when the chart was made in July 2021. This table shows the updated track popularities as of September 2021:

Sorted by Track Popularity

It’s likely that the popularity ratings were boosted due to the songs’ newness, but it’s very impressive that SEEDS’ popularity is on par with quite a few of Autumn Troupe’s songs! The EP’s song popularity is also somewhat indicative of each character’s popularity: Chikage, Masumi and Itaru sung the top 3 songs in the table and they are amongst the most popular characters in A3. Meanwhile, Citron’s relatively lower popularity unfortunately continues in this sense too… Additionally, the colour intensity of the cells increased with number relative to the rest of the data set, further underscoring the popularity difference between studio and instrumental songs.

While we’re on the topic of popularity, the two pictures below form my quick analysis of how A3’s character popularity changed in the first year of the English server. The left picture shows the raw data from Aimu Sora’s Popularity Poll when A3! EN was released in 2019 and 2020 A3! EN Player Base Reddit Survey, which was conducted by a fan and collected 704 responses.

Short analysis of A3! EN character popularity from 2019–2020.

We can see how the characters’ popularity changed over time (even though there might be differences between the populations surveyed by each poll), and we can expect that the character and song popularities will continue to change over time (except for Itaru who probably won’t relinquish his crown anytime soon)! For example, I expect that Chikage’s popularity rank would be much higher now, given that the EN server has known his character for nearly a year and considering how high his SEEDS’ popularity was. His first solo, Petenshi no Yuutsu, also registered a higher-than-average popularity level of 27. Meanwhile, underrated characters such as Citron and Tasuku still need more love… although it should be noted that Citron’s songs might be a bit of an acquired taste with the slightly-childish feel and very butchered Japanese. (Dear Liber, please let him sing a solo song properly someday like what he did for Yoi no Mikazuki…)

Analysing A3’s Spotify Audio Features

Spotify included a lot of song metrics in the API data such as time signature, duration, tempo, and a few curious measurements known as “audio features”. I found an article which analysed Eurovision songs (time to push my Eurovision agenda) and included a few descriptions about what these metrics measure. Meanwhile here’s what I found from Spotify (You might recognise this explanation from the raw data spreadsheet’s introduction page, and if you don’t do check it out):

  1. 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.
  2. Valence: Describes the musical positivity 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).
  3. Energy: 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.
  4. Tempo: The overall estimated tempo of a track in beats per minute (BPM). In musical terminology, tempo is the speed or pace of a given piece, and derives directly from the average beat duration.
  5. Loudness: The overall loudness of a track in decibels (dB). Loudness values are averaged across the entire track and are useful for comparing relative loudness of tracks.
  6. Speechiness: This detects the presence of spoken words in a track. The more exclusively speech-like the recording (e.g. talk show, audio book, poetry), the closer to 1.0 the attribute value.
  7. Instrumentalness: Predicts whether a track contains no vocals. “Ooh” and “aah” sounds are treated as instrumental in this context. Rap or spoken word tracks are clearly “vocal”.
  8. Liveness: Detects the presence of an audience in the recording. Higher liveness values represent an increased probability that the track was performed live.
  9. Acousticness: A confidence measure from 0.0 to 1.0 of whether the track is acoustic.
  10. Key: The estimated overall key of the track. Integers map to pitches using standard Pitch Class notation . E.g. 0 = C, 1 = C♯/D♭, 2 = D, and so on.
  11. Mode: Indicates the modality (major or minor) of a track, the type of scale from which its melodic content is derived. Major is represented by 1 and minor is 0. (I converted these to the more readable alphabetical scale, e.g. A♯ major.)
  12. Duration: The duration of the track in milliseconds.
  13. Time Signature: An estimated overall time signature of a track. The time signature (meter) is a notational convention to specify how many beats are in each bar (or measure).

Short version of what each variable measures:

  1. Mood: Danceability, Valence, Energy, Tempo
  2. Properties: Loudness, Speechiness, Instrumentalness
  3. Context: Liveness, Acousticness
  4. Segments, Tatums, Bars, Beats, Pitches, Timbre, and more (I won’t be using this, since my focus here is on comparing songs instead of analysing individual songs.)

Now that we’ve gotten the complicated explanations out of the way, let’s take a look at the results!

Summary of Audio Feature Data
  1. Average by Metric: This chart tries to get a general sense of each troupe’s characteristic sound (e.g. Autumn Troupe has a lot of rock songs) by comparing the troupe average for each metric with the others (measured on a scale from 0 to 1, 1 being the highest presence of that metric). In general, most of the database’s songs weren’t instrumental (makes sense since instrumental songs accounted for less than half of the tracks), acoustic or “speechy” (also makes sense, A3 doesn’t have a lot of rap). The A3 tracks on Spotify were mostly studio versions, which also explains the low liveness score. Danceability and valence weren’t super high on average, which was pretty interesting since I thought that they’ll be higher given the relatively high energy levels of A3’s songs. A closer look at how the metrics were calculated helped to explain things. For example, danceability relies on how regular a song’s beat is, and most of A3’s songs aren’t super repetitive in general. Valence more or less measures the “general vibe” of each song, and even though A3’s mood is largely positive (the high valence score for the full-troupe songs shows this), there are quite a few songs which would be considered as rather melancholy, especially those which were based on a play (stares pointedly at Winter Troupe). We do see that Spring and Summer were seen to have more positive songs compared to Autumn and Winter! Autumn’s relatively lower valence was probably because of the aggressive tone of many of its songs…
  2. Average by Troupe: This chart has the same data as the previous chart, but this time the average scores are grouped by troupe to give a clearer picture of each troupe’s sound. Based on the point distribution for all the groups, we can see that the troupes share a pretty similar base DNA for their songs, with pretty small differences in their average metrics. Guess that makes sense since many of the songs are in the same Spotify genre (J-Division)! My take on each troupe’s sound: Spring is a warm and fuzzy family, Summer is a party, Autumn is a raging rock band and Winter harmonises like a choir…
  3. Time Signature: Note that the numbers show the number of beats per measure! The majority of A3’s songs have 4 beats per measure, similar to most songs on Spotify. There’s also quite a few songs with 8 beats per measure, a small number with 3 beats per measure, and then there’s The Contract (6 beats) and Troymailai to Kuhaku (1 beat) as the outliers. Is Spotify’s assessment accurate…? Honestly, I can’t say. I really don’t know music theory. At all. Oops.
  4. Tempo, Track Duration and Popularity: We’ve got 3 scary-looking charts here, but actually they’re all saying the same thing: These three variables aren’t really correlated. Most of A3’s songs last for around 4 minutes and fall in the 100–150 BPM range. The charts do show a neat way to distinguish what a song’s type is. For example, songs with low popularity are more likely to be instrumentals, and songs with unusually high durations (e.g. 14 minutes) are most likely from the stage adaptation where a song can last for the entire scene. I couldn’t really find a lot of troupe-specific trends, although I think I can say that Winter Troupe’s songs might have a tendency to be slower on average.

My attempt to find any sort of correlation between any of the metrics result in this horrifying scatter plot matrix (be warned that Tableau might lag if you try to load the chart)! So… did I find anything?

Scary scatter plot matrix

In short the answer is no, there weren’t a lot of particularly strong correlations. However, splitting the trendlines up by major/minor key did show that the key a song is in would affect certain correlations! The Instrumental against Energy chart (second row, fifth chart from the left) shows a particularly striking trendline difference, although the large difference in sample sizes for major and minor songs might’ve influenced the distributions.

So… what’s the verdict, doc? What makes an A3! song popular? We’ve seen how a song’s popularity is probably more reliant on who’s singing the song rather than the song itself… and I guess that’s all I can really conclude for now! This project has taught me a lot about processing slightly larger datasets and APIs, and it’s been a lot of fun! The next stop would be to try analysing individual songs to see what makes them tick, but that’s a story for another day… if you’re still with me, thank you so much for reading this and I hope you’ll come to love A3’s songs too! Perhaps one day you’ll recognise this too:

Yaa meguriaeta ne
Youkoso MANKAI KAMPANII~(Pa pa pa, patto mankai pa pa pa, patto MANKAI!)”

--

--