Most of us know what it's like to encounter an earworm, one of those songs that you just can't get out of your head. But as hard as it is to quell the echo of these songs in our minds, we aren't really hearing them. For some people who just can't stop the beat, though, the music playing in their minds is indistinguishable from reality—and sometimes very specific in genre.

In a recent review published in the journal Brain, researchers set out to figure out who has musical hallucinations and what conditions are most likely behind the phenomenon. The team combed through past reports of patients with musical hallucinations who were evaluated at the Mayo Clinic from 1996 to 2003 and found that musical hallucinations don't just crop up in connection to a bunch of different illnesses—they actually sound different depending on what condition is causing them. People with neurodegenerative diseases or hearing loss tend to hear religious or patriotic music, while those with brain damage hear modern music and people with psychiatric disorders hear different flavors of music depending on what mood they are in.

Music in the head

It's actually not uncommon to experience some kind of auditory hallucinations that involve simple sounds, like in tinnitus. Musical hallucinations on the other hand, are made of complex, well-developed sounds and are more rare; one study detected them in 0.16 percent of people admitted to the psychiatric departments of two hospitals.

Musical hallucinations have been linked to psychiatric and neurologic diseases, damage in the brain, drugs and hearing impairment. But sometimes people who hallucinate music have no known cognitive or psychiatric condition that could explain the phenomenon.

Because it's common for people who experience musical hallucinations to also have hearing loss, one explanation is that they are the auditory version of Charles Bonnet syndrome, in which the brains of people who have lost vision start to supply sights that are not there. Most people with deafness don't end up having musical hallucinations, though.

These hallucinations often take the form of tunes that are familiar to the person experiencing them, but people have reported hearing new or unfamiliar melodies. In these cases, though, it's possible that the person has heard the melody before and just does not consciously remember it anymore.

Different playlists

In the new paper, the researchers examined reports of 393 people who'd hallucinated music, 65 percent of whom were women. The average age that hallucinations started was 56 years, but people ranged in age from 18 to 98.

The researchers found that about one quarter of these people had a neurologic illness, about 1 in 10 had damage to brain structures, nearly 40 percent had psychiatric illnesses and twelve percent were on drugs. The remaining 15 percent didn't fit into any of these clusters (here referred to by "not otherwise classifiable," or NOC). Hearing loss was common across the groups, but not universal.

Golden and Josephs (2015). "Psychiatric disease represented the most commonly associated condition; however, neurological disease and focal brain lesions together accounted for over a third of the patients."

The groups tended to differ in the kind of music that they experienced. People with neurodegenerative diseases heard religious or patriotic music that was "reminiscent of childhood," the researchers wrote; this was also the case for the people who didn't fit into any of the other groups, who tended to be elderly. In the group with brain lesions, which were typically caused by tumors, surgery or blood vessel anomalies, genres like country and rock cropped up.

"This difference may in part be related to musical preferences with age, with older individuals favoring religious or traditional songs," the researchers wrote. "However, the traditional songs heard by the neurodegenerative and NOC groups are distinguished by their relatively high frequency throughout a lifetime and relationship to emotionally-charged situations. Thus, they may be more vulnerable to manifesting as hallucinations in the presence of hearing impairment or neurodegenerative disease."

Several of the people on drugs heard Christmas carols, while another heard elevator music and one heard "radio through vent." People with psychiatric disorders tended to hear music that depended on their mood and was typically sad or "scary." In one case someone believed the singer was a person who'd passed away, while another person heard their late husband's favorite songs.

"Musical hallucinations can occur in a wide variety of disease states," concluded the researchers, adding that hearing impairment likely increases a patient's chance to experience the phenomenon. In future, they wrote, the relationship between neurological disease and musical hallucinations could be better illuminated by studying people currently experiencing them.