Jenny Lewis didn’t mean to wind up with the marimba.

But for the last year, a vintage percussion instrument has occupied pride of place in the singer-songwriter’s forest green home studio. She inherited it from her godfather, Jerry Cohen, a music editor for TV and movies and an amateur musician, who died suddenly last spring. He was a surrogate dad to her, the kind who surreptitiously bought Hanukkah presents when money was tight in her household, and introduced her to jazz records when she was 10. She was the only person in the room with him when he passed away.

“He was my mentor and my best friend and the most Jewish of all people in my life,” she said. “Jerry would want me to get lessons on the marimba.”

Lewis, the 47-year-old indie artist whose country-rock troubadour style and evocative lyricism has earned her comparisons to songwriting greats from Nashville’s Music Row to Laurel Canyon, has suffered a lot of loss lately. Her mother’s death, in 2017, was the backdrop for her last album, “On the Line,” in 2019. Now, after losing Cohen and another mentor, the album designer and her “rock ’n’ roll dad” Gary Burden, there is “Joy’All,” an album out June 9 that grapples with aging, life cycles and romantic (im)possibility and yet somehow feels vivacious.

“My 40s are kicking my ass,” she sings on the third track over peppy acoustic guitars, “and handing them to me in a margarita glass.” The song is called “Puppy and a Truck,” her latest — and perhaps most lasting — prescription for happiness; she scored them both. “Having survived this moment, I felt like it was important to project something joyful,” she said.

The dog, Bobby Rhubarb, a shiny black cockapoo, greeted me with a waist-high leap when I visited Lewis recently at her home at the end of a wildflower-lined canyon road in the San Fernando Valley. The house is called Mint Chip — there’s an ice cream cone etched in stained glass by the garage — and Lewis acquired it after promising to maintain the whimsical touches that the Disney animator who built it in the 1950s installed. It attracts the fantastical too: during the pandemic, Lewis said, she discovered a baby squirrel had been sneaking in and hiding acorns under her pillow.

There is more than a little magic to her life. It’s in the way Lewis amplifies the space around her (she decked out that truck, a Chevy Colorado, with ersatz Gucci seat covers) and even the way she made it out of a career as a child actor to succeed in another artistic universe.

Though she’s pegged as a country-tinged folk rock songwriter, Lewis’s keystone is still hip-hop, reggae, soul and funk — “finding the story in rap-style verses and picking up an acoustic guitar, and kind of marrying the two worlds,” she said. A printout of the Wikipedia entry for “3 Feet High and Rising,” the landmark album by De La Soul, rested on the music stand in her studio; she was paging through it to understand all the samples they had used.

Her references for “Joy’All” included Tracy Chapman, whose conversational delivery she admires, Portishead and Frank Ocean. About half of the tracks for the LP were created over two years in Los Angeles. The rest she made in Nashville, Tennessee, where she has also had a home since 2017. It’s her fifth studio album as a solo artist — she started out in popular indie bands Rilo Kiley and the Postal Service — and her first release on Blue Note Records, the storied jazz label. (After her own tour, she’ll be joining the Postal Service on the road this fall.)

Dave Cobb, the Nashville producer (Brandi Carlile, John Prine, Chris Stapleton) who worked on the album, was awestruck by her ease and perennial good moods. “If you don’t like Jenny Lewis, you don’t like people,” he said. Their sessions, tracking instruments like pedal steel and Mellotron, along with birdsong from Lewis’ Nashville backyard, flowed easily. “To say she led is absolute, because we all played to her,” he said, adding: “Everything she writes about is true. She literally showed up every day with the puppy and her truck.”

At age 40, after Lewis separated from her longtime partner, the musician Johnathan Rice, she moved to New York for the first time, realizing a teenage ambition. She lived in her pal Annie Clark’s (St. Vincent) apartment for two years, starting the side project NAF there with some friends. Then came Nashville, where she learned how to two-step at a honky-tonk across from the Ryman Auditorium.

In a rehearsal at a space covered in red velvet in Nashville last week, which she shared over a video call, Lewis directed her all-female backing band (she seeks out women for the stage and, for this outing, even has a female tour manager — a relative rarity in the industry, and a first for her). “You guys just pedal on that, and let me do my thing,” she said, as they prepared to sing “Acid Tongue,” the title track off her 2008 solo debut. “Let’s get those ‘oohs,’” she instructed. The harmonies rolled in. “Well done,” she told them. “It’s just feeling confident.”

Back in LA, Lewis had confided that aging as an unfiltered, undoctored music star isn’t easy. “I see myself and I don’t always love it,” she said. “But I’m trying to embrace being a woman in her 40s, and all that has to offer.”

She is contentedly single now, though trying out a dating app, and itching to write about it — even, she admitted, enjoying that more.

“My life is outrageous,” she said, although her songwriting is not straight autobiography. “But if I’m being honest, I’m in every single line.”