Why did this humble tune, first conjured by medieval farmers, capture so many people’s imaginations and even feature in The Addams Family? Andrea Valentino takes a look.

Checking the pop charts today is simple. Want to know the most popular artist on Spotify? Just a few clicks will take you to Ed Sheeran and his 72 million monthly listeners. What about the most popular song? The scruffy ginger-haired heartthrob strikes again. Sheeran’s Shape Of You was the first track to be streamed a bewildering two billion times. The numbers elsewhere are even more astounding. Luis Fonsi and Daddy Yankee’s Despacito has over 6.3 billion views on YouTube. 

More like this:

-       Back to Black: The millennial I Will Survive

-       What will music be like in 20 years?

-       Why The White Album is The Beatles’ greatest

But for all that, the internet can’t tell you everything. What, for example, is the most popular tune ever? Not the most covered song: that would be Yesterday by The Beatles. But rather the most enduring melody, a simple theme that has been shaped by countless hands. One of the strongest candidates is a tune few will recognise. Yet for centuries, La Folia has dazzled hundreds of composers and musicians, up to the present day. Its story tells us much about the history of music, and maybe even something about ourselves. 

Its name – ‘folly’ or ‘madness’ in Italian – refers to the frenzied way peasants twirled to the music

La Folia has a long history. Its distinctive chords first developed out of the folk music of late 15th-Century Portugal, where it was used in popular festivals. Its name – ‘folly’ or ‘madness’ in Italian – refers to the frenzied way peasants twirled to the music. In Santiago de Murcia’s Codice Saldivar No 4, Renaissance writer Covarrubias describes La Folia as ‘very noisy’ while another highlights its ‘vivacity and fire’, its dancers ‘making gestures that awaken voluptuousness’.

This ‘voluptuousness’ was apparently popular. A century after its invention, La Folia spread to nearby Spain and then across the Mediterranean. Like modern hits, it was first diffused by word of mouth. “There were a lot of Spanish musicians that worked in Italy, for instance at the Vatican,” explains Alexander Silbiger, Professor Emeritus of Music at Duke University. “The singers and musical directors were Spanish. That may have been a factor in its spread.” It helped, too, that Spain then ruled southern Italy, making cultural exchange between the two countries easier.

At the same time, musicians began bending La Folia to fit changing tastes. From about 1650, the hectic early tune mellowed into dignified middle age, slowing down and settling on a particular melody (earlier versions had been more fluid). This makes sense: the new Baroque spirit prided elegance and grace above random peasant frolics. Yet La Folia was lucky it changed. As Silbiger points out, other dance forms went out of fashion while “the madness” tumbled on past the French Revolution.

Between 1670 and 1700 alone, pieces borrowing La Folia were printed everywhere from Zaragoza to Berlin to Oxford

How popular was La Folia at its peak in the 18th Century? It’s hard to say for sure. Online statistics were still a way off and composers often referenced La Folia without naming it. Even today, you have to hunt around to learn that a cantata by Bach and a keyboard piece by Handel both used the theme. Simply searching for ‘La Folia’ is not enough. 

Still, there are clues that the theme was a genuine phenomenon. One hint is its vast geographical spread. Between 1670 and 1700 alone, pieces borrowing La Folia were printed everywhere from Zaragoza to Berlin to Oxford. By 1760, it had reached Mexico and Bolivia. Musicians themselves were just as enthusiastic. In the decade to 1710, around 20 composers tried taming La Folia, from Antonio Vivaldi to Arcangelo Corelli

La Folia on film

Perhaps all this has something to do with La Folia’s adaptability. The melody is basic enough that musicians can easily explore it in different ways, adding harmony or fiddling with the speed while always letting the original, haunting theme shimmer through. These so-called ‘variations’ on La Folia – especially popular during the Baroque period – are some of the grandest achievements in music. Corelli’s effort is particularly spectacular, the main violin spiralling on for 11 minutes and 23 variations of the original chords. No wonder aspiring violinists were once expected to learn Corelli’s Folia before they did anything else. 

