It probably won’t come as a surprise to anyone with a loved one in a nursing home or an assisted-living facility that music can sometimes be used to improve the residents’ quality of life. Boomboxes and P.A. systems playing oldies are commonly heard in the hallways and public areas of such places, with occasional concerts and singalongs popping up on the entertainment schedule.

Yet even in the nicer places, the musical offerings tend toward the generic, if not the downright bizarre. My brother recently reported hearing Heart’s “Magic Man” and Eric Clapton’s “I Shot the Sheriff” wafting from the dining room of the assisted-living facility where our mother lives. It’s doubtful that she or anyone else living there — several are near 90 — give a hoot about those 1970s chestnuts. Mom was in her 50s when those songs came out.

How about a little Glenn Miller or the Andrews Sisters?

This is the subject of “Alive Inside,” a film that’s part documentary, part advocacy and part fundraising tool for a movement to place iPods loaded with playlists tailored to individual tastes in the 16,000 nursing homes across the country. The project, Music and Memory, is the brainchild of Dan Cohen, a techie and social worker who has so far managed to set up programs only in a small fraction of elder-care facilities (about 650 since the idea hit him in 2006).

The movie, directed by Michael Rossato-Bennett, makes a powerful argument for the program.

He includes fascinating interviews with neurologist Oliver Sacks and other scientists about how music affects the human brain, but the movie’s most effective arguments come from some of the dementia sufferers featured. One 92-year-old named Henry Dryer, who is first seen with his chin on his chest, unresponsive, absolutely lights up when he’s allowed to listen to his favorite religious music. Another woman initially claims not to remember any details about her life. But, after a song or two, she begins chattering away and reminiscing about things that happened decades ago.

The benefits of music to enliven and awaken the senses are not limited to those with dementia. “Alive Inside” also focuses on a woman who suffers from schizophrenia and bipolar disorder, and on a man with multiple sclerosis. The scenes in which they and others are shown listening to music that has personal meaning are absolutely joyous, but they also might move you to tears.

As the movie makes clear, none of these conditions are reversible. Music isn’t a cure for anything. But it does seem to be a key to unlocking long-closed doors and establishing connections with people who have become, through age or infirmity, imprisoned inside themselves.