LOS ANGELES -- If you find it hard to predict which songs are destined for pop-chart success and which will flop, try asking a computer.
After analyzing the attributes of more than half a million songs released over a period of 30 years, a computer algorithm was able to sort the successful songs from also-rans with an accuracy of up to 86 percent.
A team of mathematicians from UC Irvine described how -- and why -- it accomplished this feat in a study published in Wednesday's edition of the journal Royal Society Open Science.
"There is something magical about music," wrote the team, which was led by students Myra Interiano, Kamyar Kazemi and Lijia Wang. "Scientists have been trying to disentangle the magic and explain what it is that makes us love some music, hate other music and just listen to music."
For the purposes of the study, the UCI team considered a song a "success" if it made it onto the Top 100 Singles Chart in the United Kingdom between January 1985 and July 2015. They compared these successes with all other songs that were released in the U.K. during that time period.
To quantify the acoustic properties of these 500,000 or so songs, Interiano and her colleagues relied on crowd-sourced data from two projects of the MetaBrainz Foundation -- MusicBrainz and AcousticBrainz.
Sponsored Video Stories from Right-This-Minute
This data classified songs according to 12 acoustic properties, including whether they are sung by a man or woman, are happy or sad, and are acoustic or electronic, among other attributes. Songs are also categorized according to their mood and genre, such as hip-hop, blues, country and house music.
Less than 4 percent of songs in the entire sample found their way onto the Top 100 Singles Chart. To see what set these songs apart, they employed a machine learning method known as the "random forest" algorithm to crunch through all the data.
Sure enough, some noteworthy patterns emerged.
"Successful songs are happier, brighter, more party-like, more danceable and less sad than most songs," the team wrote.