Singing fish actually exist – and these are not the kind that people see in cartoons or children’s movies, too. The plainfin midshipman fish sound like a bunch of kazoos, and people on boats in the San Francisco Bay area have had to get used to a low humming sound at night that stops when daylight approaches.

Porichthys notatus, as its scientific name is, has a specific reason for singing. The male fish use them to try to mate, while the females only grunt in response. The unusual sound has been likened to “an orchestra full of mournful, rasping oboes,” according to the San Francisco Gate in 2004.

Researchers from Cornell University believe they have finally discovered what causes the strange melody: melatonin. Melatonin, a hormone naturally produced by plants and animals, is released at night, the Washington Post reports.

In animals – like humans – that sleep a night, melatonin is believed to control the internal body clock, telling the rest of the body that it’s tie to sleep. Some have even found a treatment for insomnia in taking melatonin supplements before going to bed.

But how melatonin functions in vertebrates that come alive at night has been unclear. Nocturnal animals do make melatonin when night comes, meaning it doesn’t put them to sleep.

The new study suggests that melatonin may be more of a trigger to signal night-specific behaviors, including prompting midshipman fish to sing.

“Our results, together with those of others that also show melatonin’s actions on vastly different timescales, highlight the ability of hormones in general to regulate the output of neural networks in the brain to control distinct components of behavior,” Andrew Bass, the lead author, says. He explains that with melatonin in particular, “one hormone can exert similar or different effects in diurnal vs. nocturnal species depending on the timescale of action, from day-night rhythms to the duration of single calls.”

The researchers tested how melatonin works by keeping the fish in total darkness and in constant light. In the dark, the fish carried out their same routine, but in the light, there was no singing. The researchers then gave the fish in the light an artificial melatonin boost and they suddenly began singing, though at irregular times.

The study was published in Current Biology.