plamere / OrganizeYourMusic

Organize your saved music on Spotify
240 stars 39 forks source link

How is the Happiness track attribute determined? #12

Open DJLProjects opened 3 years ago

DJLProjects commented 3 years ago

This isn't a data point that Spotify API provides and I don't see happiness listed on the index of this tool.

How is the happiness of a track determined?

jtagcat commented 3 years ago

Do a quick Ctrl-F

                  track.feats.sadness=  (1 - audio_feature.energy) * (1 - audio_feature.valence);
                  track.feats.happiness = audio_feature.energy * audio_feature.valence;
                  track.feats.anger = audio_feature.energy * (1 - audio_feature.valence);