This chart would be familiar to music psychologists, who often visualise feelings in terms of valence and energy (or ‘arousal’), and divide them into quadrants based on four basic emotions: sadness, happiness, anger and calm. Sad songs (low valence, low energy) appear in the bottom left corner of the chart, happy songs (high valence, high energy) in the top right, angry songs (low valence, high energy) on the top left and calm songs (high valence, low energy) in the bottom right.

On the whole, number one hits tend to be pretty cheerful – the happy corner has by far the most songs. The most upbeat are Hey Ya!, Macarena (hey!) and Brown Sugar by The Rolling Stones. Don’t Worry, Be Happy is the calmest, most chilled-out song. Eminem’s Lose Yourself is off on its own in the angry quadrant. It’s not shown on the chart, but happier songs tend to be more danceable. And the most danceable number one? It’s Ice Ice Baby by Vanilla Ice, which I can totally get behind. But let’s look at what Spotify’s algorithm considers the most miserable songs, down in the sad corner.

Five saddest Billboard number one songs

1958-2018, based on valence and energy data from Spotify

1. The First Time Ever I Saw Your Face – Roberta Flack (number 1 in 1972)

2. Three Times a Lady – Commodores (1978)

3. Are You Lonesome Tonight? – Elvis Presley (1960)

4. Mr Custer – Larry Verne (1960)

5. Still – Commodores (1979)

The saddest song ever to top the charts since 1958, according to the data, is The First Time Ever I Saw Your Face by Roberta Flack, which was number one for six weeks in 1972. It is not a sad song. It is a tender, soulful love song. Three Times a Lady by the Commodores is also a slow love ballad and Mr Custer is a comedy song about a soldier who doesn’t want to fight. Of the five ‘saddest’, only the Elvis track and Still, another Commodores track, could really be described as sad songs. The algorithm is definitely on to something, but it’s not brilliant at coping with Lionel Richie.

Lyrics clearly have a big impact on the mood of a song. The Spotify data appears not to take account of them, although the Radiohead ‘gloom index’ and the other studies do find a way to quantify lyrical sadness using sentiment analysis. So what is the Spotify data based on? They don’t release any information about this, so I ask Glenn McDonald, the company’s Data Alchemist. Yes, that’s his real job title. He’s the man responsible for Every Noise at Once, a visualisation of all 1870 music genres classified by the streaming platform, from ‘deep filthstep’ to ‘Belgian indie’.