Music is considered to play a significant part in how humans feel emotion while influencing mood, culture and identity. In the current age of so many music streaming platforms, data-driven insights enable us to measure the moods and characteristics of songs on a scale. This project investigates the emotional and structural properties of music tracks using a dataset of Spotify songs. By focusing on musical features such as valence ( a measure of emotional positivity), danceability and speechiness, this study aims to answer:
How does track duration affect the daneability, and how does valence influence that relationship?
What are the most emotionally positive or negative genres, and how popular are they?
How do individual tracks differ in mood and lyrical style ( spoken vs melodic)?
These questions shed light on how digital music data can offer nuanced insights into mood, structure, and listening preferences. Identifying these patterns can benefit artists, playlist curators, and product designers while working on music recommendation systems.
Data and Methodologies:
The dataset used for this project is a cleaned version of the Spotify API dataset. Some key variables include valence, danceability, duration in milliseconds, speechiness, popularity, genre, and track name. The data was cleaned in Google Sheets to remove duplicates and filter the tracks to the top 50 genres.
Three Tableau visualisations were created to represent different areas:
Scatter Plot: Used to examine the relationship between duration, dancebility and valence
Treemap: Used to compare average valence across music genres by popularity.
Bubble Chart: Used to visualise individual track-level variation in valence and speechiness
Scatter Plot: Duration vs Danceability
The scatterplot focuses on the relationship between a song’s duration and its danceability. Each point represents the average values, with track duration ( in milliseconds) on the x-axis and danceability on the y-axis. Color is used to show average valence; songs with a lower value of valence tend to sound more melancholic or somber and are seen in tones of red, while the songs with higher valence values tend to sound upbeat and happy, which are seen in tones of blue.
This visualisation was illustrated in Tableau by positioning the average duration in the column shelf and the average danceability on the rows shelf. Valence was added to the color mark, and a trendline was included to examine any correlation between duration and danceability.
Based on the trend lines, there was a slight negative correlation, suggesting that shorter tracks are slightly more danceable. In this case, the relationship is statistically significant where the p-value = 0.0266, and the R-squared value is 0.0098, which argues that track duration accounts for less than 1% of the variation in daceability, hence putting forward the idea that while the trend exists, it is subtle.
Further analysing the graph, there is a noticeable cluster of short and highly danceable tracks that are also high in valence ( this is seen in the top left corner of the chart with many blue dots). These are likely the upbeat, feel-good tracks that are typically used for short-form content such as TikTok and Instagram reels.
On the other hand, the longer songs are seen to be less danceable, have a lower valence with redder tones, and are positioned lower in the plot. This suggests that emotionally driven songs tend to be less danceable.
It is interesting to note that songs with high valence values and danceability are clustered around shorter durations. This trend may suggest that platforms and listeners are drawn to songs that are shorter and, at the same time, emotionally uplifting and highly danceable.
Tree Map: Emotional Positivity by Genre
The treemap visualizes the relationship between valence (emotional positivity) and the popularity of music genres. It highlights the top 20 genres by popularity. Each tile’s size corresponds to its popularity. The color reflects the average valence, where warmer tones indicate a lower value and songs sound more melancholic, and cooler tones suggest a higher valence, representing a more upbeat and cheerful mood in the music.
Upon analysing the treemap further, the ambient and progressive house genres were the most prominent, with high valence values indicating cooler tones. These genres typically carry soothing and feel-good energy. Genres like pop and electronic music also stood out in size and valence values, which suggests their broad appeal and tendency to maintain a positive tone.
On the contrary, genres such as emo, metla, and those explicitly labeled “sad” displayed lower valence values, underlining more introspective or emotionally intense soundscape. These genres tend to sound less favourable in emotional tone but still hold significant cultural and emotional relevance for listeners.
The treemap constructively embelleshes emotional tone and popularity vary across genres. Interestingly, a genre’s popularity does not correspond with the valence (emotional positivity), suggesting that some of the most emotionally intense or melancholic genres may not be the most upbeat. However, they still seem to resonate with many people.
Bubble Chart: Valence and Speechiness by Track
The bubble chart explores the relationship between valence ( emotional positivity) and speechiness - how much a song resembles spoken word - at the individual track level. In this case, each circle depicts a unique song, where the color encodes valence (red for lower valence/ sadder tones and blue for higher values of valence/happier tones), and size represents speechiness, where larger bubble are assigned to songs with more spoken-word elements, such as rap and or spoken interludes.
This visualisation was created in Tableau by placing the track names on detail, speechiness on size, and Valence on color. A circle mark type was used, and a few notable tracks were labeled to enhance readability and draw attention to outliers or representative examples.
The bubble chart discloses how emotional tone and lyrical delivery vary widely across songs. Songs that are word-heavy, such as those with rap, spoken poetry, or experimental audio, are generated as larger red bubbles, which mirror the high speech levels and the tense or somber mood. Alternatively, smaller blue bubbles represent less speech-like tracks that carry more melodic, upbeat, or cheerful emotional tones, such as pop or dance tracks.
Something interesting to note is the visual clustering of emotionally optimistic songs with lower speechiness, which suggests that highly melodic tracks typically carry a lighter, happier feel. However, tracks with heavy spoken word components likely lean further towards emotionally intense or contemplative themes.
The chart offers a more engaging perspective on how mood and vocal performance intersect in music. It emphasises how the emotional and lyrical characteristics of individual songs contribute to their overall listening experience.
Software
Tableau: Used as the primary visualization tool to create interactive visualizations and dashboards that analyze the relationship between valence, energy, tempo, mode, and popularity in music.
Google Sheets: Utilized for data cleaning and preparation, ensuring the dataset was properly structured before importing into Tableau. This included handling missing values, normalizing numerical attributes, and refining categorical data.
Future Potential
There is scope to expand this project by:
Exploring change in valence and danceability trends over time
Comparing mood metrics across countries or languages
Analysing listener engagement or skip rates based on emotional tone
This project illustrates how music analytics can provide deep insight into songs' emotional architecture and modern music consumption preferences.