Trevor Rabin had no idea that, on Nov. 4, 2008, he was about to be immortalized.

Barack Obama had just been elected president of the United States, and as he finished his acceptance speech, the music that began to play was Rabin’s inspirational theme from the football movie “Remember the Titans.”

For a white South African whose family fought against apartheid when it was not just unfashionable but downright dangerous, this prominent showcase of his music — written for a movie about black and white high-school players learning to get along and win the season — was especially meaningful.

“I was happy I was on the winning ticket,” Rabin says with a laugh.

Yet that’s just one moment in a long, strange trip that began in Johannesburg and ended in Hollywood, where Rabin is now an in-demand film composer with no fewer than 13 Jerry Bruckheimer movies under his belt (including “Titans,” “Armageddon” and the “National Treasure” movies).

The restless songwriter and guitarist for the ’80s incarnation of rock group Yes has a new film coming out (“Max,” due June 26), is working on two television series and even mulling a return to the rock world. The writer of Yes’ No. 1 hit “Owner of a Lonely Heart,” Rabin released a jazz album in 2012, is now writing an album of all-original rock material and considering a tour.

After nearly two decades of solitary film-score composition, he says, “I miss the interaction, and this place where time stands still, (where) I’m not worrying about mortgages or ISIS. All I’m trying to do is play the best I can and communicate. So if anyone’s interested, I’d love to play live again.”

Don’t bet against it. For more than 40 years in the music business, Rabin has enjoyed one success after another. Manager-turned-producer Bill Gerber, who has worked with Rabin in both pop music and films, says it’s because, “He understands the craft of songwriting better than most. He’s very analytical about it.”

It also helps that, says Bruckheimer, “Trevor is very easygoing. He doesn’t get rattled. He’s somebody you love working with because, no matter what, he’s there to please the director and give him exactly what he wants.”

That extends to television, Rabin’s current employer. He’s in the middle of scoring a 10-episode run of “Agent X,” the presidential thriller starring Sharon Stone that TNT will air later this year. And he’s about to start a second season of “12 Monkeys” for Syfy. He’s sharing credit on both shows with his longtime assistant Paul Linford.

“These projects on cable, they’re much quirkier (than films). They seem to be allowed to go different places,” Rabin says in a rare moment of relaxation at his guitar-laden studio north of Hollywood.

He did a season of “Zero Hour” for ABC in 2013, every week with orchestra, but the cable shows — on stricter budgets — are being done electronically in Rabin’s studio, with acoustic instruments added as necessary. “I try and add some real stuff to the synths,” he says.

Still, it’s the movies for which Rabin is best known. Unexpectedly offered a Steven Seagal movie (“The Glimmer Man”) after giving the action star a guitar lesson, he went on to create adrenaline-fueled, muscular scores for Bruckheimer action pics like “Con Air” and “Armageddon.”

Rabin’s orchestra-with-synths style, coupled with his melodic sense and his electric-guitar chops, led to immediate success in this medium. Soon there were also driving guitars for “Gone in 60 Seconds,” the soaring symphonics of “Flyboys,” the grand-scale orchestra and choir for “The Sorcerer’s Apprentice.”

Adds “12 Monkeys” writer-producer and acknowledged film-music buff Terry Matalas: “The stars of ‘National Treasure’ are Nicolas Cage, the Declaration of Independence and Trevor Rabin. It’s practically a rock musical.”

Then there are the sports movies, which started with “Remember the Titans” and expanded to include “Coach Carter,” “Glory Road,” “Gridiron Gang,” “Grudge Match” and themes for the NBA, NCAA and NASCAR. He’s become the go-to composer for triumphal sports anthems.

Rabin concedes he’s not especially athletic (he played rugby as a boy, but his classical-musician father worried about his hands as a promising young pianist, so rugby lost out). His sense of what those filmmakers want: “melody and excitement, things that are able to play through, so there’s an interesting theme that goes from A to Z.”

Rabin says he starts every project the same way: He may read the script, but he doesn’t start work until he sees some footage. “Just let me get a sense of the colors, the rhythm of the dialogue. Then I’ll turn off the sound and, with just the picture playing, I’ll sit and write, recording ideas at the piano.” This can take days or even weeks.

“I’m also looking for the sound of the film,” he says. “Is it based on an orchestra, or is it banjo and dobro? Once I’ve got what I think are good ideas, I’ll do what I call an ‘underture’ — an underscore, but an overture of how these different themes might weave together. Then usually I go to the end of the movie and work backwards.

“It’s like painting a room: if you start in the wrong place, you won’t be able to get out of there.”

Looking back at his odyssey, Rabin says “I’m quite reckless, from a business standpoint, because I go into things for the music. I’ve been very lucky that it’s all fit into place. There’s always that vitality and that insecurity that keeps me going.
“I’m always absolutely astonished at what’s available with 12 notes.”