Composer Danny Elfman broke his cardinal rule for Disney’s remake of “Dumbo”: He wrote music ahead of time, long before shooting began and without even seeing a script.

“Thinking about the idea of a baby elephant and his mother, and the two being torn apart, I just thought of something innocent and sweet and sad,” he confesses. “I went into my studio, spent 20 minutes writing it down and making a demo of it, and I stashed it away.”

A year later, as he began working closely with director Tim Burton, he found the file (curiously labeled “Elephant”) and, to his amazement, discovered that the music matched the film perfectly. “Dumbo’s Theme” is unchanged from his original concept.

“That theme had to play bittersweet, which I knew it could, but it also had to be frivolous and light, and more important, it had to be triumphant in a really grand way,” Elfman says. Indeed, the composition could be varied to fit all of those contexts — and it’s heard throughout the live-action reimagining of the animated original.

The setting of the story — in which a small traveling circus finds unexpected success with a young pachyderm whose oversize ears allow him to fly — led the composer to depart from tradition on another front: “This was also the first time I ever asked to do all the source music,” he says, referring to the background music for the circus and its clowns.

Usually Elfman skips that part, preferring to concentrate on the dramatic score, which is the most important musical job anyway. “I love weird circuses and the idea of carnivals,” he explains. “Those funky clowns stumbling around really appealed to me. It’s fun, and it adds so much color and flavor to the score.” So calliopes, fanfares, tuba-and-trombone circus marches and aerial-act waltzes abound.

Elfman has made more than a dozen films with Burton. Their collaborations go back more than 30 years to “Pee-wee’s Big Adventure” in 1985 and include such hits as “Batman”; classics like “Edward Scissorhands” and “The Nightmare Before Christmas”; and another recent Disney remake, “Alice in Wonderland.”

Their work process has changed little in that time, Elfman says. Early on, “Tim will have a sentence, or convey a feeling, but he needs to hear music. He’ll have plenty to say later when I’m presenting ideas and cues.”

Disney buffs will spot references to the Oscar-winning score by Frank Churchill  and Oliver Wallace from the 1941 film. “This is a cultural icon,” the composer says, “and I was happy to pay homage.” So “Pink Elephants on Parade,” “When I See an Elephant Fly” and the train motif “Casey Junior” all make appearances, and the Oscar-nominated song “Baby Mine” is sung twice: once in the film by Sharon Rooney (who plays Miss Atlantis) and again by Arcade Fire beneath the end titles.

Elfman recorded in London with an 85-piece orchestra and a 60-voice choir. “This is a classic tale, and I wanted to keep the feel of it very much in the classic vein,” says the composer. “Writing a lyrical score is always the most fun I have.”