“This might have been the most challenging score I’ve ever had to write,” says composer Nicholas Britell of “Don’t Look Up,” the sci-fi social satire starring Jennifer Lawrence and Leonardo DiCaprio, now in theaters.

Britell, a two-time Oscar nominee (“Moonlight,” “If Beale Street Could Talk”) and Emmy winner (“Succession”), pondered – “every day for over a year” – how to find the right musical approach for Adam McKay’s “unbelievable blend of reality with comedy, absurdity with truth, and the profundity of the moment.”

This is their fourth film together (after “The Big Short,” “Vice” and the “Succession” pilot). The challenge, says the composer, was to chart “the musical landscape of the movie, to get the tone right and have it balance all these different elements, from the seriousness to the comedy, in a way where it feels right, and doesn’t feel forced.”

The result is an eclectic brew of big-band jazz, traditional orchestral sounds, considerable electronics and a wild collection of offbeat instruments from toy piano to banjo and mandolin, and seems a likely contender for Best Score.

Britell started writing music even before shooting began. His “Overture to Logic and Knowledge” is a classically styled ode to science that McKay played on the set for the actors and which ultimately found its way into many parts of the final score.

Yet the main theme will attract the most attention for listeners: an exciting, up-tempo big-band piece featuring some of London’s finest jazz players. “It was something about capturing the chaos and craziness that needed to go to this heightened place,” Britell explains.

“It’s bombastic but musically there’s a bit of melancholy,” he adds, referring to the basic plot: two astronomers (Lawrence and DiCaprio) discover a comet heading towards Earth, and their desperate struggle to mobilize people and governments (including Meryl Streep as the American president and Mark Rylance as a tech billionaire) to face impending disaster.

“When I hear that music, sometimes I hear the absurdity and humor, and sometimes I hear an inherent melancholy too. It’s not happy music, it’s not sad music, it’s wavering between these things.” A recent Los Angeles Philharmonic performance of that music brought the Disney Concert Hall audience to its feet.

Part of the fun for Britell was that he also created all of the “commercial music” in the film, from the ringtones on Rylance’s omnipresent cell phones to the music accompanying his various presentations. There’s also an inspirational piece for orchestra and choir for the launch of a spacecraft designed to intercept the comet.

Britell also co-wrote the two new songs in the film, one of which is performed on-camera by Ariana Grande and Kid Cudi; they, along with Britell and Taura Stinson, penned “Just Look Up” as a combination love song and rallying cry for action. “Second Nature,” written by Britell and Justin Vernon and performed by Vernon’s band Bon Iver, is heard under the end titles.

Perhaps the most offbeat element of the score is Britell “screaming and yelling into a microphone to try and channel the craziness in moments of high anxiety. It’s almost like a primal scream,” he says.

McKay called during the summer, as a massive storm brought torrents of rain to New York, where Britell lives, and told him he was looking for “a little more anxiety” in the music. “I was holding up a tarp in my studio to keep the water out,” the composer recalls. As Britell told McKay: “Trust me, Adam, I feel anxiety.”