Wherever you go around the globe, cultures have their own songs: songs of love, of lullaby, songs of war and dance. Now, a new study has found it's not just music itself that's ubiquitous. The same patterns can be found repeated in the same types of music, worldwide.

Using over a century's worth of research in ethnomusicology from 315 cultures, as well as a new collection of song recordings from around the world, scientists have performed a cross-cultural analysis of the similarities and differences in our music.

The research team found that the underlying structures and melodic elements of songs are similar worldwide, such that the behavioural context of a song can be predicted just by its acoustic features.

Arriving at this result took some truly impressive work. The researchers spent years scrounging archives and libraries and private collections to compile a comprehensive database of songs in order to conduct their comparison. They have called this database the Natural History of Song.

"We are so used to being able to find any piece of music that we like on the internet," said psychologist Samuel Mehr of The Music Lab at Harvard University.

"But there are thousands and thousands of recordings buried in archives that are not accessible online. We didn't know what we would find: at one point we found an odd-looking call number, asked a Harvard librarian for help, and twenty minutes later she wheeled out a cart of about 20 cases of reel-to-reel recordings of traditional Celtic music."

In all, they collected recordings of 118 songs from 86 cultures spanning 30 geographic regions. But this is only a small part of the Natural History of Song. The team also pored over a large ethnographic database of 315 cultures, looking for mentions of song. Every single culture had music described.

So, over 5,000 descriptions of songs, including over 2,000 translations of song lyrics, from 60 cultures across 30 geographic regions also went into the database.

Then came the hard work of cataloguing and analysing the songs. The researchers recorded detailed information about the songs - how long each song was, the time of day it was sung, how many singers, who the audience was, pitch range, tempo, key and other structural information.

They used a number of tools, including listener ratings, machine summaries, and expert transcriptions and summaries.

In the end, they had a comprehensive database they could cross-reference to understand how humans write music all around the world, with a particular focus on healing songs, love songs, dance songs, and lullabies.

"Lullabies and dance songs are ubiquitous and they are also highly stereotyped," said evolutionary biologist Manvir Singh of Harvard University.

"For me, dance songs and lullabies tend to define the space of what music can be. They do very different things with features that are almost the opposite of each other."

In previous research, the team found that even when they had never heard a particular song before, listeners were relatively accurately able to gauge when a song was a lullaby. This new research seems to support those findings - regardless of spoken language, humans have a universal language in song.

In fact, if you want to test your own ear in this regard, The Music Lab has a fun quiz you can play here to match songs up to their type.

There was, of course, some variation in the songs - for instance, some songs are more formal, some songs are more religious, and some songs more rousing; but this variety is more pronounced between the songs in each single culture. The underlying, cross-cultural similarities are stronger.

This, the researchers believe, means that there could be something about our brains that understands music on a universal level.

"We propose that the music of a society is not a fixed inventory of cultural behaviours, but rather the product of underlying psychological faculties that make certain kinds of sound feel appropriate to certain social and emotional circumstances," they wrote in their paper.

"Musical idioms differ with respect to which acoustic features they use and which emotions they engage, but they all draw from a common suite of psychological responses to sound."

It is, the team believes, a step towards finally unlocking and building a universal musical grammar, as well as understanding how our minds create and respond to music.

The research has been published in Science.