Lullabies may do more than soothe babies to sleep—they may also help ease pain in adults. A new study finds that participants who concentrate on melodies such as “Twinkle Twinkle Little Star” while receiving safe electric shocks cut pain levels by 17% overall. Moreover, actively listening to music is twice as effective at slashing pain levels for highly anxious types as compared to their less-anxious counterparts, according to the Journal of Pain. The key to using music to reduce pain is active listening. “We had people listen to specific childhood melodies that they knew well, such as ‘Mary Had a Little Lamb,’ and their task was to identify deviations in the songs, such as noting a jump in pitch or octave,” says lead study author David Bradshaw, PhD, of the Pain Research Center at the University of Utah. As they received electric shocks and pain levels increased, researchers noted that specific changes in their brain waves also increased. “But we could see that changes in their brain waves actually decreased when they focused on the task while receiving the shocks, meaning that their perception of pain decreased, too.” The people who benefited the most from pain reduction were those who rated highest on anxiety and the ability to become easily absorbed in the task. “This is the first study that finds personality traits can affect the effectiveness of pain reducers,” says Dr. Bradshaw. Previous studies have found that listening to music helped people workout longer or keep their hands in ice water for more time than those who didn’t listen to tunes. So how does concentrating on music work to ease pain exactly? Many of the same brain pathways that process music also process pain. Focusing on music engages your mind and triggers emotional responses to compete with pain pathways so you have less resources leftover to process aches. Researchers speculate that actively listening to music might work best for easing acute pain, such as the kind you feel post-surgery, while getting an endoscopy or shot, or when sitting in the dentist’s chair. “Engaging your mind with music can also help alter your sense of time so you worry less about what’s happening in the moment,” says Dr. Bradshaw. For other types of pain, such as chronic headaches, zoning out to relaxing music rather than focusing on the specific melodies may be more beneficial to help relieve pain. As far as which type of music is the most powerful pain reliever, that is entirely up to whatever kind moves you most. “The really important thing is that it’s music you know well enough to follow and that can maintain your interest over time,” says Dr. Bradshaw. “If you listen to rock music all the time in your car, then rock music will probably be the best pain reducer for you because it is most likely to keep you emotionally and cognitively absorbed.” The next time you have to get a medical procedure, consider using music as a natural way to fight aches. So if your dentist’s office plays elevator music and you’re a country girl, you might want to tune in to your own soundtrack on your iPod to really help slash your pain levels. More from Prevention: Odd Pain Relief Tricks That Work