With “Glee” about to end its note-perfect season Tuesday night, it’s time to ask: When was the last time a TV show made you sing? No scripted musical has ever worked on television. Remember the silliness that was “Cop Rock”? Or the disaster that was “Viva Laughlin”?

By breaking the rules of the medium, “Glee” managed to do well what those other shows couldn’t do at all.

“What I think is working is this combination of people relating to the show’s two big aspects: the stories and the music,” says Brad Falchuk, the show’s executive producer. “People are familiar with the music, but they are also connected to the characters.”

In the finale, the Gleeks from New Directions head to the Regionals to take on their rival, Vocal Adrenaline. Just think of the drama: New Directions diva Rachel Berry (Lea Michele) has learned her real mom is Adrenaline’s coach, Shelby Corcoran (Idina Menzel), and her boyfriend, Jesse (Jonathan Groff), is its star.

With “Glee” we’ve come to expect impressive vocals, and the finale will not disappoint, especially when Groff sings Queen’s “Bohemian Rhapsody,” says Falchuck. “Jonathan has a star turn that you won’t believe. He owns the whole act,” he says.

New Directions will do a medley of Journey hits, but singing will be just one part of the finale. On the sidelines, Cheerio Quinn (Dianna Agron) has her baby and there’s a “twist as to what happens with that,” says Falchuk.

It’s all setting the scene for season two, which we already know will end with the New Directions heading to New York for Nationals. And in an unprecedented move, Fox already has picked up “Glee” for season three, demonstrating the network’s continuing confidence in its musical hit.

As “Glee” often points out, confidence in who you are goes a long away. And underscores the ways in which the show became a triple-threat.

First of all, it cast for talent, not star power. An unknown to television audiences, Lea Michele was always first choice to be the leading lady; a Drama Desk nominee for her work in Broadway’s “Spring Awakening,” she gave “Glee” its heroine, someone whose combination of naivete and panache let her underplay the high school scenes as well bring down the house in the production numbers.

“Ryan had her very specifically in mind,” says Falchuk, “so we started writing the character to her strengths.”

Casting the other parts proved tougher. “We needed people who could sing, dance, act and be lovable. There’s not a lot of people who can do all of that, but Broadway seemed like a good place to find them,” says Falchuk.

And so Broadway, whose talent pool usually provides shows such as the “Law & Order” franchise and “The Good Wife” with actors for quirky guest spots, became the reservoir from which “Glee” would draw again and again. It created TV stars in the process.

One of them, Matthew Morrison, who plays coach Will Schuester, is the complete package. Known for his work in “Hairspray” and “The Light in the Piazza,” he can sing, dance and act. Morrison auditioned in New York with a rendition of “Somewhere Over the Rainbow,” which he will reprise in the finale.

“He’s really someone who can do everything,” says Falchuk.

All season long, the show continued to raid Broadway, bringing in Kristin Chenoweth and Menzel, who rose to fame in “Wicked.”

Secondly, the smartest thing “Glee” may have done was set up shop with iTunes. The producers knew the songs were going to be popular; what they didn’t know was how popular. Last week, “Glee’”s latest soundtrack beat the Rolling Stones’ re-release of “Exile on Main Street,” hitting No. 1 on Billboard’s 200 albums chart.

If the downloads and CD sales weren’t enough to keep the producers and network smiling, the “Glee” kids are now on the road, doing live shows. Over Memorial Day weekend, the crew performed five sold-out shows at Radio City Music Hall.

“Promoting the songs in this way was always part of the plan,” says Falchuk.

“Glee”’s ratings really jumped when Fox started airing it after “American Idol,” on Tuesdays at 9 p.m, going from a fall average of 7.3 million viewers to 12.1 million viewers.

“We never imagined [the show] would work,” says Falchuk. “In fact, we were pretty sure it wouldn’t. But I think we all secretly want to sing.”