Not that La Folia stopped with highbrow musicians. It has been used in a Swedish political ballad and a bawdy English opera. There is even some evidence it slipped back towards its peasant roots, influencing the folk songs of Finland and Norway. While the decline of Baroque music dulled some of its glamour, meanwhile, the theme survived right through the 19th Century. Beethoven, Berlioz, Brahms and Liszt all exploited the tune. Rachmaninoff did too, though he apparently thought Corelli had composed the theme himself.

There’s a tinge of the past, of the glories of Spain – it’s a haunting melody – Professor Silbiger

The theme flourishes even now. Apart from recording classic Folias, modern musicians are adapting the theme in striking new ways. Some have played unusual instruments, including the sitar and ukulele. Others have changed genre, swapping Baroque for metal and harpsichords for electric guitars. At the same time, the growth of cinema has opened another door. “La Folia has been used in films a lot of times before in different ways,” Adam Grannick, a film-maker and Folia devotee, tells BBC Culture. “There was a version of it used in The Addams Family. In the film 1492, the main theme is a version of La Folia.”

Grannick is something of an expert on the interplay between La Folia and cinema. In 2016, his team at Filmelodic used the variations by Francesco Geminiani, a contemporary of Corelli, as the backdrop for an experimental film. Over 12 minutes, it weaves together several stories – a ballet dancer preparing for a show, a mother accepting her daughter’s sexuality – all ebbing and flowing as the music spins from variation to variation. “The idea is that I trusted the music to make it work,” Grannick says. “In film there are certain rules of narrative arc you want to follow. But by following the dramatic arc of the music itself, I trusted that anything we did would bring the audience along.”

Critics agreed: Grannick’s film won best experimental short at the 2017 Manhattan Film Festival. Even so, the question remains. Why? Why did this humble tune, first conjured by medieval farmers, grab so many artists and never let go? Experts have their theories. John Williams, a classical guitarist from Australia, emphasises its austerity, writing on a record jacket that its simple melody means it’s “no surprise” La Folia has endured. Others are spurred by national pride. Andrés Segovia, another guitarist, called La Folia “Spanish to the core.” Silbiger feels similarly when he listens to it. “There’s a tinge of the past, of the glories of Spain,” he says. “It’s a haunting melody.”

On repeat

All good ideas, but what if they miss the point? What if the key to La Folia lies not in the score, or imperial nostalgia, but in the human mind? Elizabeth Margulis, a pianist and Professor of Music Cognition at Princeton University, thinks it could. Some years ago, she investigated a clarinet piece by Luciano Berio, a 20th-Century Italian composer. After loading the work into a digital editing programme, she artificially added repetition. 

Margulis then played the original Berio and her edit to volunteers. The results were intriguing. “It turned out that people liked the [altered] excerpts more, and thought they were more interesting,” she tells BBC Culture. Not only that. “They thought the music was more likely to have been written by a human artist, rather than [being] randomly generated by a computer, if we’d inserted some kind of repetition.” In other words, artificially adding repetition can make music seem more human, not less. 

When a composer picks up a theme and plays with it, toying with the harmonies or the instruments, we fall under its spell

In part, this phenomenon is an example of the ‘mere exposure’ effect. Humans are naturally suspicious of new ideas, but frequent contact can change that. This is true far beyond the concert hall. Scientists have found that “mere exposure” can soften our views on everything from political messaging to random geometric shapes. And though she hasn’t formally studied the tune, Margulis thinks the repetition inherent in so many Folias could “absolutely” explain their popularity. 

At the same time, the intricacy of most Folia variations could lend them to repeated listens. The exact same tune repeated over and over quickly gets dull. But when a composer picks up a theme and plays with it, toying with the harmonies or the instruments, we fall under its spell. As Margulis puts it, when a melody is “buried” it can “sustain longer engagement across multiple repetitions”. 

La Folia is surely proof of this: it has been passed down and used by countless musicians in their own way, like a family cookbook where everyone adds their own recipe. The point, though, is that the basic ingredients are always the same. In this way, La Folia spirals on to new things, unforgettable even at the start of its seventh century.

If you would like to comment on this story or anything else you have seen on BBC Culture, head over to our Facebook page or message us on Twitter.

And if you liked this story, sign up for the weekly bbc.com features newsletter, called The Essential List. A handpicked selection of stories from BBC Future, Culture, Capital and Travel, delivered to your inbox every Friday.