The melancholic song of humpback whales could really be an indication of loneliness.

Scientists who tracked these cetaceans in Australia noticed that fewer whales were singing to find a mate as their populations increased.

“The song of humpback whales is shrill and travels great distances in the ocean,” said marine biologist Rebecca Dunlop, who has studied these animals that breed near the Great Barrier Reef for more than two decades.

With the number of whales rebounding remarkably thanks to the end of their commercial whaling, Dunlop observed the unexpected.

“It’s getting harder to find singing whales,” said Dunlop, who works at the University of Queensland, Brisbane campus. “When there were fewer of them, many sang; Now that there are enough of them, they don’t have to sing so much”.

Scientists began listening to and studying humpback whales’ elaborate melodies with new underwater microphones in the 1970s. Only male whales sing, and it is believed that they do so to attract females to mate and reassert their dominance.

The humpback whales of eastern Australia faced regional extinction in the 1960s, when their population dwindled to around 200. However, their numbers increased, reaching 27,000 in 2015, a level believed to be close to what they were before their hunt.

The whales modified their courtship as their numbers increased. In 2004, two in 10 males uttered a song, and a decade later the proportion had dropped to one in 10, Dunlop and his colleagues said in Thursday’s issue of the journal Nature Communications Biology.

Dunlop surmises that the song played an enormous role in attracting mates when the whale population was severely depleted.

It was difficult to find other whales in the area because there weren’t many, he said.

When whales live in denser populations, a male looking to mate also has to avoid competition, and the song can alert other suitors, he explained.

“When their population recovers, the animals change their behavior and face different difficulties,” said marine biologist Boris Worm of Canada’s Dalhousie University, who was not involved in the study.

Surely the noise persists in the seas. In their courtship, many humpback whales combine singing and physical jostling, according to Australian researchers.

The large increase in the animals during the time of the study provided a unique opportunity to take a look at their behavioral changes, said Simon Ingram, a marine biologist at the University of Plymouth in England who was not involved in the study.

Ingram noted that although humpback whales had been singing long before hunting decimated them, the new study highlights that their elaborate, beautiful song was crucial to their survival and recovery.

“It is clear that their singing was incredibly valuable when their numbers were very low,” he said.