W. G. “Snuffy” Walden is one of the most prolific TV composers of all time. You’ve probably heard his music backing Friday Night Lights, or My So-Called Life, or Nashville, or even Roseanne.

But he won his Emmy for the show he might forever be best associated with — The West Wing, which Walden infused from start to finish with orchestral grandeur, especially its deeply memorable theme song. Indeed, Walden’s West Wing music is so beloved that a two-CD version of his score was recently released, 18 years after the show debuted in 1999. (It ended its run in 2006, after seven seasons.)

Walden neither writes nor reads music, so his journey from creating the folky acoustic score for thirtysomething to being lauded for the stirring Americana of The West Wing is a fascinating one.

But when he joined me for the latest episode of my podcast, I Think You’re Interesting, I was surprised to learn that he wrote the famous West Wing theme with something else entirely in mind, only to find it pulled out and used for the show’s theme song. (Remarkably, it wasn’t the first time that’s happened. A very similar situation occurred with “Angela,” the theme to the ‘70s sitcom Taxi, written by Bob James.)

As Walden explains:

We didn’t have a main title yet. People were writing songs. Randy Newman wrote a song for it. Different people were writing songs for the main title because we weren’t sure what it was going to be. That theme was the cue I wrote for the end of the third episode, where President Bartlet is doing a talk to America out of the Oval Office. That was a theme I wrote just for that moment. It was grand and it lifted up. [West Wing executive producer and director] Tommy Schlamme came over to my studio, because I was playing him cues early on because we had enough time, and he said, “That’s it.” And I said, “That’s what?” And he said, “That’s our theme.” “Wow. Okay!” So I designed it and arranged it to fit in our main title sequence. And then I had a fabulous orchestrator named Brad Dechter come in, and he did a beautiful job. I’ve got to give him so much credit for that. He was remarkable. In the end, we did two orchestral sessions for West Wing. That’s all the orchestral sessions we ever had time or money for, and that piece grew organically out of the show and just became the theme.

Once the series was up and running, Walden was careful not to overuse its theme, lest it lose its power. But there was one recurring instance in which he knew he could consistently make the theme land:

Martin Sheen was the only one that I knew I could pull the theme out. If you’ve watched the series, I rarely ever used that theme. I would very carefully. I didn’t end every show with it. I didn’t play it every time Bartlet walked in the room. I was very careful with it because it was special to me, number one. Overuse would have made it kind of hackneyed. But you could play that simple little gospel melody, which is all it is, in so many different formats. I could play it with clarinets. I could play it with French horns and add a grandness. I could play with just strings, and it would be heartfelt. I didn’t use it a lot. But Bartlet was the one guy that I could always play that theme for. Martin was great about it.

For more discussion of Walden’s career, his work on The West Wing, and his time in the Laverne & Shirley band-within-the-show, Lenny and the Squigtones, listen to the latest episode of I Think You’re Interesting.

To hear more interviews with fascinating people from the world of arts and culture — from powerful showrunners to web series creators to documentary filmmakers — check out the I Think You’re Interesting archives.