Data Visualisation, Information VisualizationWhat makes a song feel happy? Is it the tempo, the energy, or the key it's played in? This project dives into the emotional positivity of music (valence), exploring how different attributes—energy, tempo, mode (major/minor), and popularity—shape our perception of happiness in songs.
Is there a significant relationship between valence (happiness/sentiment of music) and musical attributes such as energy, tempo, mode, and popularity in songs people listened to in 2019?
This project utilized a cleaned Spotify dataset containing detailed musical metadata, including valence (happiness score), energy, tempo, mode (major/minor), and popularity. The dataset provided a structured way to analyze how these attributes influence the emotional perception of music.
To explore these relationships, the data was imported into Tableau, a powerful visualization tool, to create interactive and insightful graphics. The dataset was processed to ensure consistency, with numerical values normalized where necessary to maintain accuracy.
Three key visualizations were developed to investigate different aspects of the research question.
This bar chart visualizes the valence scores (happiness) of songs across different artists, segmented by mode (Major vs. Minor). The blue bars represent songs in Major mode, while red bars represent songs in Minor mode.
Key Observations:
Artists with higher valence scores in Major mode: Some artists, like Marshmello and Jonas Brothers, have songs with consistently high valence scores in both major and minor modes, indicating they produce generally upbeat music.
Artists with lower valence scores in Minor mode: Some artists, such as Billie Eilish and Post Malone, show a trend where their minor-key songs tend to be less happy, reinforcing the emotional association of minor keys with sadness or melancholy.
Variation in Valence Across Artists: Some artists demonstrate a strong contrast between their major and minor mode songs, while others remain relatively stable across both modes.
Analysis:
This graph provides insight into how artists use musical mode to shape emotion in their songs. While Major-mode songs generally have higher valence (happier sound), there are exceptions, showing that other musical factors like tempo and energy might influence the perception of happiness in music.
This scatterplot analyzes the relationship between energy levels and valence scores, with songs divided into Major (blue) and Minor (red) modes. The x-axis represents energy score, and the y-axis represents valence (happiness score). A trend line is included to highlight the correlation.
Key Observations:
Positive Correlation Between Energy and Valence: As the energy score increases, the valence score also increases, suggesting that higher-energy songs tend to be perceived as happier.
Major Mode Songs Have a Stronger Happiness Trend: The blue dots (Major mode songs) show a clear positive slope, reinforcing that major-key songs are generally higher in valence.
Minor Mode Songs Show More Variability: The red dots (Minor mode songs) still show a positive trend, but the relationship is less pronounced compared to Major mode. This suggests that minor-key songs can still be energetic but may not always be perceived as "happy".
Lower Energy Songs Are More Spread Out: At lower energy levels, there is more variation in valence scores, meaning low-energy songs can be either happy or sad. However, at higher energy levels, valence scores tend to be more consistently positive.
Analysis:
This graph confirms that energy is a strong predictor of perceived happiness in music—higher-energy songs are generally happier, but mode still plays a role. While the trend is similar for both Major and Minor modes, the difference in slopes suggests that Minor-mode songs may require additional factors (like tempo or lyrics) to feel positive.
This scatterplot analyzes the relationship between danceability and valence (happiness score), with songs divided into Major (blue) and Minor (red) modes. The x-axis represents danceability, while the y-axis represents valence. A trend line is included to highlight the correlation.
Key Observations:
Positive Correlation Between Danceability and Valenc
As danceability increases, valence also increases, indicating that more danceable songs tend to be perceived as happier.
This aligns with the expectation that rhythmic, easy-to-dance-to music is often associated with positive emotions.
Major Mode Songs Show a Stronger Happiness Trend
The blue dots (Major mode songs) display a clear positive slope, reinforcing the idea that major-key songs tend to be happier when they are highly danceable.
Minor Mode Songs Still Show a Positive Relationship
While Minor mode songs (red dots) also exhibit an upward trend, the correlation appears slightly weaker than in Major mode.
This suggests that while danceability contributes to happiness, other factors (like lyrics or melody) might still influence the emotional perception of minor-key songs.
Less Danceable Songs Have More Variability in Happiness
At lower danceability levels, valence scores vary widely, meaning that some less danceable songs still feel happy, while others feel sad.
However, as danceability increases, valence scores become more consistently high, reinforcing that danceable music is often associated with positive emotions.
Analysis:
This graph confirms that danceability is a strong predictor of perceived happiness in music—songs that are easier to dance to tend to feel happier. However, the mode still plays a role, with Major mode songs showing a slightly stronger correlation between danceability and valence. While high danceability often aligns with higher happiness, Minor-mode songs may still carry other emotional elements (like lyrics, melody, or chord progressions) that impact their perceived mood. This suggests that while a strong rhythm can contribute to an uplifting feel, other musical elements still influence a song’s emotional reception.
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
This project has the potential to expand in several directions, offering deeper insights into musical emotion and audience preferences:
Year-over-Year Trends: Analyzing how happiness in music has evolved over time, exploring whether certain musical trends (e.g., higher-energy songs) have become more or less popular.
Geographical Analysis: Examining regional differences in song valence—do certain countries or cultural groups prefer happier or more melancholic music?
Genre-Based Insights: Investigating whether different music genres (e.g., pop, rock, hip-hop) have distinct valence-energy relationships.
Demographic Influence: Understanding how age, location, and listening habits affect song preferences—do younger audiences prefer high-energy, high-valence songs more than older listeners?
Predictive Modeling: Using machine learning models to predict a song's valence score based on its energy, tempo, and other attributes.
By expanding in these areas, this study could offer valuable insights for music streaming platforms, artists, and researchers looking to understand how music shapes emotions and consumer preferences.