One of the secrets to success of the NBC dramedy “This Is Us” is its warm, acoustic-guitar-driven musical score by Siddhartha Khosla, founder of the acclaimed indie-rock band Goldspot. In fact, Fox Television, which produces the show, is planning a soundtrack album with Universal Music Group. Jeremy Summers, exec VP of music for Fox TV, points out that a lot of Khosla’s cues “play like songs.”

But tunes figured into “This Is Us” early on. Khosla remembers the show’s creator-producer Dan Fogelman sending over the pilot script (then called “36”) last spring and asking for his musical reaction. “It moved me,” Khosla says. “I could hear music in my head. I recorded this five- or six-minute piece of music — acoustic guitar, cello, some darker atmospheric sounds. He loved it.”

The show focuses on generations in a family, and the score needed to match. “The music had to be organic, something that felt homegrown,” Khosla says. “Just like Dan’s script, it could have a simplicity that was also complex, memorable, melodic, emotive.”

That music has gently nudged viewers in many emotional directions since the series began in September. But, unlike many shows that establish a sound or themes and then use them as the basis for everything to follow, the music of “This Is Us” is evolving as the storylines progress.

Khosla initially penned themes for character relationships. For example, Kate (Chrissy Metz) and Toby (Chris Sullivan) had their own music — “a lighter, romantic feel, a Joni Mitchell-esque quality,” as the composer describes it.

In the early episodes, producers worried whether viewers would be confused by the jumping back and forth between time periods (shifting from siblings Kevin, Kate, and Randall in present day to parents Jack and Rebecca in the ’80s). So, says Khosla, “I had to help sell some of those transitions” via ethereal sounds in the score.

Both have now given way to a related but more complex approach, one which, Khosla says, “respects the audience but makes them work a little bit, too. It’s not so much the idea of character-specific, or relationship themes. Each episode has its own theme, weaved in and out. It’s my way of tying the characters into one theme, one idea.”

Khosla, 40, creates each week’s music at his Studio City home, including playing all of the acoustic guitar and synthesizer sounds that provide those “atmospheric elements,” and the vocal or percussive sounds that occasionally accompany them. The show averages 12 to 17 minutes of music per episode.

And Fogelman — despite his workload as exec producer and sometime writer — listens to each soundtrack piece, Khosla says, offering comments as necessary.

This isn’t their first time collaborating. Khosla scored the second season of Fogelman’s ABC series “The Neighbors.” Their friendship dates back to the mid-’90s when they were students at the University of Pennsylvania.

Born of Indian immigrants to the U.S., Khosla listened to Hindi music as a boy, singing every weekend at his parents’ temple and joining an a cappella group in college, where he learned to arrange for voices.

Later, he and a friend moved to London and started the band Goldspot. Earning raves from critics in London and L.A. during the early 2000s, Goldspot had several hits in the U.S. and U.K. and performed as part of a Diwali festival at the White House in 2013.

Khosla had contributed material to film and TV, but hadn’t considered more full-time work as a screen composer before Fogelman called in 2013 about “Neighbors.” Khosla’s manager urged him to say yes. “It ended up being one of the best decisions I’ve made in my career,” says Khosla, who also scores “The Royals” for E!

Fans already have a taste of the prospective album from the show, with the recent release of “We Can Always Come Back to This,” written by Khosla and Chris Pierce and sung by Brian Tyree Henry for the “Memphis” episode, in which Randall (Sterling K. Brown) drives his dying biological father home. Summers pressed for a commercial release of the Stax-style song, and the day after the episode aired, the cut shot to No. 12 on iTunes.

“We were charting alongside Adele and Bruno Mars,” says Khosla with a laugh. “It was all very surreal. But working on this show has been a creative highlight for me.”