Co-creators John McNamara and Sera Gamble took IndieWire inside the challenges of pulling off a musical number on basic cable.

“The Magicians” went into battle on Wednesday night and pulled out the ultimate weapon: a Broadway musical song.

In the episode, Fillory’s High King Eliot (Hale Appleman) is about to enter into mortal combat with the King of Lauria, who has never been defeated. Eliot’s right-hand magician and partner in every crime imaginable Margo (Summer Bishil) gives him a pep talk and reminisces about how well he did in a production of “Les Miserables.” Inspired by that success, she used magic to force him and others to perform the number “One Day More” from the musical in order to get him pumped up for his duel.

“I just had this idea that going into a life and death battle, there is a great tradition in feudal societies of soldiers singing to both fight their fear and scare the enemy,” co-creator John McNamara told IndieWire. Watch the rousing scene below:

It was just a matter of time before “The Magicians” decided to include a full-on musical number. Not only is McNamara a diehard devotee of musicals, but the show had already tested the waters twice before.“We’ve kind of gone from doing something that was relatively simple in Episode 104 with Jason Ralph in the infamous Taylor Swift, the mental hospital scene,” said McNamara. “That was like a really, good stripped-down [scene], just pre-recording Jason who’s got a wonderful voice in a kind of unique way and it was just piano. And we asked the director to keep it really simple, really loose and make it look like that it sort of happens in a mental institution.”

“And in [Episode] 202, I had a suspicion that Charles Mesure could sing only because he had such a beautiful speaking voice. That was going up a tone in terms of complexity because I wanted him as The Beast to sing two really complex period songs, one by Noel Coward, one by Cole Porter and in both cases, he would start with the simple piano, but since he’s a magic creature, he creates an orchestra… a sextet of instruments [as accompanimen].”

Once McNamara knew he wanted a song for Eliot’s pre-battle inspiration, he had go through the difficult process of finding a song that would fit. He first tried “Tonight” from “West Side Story” but the lyrics were too specific. He also considered songs from “Hello Dolly” and other Sondheim songs.

“And nothing really seemed to fit until I remembered liking ‘Les Mis,’” said McNamara. “I remember really being blown away by was when Hugh Jackman and the cast and Anne Hathaway did it live on the Oscars. So I watched that on YouTube, and I’m like, ‘That’s it. That’s the song,’ because it’s specific but it’s just general enough that you could kind of bend it toward this situation. It is about getting at the power, it is about the monarchy, it is about a lot of the things that are the themes [we have] and it’s a big, big, big, multi-part number.”

Fortunately, the lyrics even seemed to fit the situation for Fen (Brittany Curran), Eliot’s poor, pregnant Fillorian wife who has to share him with everyone else.

“As she sings… she realizes that these words coming out of her mouth peculiarly described her emotional situation in this Eliot-Margo-Fen triangle,” McNamara said. “That those lyrics that were written for an entirely another character and another situation — you really do suddenly understand how painful it is to kind be the third wheel in what you think is a marriage and then be left behind for the big duel. She’s left alone in the castle. She’s the only one who can’t go before the action.”

Co-creator Sera Gamble also gave an idea of how difficult it was to pull off the musical number — which was almost scrapped as they waited for the song rights to be cleared.

“We’re not built as a machine to produce musical numbers every episode and we have the same kind of prep schedule as any other show on basic cable, which means we don’t have very much time to do this,” she said. “And when you want to play any song on your TV show, even just a needle drop in the background of a scene, you have to clear that song, which takes a certain amount of time. Generally [a needle drop is] on a time frame that is a little bit more relaxed, because you’re needing that in post. You don’t need it on the day when you’re shooting it.

“So we’re constructing this massive musical number,” Gamble continued. “Paul Becker, our choreographer, is working on it. Rebecca [Johnson], our director, is working really hard on it. We’re up in Vancouver with her prepping us all weekend and at the same time, Anne Kline, our music supervisor, is racing to get this cleared with a bunch of people in France, hoping we can do it in time. So, in addition to everything else, John was also finding us sort of backup options that we might have to pull out at the 11th hour, because that’s the nature of TV production.”

Summer Bishil, “The Magicians”

Eike Schroter/Syfy

“The Magicians” also has to abide by a basic cable budget, which made this number doubly expensive.

“I didn’t know this until Episode 104 in the first season, but it’s far more expensive for the studio to have Jason Ralph sing Taylor Swift than to have Taylor Swift sing Taylor Swift [in the original recording] because you’re paying for both the song and what is essentially a new master,” said McNamara. “In reruns, sometimes what they’ll do… is switch out the really expensive Taylor Swift song and put in something from their library. And of course it means that in posterity, it’s going to suck, which is why I’ve had in my contracts for shows… that no one could go in later and switch out Jefferson Airplane for some crappy soundalike.

“But anyway, that’s a long way of saying that after we had spent an enormous amount of money for us,” he added. “Once the actors are lip-synching their own voices, you’re locked in to a lifetime of payment to either Taylor Swift or Noel Coward or Cole Porter or in this case the authors of ‘Les Mis,’ whose names I’m too stupid to pronounce. The composers got a nice check and they’ll get checks for as long as this [episode] is airing.”

McNamara was also fortunate that many of his cast members could sing or were game to try. While shooting the pilot in New Orleans, the cast and McNamara were hanging out in the production tent and sang show tunes. Appleman is a trained singer and theater actor who has “probably a three-octave range tenor,” Curran and Jade Tailor sing, and even Jason [Ralph] is a very enthusiastic, emotional singer.

Bishil, however, needed to get some help. “I thought Summer trained really well and got really good for someone who had never sung,” said McNamara. “She was such a trouper because she got one of the toughest vocal parts of that song and she just dug in and did it. Whe took it really seriously and studied really hard with Jade Tailor who plays Kady, who coached.”

Jade Tailor, Arjun Gupta and Jason Ralph, “The Magicians”

Eric Milner/Syfy

Despite the time crunch, cost and down-to-the-wire turnaround, “The Magicians” won’t shy away from future musical numbers, especially since it will give the other cast members a chance to show off their singing chops.

“Yes, I do want to do it again,” said McNamara. “In particular, Jade Tailor has been very patient because she’s had exactly zero chances to sing. I think that Stella [Maeve] has got an interesting kind of contemporary blues voice. I’d be shocked if she couldn’t produce an interesting sound. And Arjun [Gupta]? I don’t know. We’ll see.”