Mr. Rock invited his longtime friend Questlove — of the Roots, house band of “The Tonight Show” and longtime organic-minded hip-hop agitators — to serve as the film’s executive music producer. In a tiny room backstage at “Tonight” this month, on a day when Questlove had just raced through emergency rehearsal after the scheduled guest Bono injured himself in a bicycle accident in Central Park, the two men convened to talk about what they had in common, and what they learned from each other.

Like, for example, how to make a hilarious sex scene even funnier. Turns out it was Mr. Rock who chose the song. “Not knowing the value of comedy, I would have went with the most nastiest song ever, something like Jodeci’s ‘Freek’N You,’ ” Questlove said. “But he taught me the value of the irony, of the sweetness.”

These are excerpts from the conversation.

Q. I feel as if we’re not in an era of great soundtracks. With blaxploitation movies or the early hip-hop movies, there was a real symbiosis between music and film.

CHRIS ROCK I don’t get the sense that white executives worship black music the way they used to.

Is it that they don’t or they don’t feel they have to? Diversity changed as a concept, from “We’re going to fund a black show” to “We’re going to have a mainstream show that has a black character.”