Music’s greatest power may be in its repetition.

That power usually sneaks up on you, like when you unexpectedly find yourself knowing the words to the Baha Men’s “Who Let the Dogs Out?” or singing along to Justin Bieber’s “Sorry.” Sometimes, though, we seek out the repetition, either by playing a single song until the earworm has burrowed deep into our heads or by combining it with other songs — in a playlist, or, back in the day, a mixtape — to capture a mood or set one and then returning to it again and again.

Two new books — Dave Holmes’ “Party of One: A Memoir in 21 Songs” (Crown Archetype, 288 pp., $26) and Ben Greenman’s “Emotional Rescue: Essays on Love, Loss and Life — With a Soundtrack” (Little A, 235 pp., $19.95) — take the playlist as their format and show how connecting music to a moment or mood can be potent and often unforgettable.

Holmes — best known as an MTV VJ at the turn of the century, now an actor, and an editor at Esquire — uses his playlist, chock full of ’90s pop and indie nuggets, to tell his life story.

Does it matter whether or not you’re familiar with The Ocean Blue’s modern rock hit “Drifting, Falling” from 1989? Not really. Though if you are, the song’s bubbly yet melancholy mood really does suit Holmes’ chapter about being gay and mostly in the closet and deciding to attend the Jesuit College of the Holy Cross. “I took the time in my life when I was supposed to be figuring out who I was, and I spent it trying to be a fictional character,” Holmes writes. “Ultimately, I look on this whole time in my life the way you do when you’re looking at a picture of yourself with your worst haircut.”

As he does in his pop culture writing for Esquire, Holmes approaches his own story with warmth and a sense of humor, though both qualities are often buffers for painful situations. In the chapter connected to The Rembrandts’ hit “I’ll Be There for You” — yes, the theme from “Friends” — Holmes writes about moving to New York after college rather than returning to his hometown of St. Louis. “I had enthusiasm, a poor understanding of how the world worked, a 2.4 GPA, and no job skills,” he explains. “I couldn’t fail.”

advertisement | advertise on newsday

Holmes’ engaging tale moves along twin, intertwining tracks — his quest to live openly as a gay man and his use of music and other forms of culture to support him emotionally when that wasn’t possible.

Cultural details are so important to Holmes, it’s no wonder that he painstakingly makes sure each song rings true in “Party of One.” Greenman — known for his novel “The Slippage,” co-writing the memoirs of Questlove and George Clinton, as well as his work in The New Yorker — is more intellectual in his approach to “Emotional Rescue.” The songs he chooses for his playlist are meant to be jumping-off points for essays about life, often lumping together disparate songs in the name of matching a theme.

His meditation on friendship and self-interest, for example, was inspired by Miles Davis’ “Great Expectations,” The Knack’s “(She’s So) Selfish,” Lou Reed’s “She’s My Best Friend,” and the Rev. Edward W. Clayborn’s 1927 song “Your Enemy Cannot Harm You (But Watch Your Close Friend),” among others. Now that list may seem like cultivated cool, rather than an organic connection, but it leads Greenman to this poignant thought about friendship as you grow older: “Those few who remain become permanently, irreversibly important,” he writes. “You can act casual. You should. Admitting that other people are important to your survival can feel a little embarrassing, even more so if it’s true.”

While Holmes offers up his heart on his sleeve and a genuine soundtrack to his decisions, Greenman is warier. He offers glimpses into his family life, his past relationships and his music collection, but also keeps the reader at arm’s length.

In his chapter about children’s love of music, he talks of Abdel Gadir Salim’s “Qidrechinna (I Am Destined to Love)” and The Who’s “Pinball Wizard,” but he says that he’s purposely leaving out Harry Chapin’s “The Cat’s in the Cradle” because “I am still holding the shield against sentimentality, though it’s quaking a little bit when I think of my sons, littler than I ever remember being, loving music without the slightest bit of irony.”

That hedging shows he understands the power of music all too well.