How Music Affects Our Emotions¶

Many people are increasingly experiencing mental health challenges and overall mood changes around the world. We try to find solace and relief from daily struggles. Something that is accessible to many and can be used whenever is music, whether it be in your headphones or one is makng the music themselves.

Although an everyday activity that could be looked over, music does induce emotions in people. It affects us all. Communities have been built around it, using it to voice their opinions and express their emotions.

It has been shown to reduce anxiety improve cognitive function. I want to analyze how each music genre makes one feel, and how this could be used as a sort of therapy for someone who lacks one type of emotion from their day. I want to see what music does to people and study its valuableness.

My dataset was taken from a game called emotify, which has a purpose of evoking emotion from the participants with music. It is comprised of 400 songs that are one minute long. The website is linked here. it is along the sound files that were used in the game.

In [1]:
import pandas as pd

# load data
df_emot = pd.read_csv('music_annotations.csv')

df_emot.head()
Out[1]:
track id genre amazement solemnity tenderness nostalgia calmness power joyful_activation tension sadness mood liked disliked age gender mother tongue
0 1 classical 0 1 0 0 0 0 1 1 0 3 1 0 21 1 English
1 1 classical 0 0 0 1 0 0 0 0 0 3 0 1 41 1 Dutch
2 1 classical 0 0 0 1 0 0 0 0 1 3 0 0 24 1 English
3 1 classical 0 0 0 0 1 0 0 0 0 3 0 0 32 0 Spanish
4 1 classical 0 0 0 1 1 0 0 0 0 4 0 1 21 0 English

Each row in this dataset is an entry of someone listening to a music file. Here is a dictionary of the dataset:

  • track id: the music file id that was listened to
  • genre: genre of the music file
  • the next 9 features are emotions: for each, 1 means it was felt. 0 means it was not felt.
    • amazement: happiness feeling
    • solemnity: inspiration, thrill feeling
    • tenderness: affection, love feeling
    • nostalgia: dreamy, melancholic feeling
    • calmness: relaxation, serenity feeling
    • power: strong, heroic feeling
    • joyful_activation: dancy, bouncy feeling
    • tension: nervous, irritated feeling
    • sadness: depressed feeling
  • mood: participant's mood before playing the music file.
  • liked: if participant liked the song. 1 meant they liked it. 0 meant they did not like it.
  • disliked: if participant disliked the song. 1 meant they liked it. 0 meant they did not like it.
  • age: age of the participant.
  • gender: gender of the participant. 1 is one gender. 0 is the another gender. what each one is was not disclosed.
  • mother tongue: participant's native speaking language.

In this project, we will cluster music genres/music files that induce similar categories of emotions. This can help us study music in a different way than strict genre, but rather a type of music that provokes an emotional response that can be used to balance or change one's mood.