They called it the black song. For the humpback whales of eastern Australia, it was irresistibly catchy.

Back in the mid-1990s, those whales were singing a completely different tune—a melody known to researchers (for arbitrary reasons) as the pink song. But in 1995, a small number of humpbacks from the west of the continent made it over to the east, bringing a foreign tune with them. That tune—the black song—was a viral hit. Within three years, it completely replaced the pink one, which has never been heard again. It then dominated the humpback charts for another couple of years. It was remixed, creating the gray song. And it too was eventually ousted by another tune.

Michael Noad from the University of Queensland discovered these musical revolutions in 2000 by analyzing recordings of singing humpbacks, captured with underwater microphones dangled off the side of boats. These recordings revealed that during the time when the pink and black songs were vying for dominance, most humpbacks sang either one or the other. But a minority—just three out of 112—sang hybrid tunes, mixing leitmotifs from both the outgoing melody and the incipient one.

Noad’s former student Ellen Garland has also discovered another of these rare hybrid singers. And they, she thinks, provide important clues about how these beautiful animals learn and tweak their mesmeric melodies.

Today, the songs of humpbacks are famous. They fill the halls of spas and they’ve been satirized by Pixar. But fifty years ago, they were largely unknown. That changed in 1968, when scientist Katy Payne and her then-husband Roger took a trip to Bermuda and met a Navy engineer who had been inadvertently recording the whales. “Tears flowed from our cheeks,” Payne later told NPR about the first time she heard the recordings. “We were just completely transfixed and amazed because the sounds are so beautiful, so powerful—so variable.”

The Paynes showed that the calls have a structure that strongly resembles human songs, that they change dramatically and irreversibly over time, and that they even contain repeated elements akin to human rhymes. Roger also released some of his own recordings in an album that became a surprising smash-hit, helping to spark the Save the Whales movement and ultimately leading to a ban on whaling.

It’s only male humpbacks who sing, and they only do so during the breeding season. “We aren’t sure whether it is for attracting mates or repelling rivals but it has something to do with mating,” says Ellen Garland. The songs are hierarchical. Single sounds—units—are grouped into phrases, which are repeated to form themes, which are delivered in a specific order to create a song.

At any given time, all the males in a population sing the same song, but those songs also change. Like jazz musicians, males riff off the classics, making small tweaks as they go. And occasionally, they throw the current song out the window and take up a completely new one—revolution, rather than mere evolution. “We think that the males change their songs to be a bit different to other whales around them, and be more attractive to the ladies,” says Garland. “This is then reeled in by the need to conform, which is the same as with humans. In our society, when a new fashion appears, a few savvy people embrace it and everyone else quickly follows.”

In 2011, Garland and Noad showed that these revolutions take place very quickly, and across entire oceans. Like “cultural ripples,” songs that arise in one end of the Pacific can spread to the other within a few years, “This is incredibly quick,” says Garland, “as whales need to learn all the intricacies of the new song.”

To understand more about how this process happens, Garland and her team analyzed recordings that caught humpbacks in the act of switching songs. These mash-ups, where the whales were blending both old and new melodies, were so rare that the team had only recorded five in over 20 years of fieldwork—and one was too poor in quality to use.

Still, the other four hybrids revealed a clear pattern: The humpbacks were combining themes from both old and new songs, but leaving each individual theme largely untouched. Sometimes, they sang a transitional phrase to bridge the gap between the two segments. Sometimes, they melded one song into another at places that were musically similar, like the world’s largest deejays.

To the team, this suggests that whale don’t learn their songs as a whole (which makes sense, given that they can last for up to 30 minutes). Instead, a male humpback will progressively learn a new song by memorizing its themes and combining them with older ones. This is called “chunking” and it’s how human children learn languages and songbirds learn songs. Perhaps something similar is going on in the brains of all these species.

But Eduardo Mercado III from the University of Buffalo notes that it’s not clear from the recordings if the whales are genuinely learning new material, or simply flubbing their lines. “There is no way to really know,” he says, “but I definitely agree that humpback whales are an important species to study in terms of trying to understand vocal learning. We humans are the only terrestrial mammals that do anything remotely similar to singing humpback whales.”

There are other similar examples in the ocean, though. In sperm whales and killer whales, different clans have their own specific dialects, which individuals learn from those around them. “The evidence is clear that cetaceans show some of the most sophisticated cultural behavior outside of humans,” Garland says.