Most film music gets written after the cameras stop rolling, once editors have assembled something close to a final cut. But a handful of directors and composers have flipped that order entirely, writing themes and even full scores before a single scene was shot. The results range from westerns that feel inseparable from their music to modern blockbusters built around a four-minute piano sketch.
What follows are ten well-documented cases where the score came first and the film grew around it, sometimes literally playing on set during production.
1. The Good, the Bad and the Ugly (1966)

Morricone’s soundtracks were so integral to the feel of Leone’s work that the director would play pieces conceived for this third outing while filming on set to create the mood. That approach worked because of how westerns were shot in Italy at the time. Having the pre-composed soundtrack playing on set was possible because there was no intention of using any sound recorded on set, and everything from voices to atmospheres and horses whinnying was dubbed later or added as sound design.
The now-famous coyote-howl theme did not arrive as an afterthought scribbled to fit finished footage. It existed in Morricone’s head, and on tape, well before Clint Eastwood, Lee Van Cleef, and Eli Wallach faced off in that New Mexico desert. The Good, the Bad and the Ugly is a 1966 spaghetti Western film by Sergio Leone, with music composed by Ennio Morricone, starring Clint Eastwood, Lee Van Cleef, and Eli Wallach. Leone used the pre-written cues almost like a metronome, pacing shots and edits to match rhythms that already existed on record.
2. Once Upon a Time in the West (1968)

Two years after their trilogy-capping western, Leone and Morricone repeated the trick on an even grander scale. A wailing harmonica figures prominently in Morricone’s music for this revenge tale of a gunman, played by Charles Bronson, pitted against the villainous Henry Fonda. That harmonica motif, along with themes for the other principal characters, was composed before shooting started, continuing the working method the pair had refined on their earlier films.
Leone reportedly played the recordings on location speakers so his actors could feel the tempo of a scene before a word of dialogue was spoken. It is an unusual way to direct actors, letting music dictate the emotional temperature of a gunfight rather than the other way around. The film’s slow-burn pacing, often cited by critics as some of the most patient in the western genre, owes a real debt to that reversed process.
3. A Clockwork Orange (1971)

Stanley Kubrick commissioned Wendy Carlos, then working under the name Walter Carlos, to compose electronic interpretations of classical pieces before production wrapped, giving him music to consider alongside his script and shot lists. Carlos’s Moog synthesizer reworkings of Beethoven’s Ninth Symphony became central to the film’s identity, most memorably in the scenes involving Alex’s twisted devotion to “Ludwig van.”
Kubrick was known for leaning on classical recordings during editing, but the Carlos material stands apart because it was purpose-built for the project ahead of the final assembly. The synthesized, slightly alien quality of those cues gave the film a sonic signature that a traditional orchestral score would not have provided. It remains one of the more unusual composer-director collaborations of the era, precisely because so much of the groundwork was laid before editing began in earnest.
4. Days of Heaven (1978)

Terrence Malick’s sparse, elemental drama about migrant farmworkers in the early twentieth century leaned heavily on Morricone’s score, much of which took shape from the screenplay itself rather than finished footage. Malick’s shooting style, famous for chasing natural light during the “magic hour,” left him with fragmented, mood-driven footage that needed music capable of unifying tone rather than syncing to specific action.
Morricone’s contribution leaned into that ambiguity, offering pastoral, melancholic themes that matched the emotional register described in the script long before Malick had cut anything together. The film went on to win the Academy Award for Best Cinematography, and critics have long noted how tightly the visual and musical textures work together, a byproduct of music existing as a guiding idea from early on rather than a final layer.
5. The Mission (1986)

Roland Joffé’s drama about Jesuit missionaries in eighteenth-century South America gave Morricone unusually detailed instructions from the script, including specific scenes involving Jesuit hymns and indigenous musical traditions. Morricone composed several of the film’s key themes, including the now-widely performed “Gabriel’s Oboe,” before significant portions of filming were complete.
That early groundwork mattered because music was not just background atmosphere in this story. Characters play instruments on screen, and the plot itself hinges on a scene where an oboe becomes a bridge between two cultures. Having usable, finished musical material ahead of time allowed the production to build certain scenes directly around the compositions rather than scoring them in afterward.
6. The Piano (1993)

Jane Campion’s story of a mute woman who communicates through her piano required a very specific kind of preparation. Michael Nyman composed a significant portion of the film’s solo piano pieces before filming so that Holly Hunter, who played the lead role and insisted on performing the music herself, could learn to play them convincingly on camera.
This was not a matter of creative preference so much as production necessity. Without finished pieces to rehearse, Hunter would have had no way to develop the physical fluency the role demanded, since close-up shots of her hands on the keys needed to look authentic rather than mimed. Nyman’s score, blending Scottish folk influences with his signature minimalist style, ended up shaping the emotional pacing of entire scenes rather than simply accompanying them.
7. There Will Be Blood (2007)

Paul Thomas Anderson handed Radiohead guitarist Jonny Greenwood an early draft of the screenplay and asked him to respond with music, well ahead of the shoot. Greenwood, working largely outside conventional film-scoring traditions, produced dissonant string pieces that Anderson then used as a kind of tonal compass while directing.
The unsettling, almost abrasive quality of Greenwood’s music became inseparable from Daniel Day-Lewis’s performance as the ruthless oilman Daniel Plainview. Anderson has spoken about how having Greenwood’s early compositions in hand influenced pacing decisions on set, particularly in the film’s wordless opening sequence. It is a rare case of a rock musician’s film-scoring debut reshaping how a major awards contender was shot and edited.
8. The Assassination of Jesse James by the Coward Robert Ford (2007)

Nick Cave and Warren Ellis composed much of their score for Andrew Dominik’s western before principal photography wrapped, working from the screenplay’s meditative, elegiac tone rather than finished scenes. Their music, built around sparse piano and violin, matched the film’s unhurried pace and its focus on psychological dread rather than gunfights.
Dominik has discussed using early versions of the score during the editing process to help shape the film’s rhythm, a rhythm that many critics found unusually patient for a western about outlaws. The collaboration between Cave, Ellis, and Dominik continued on later projects, but this remains the clearest example of their music functioning as connective tissue between script and screen well before the film was locked.
9. Under the Skin (2013)

Composer Mica Levi wrote much of the eerie, string-heavy score for Jonathan Glazer’s alien drama during pre-production, working from the screenplay and Glazer’s descriptions of tone rather than assembled footage. The music’s unsettling, sliding textures became a reference point for how scenes were shot and paced, particularly sequences involving Scarlett Johansson’s character luring victims through Scottish streets.
Levi’s approach avoided conventional melody almost entirely, favoring dissonant clusters that mirrored the film’s alien perspective on humanity. Because so much of the score existed before editing began, Glazer was able to cut certain sequences to match Levi’s cues directly, an inversion of the usual process where music gets trimmed to fit picture. The score earned widespread critical praise and a BAFTA nomination, an unusual outcome for music built almost entirely on unease rather than hummable themes.
10. Interstellar (2014)

Without telling Zimmer that he was planning a futuristic science-fiction film, and without even telling him what the movie was about, Nolan sent Zimmer a letter outlining what he saw as the theme of his film and asking him to spend one day writing some musical ideas. The story contained two sentences of dialogue, “I’ll come back” and “When?”, and Nolan then asked Zimmer to spend one day composing some musical interpretations of the story.
In one night, Zimmer wrote a four-minute piano and organ piece that represented his idea of fatherhood. Nolan came down, sat on Zimmer’s couch, listened to it, and said he had better make the movie now. That piece became the emotional backbone of a film about black holes, wormholes, and a father racing against time, proving that a theme built entirely around feeling, rather than plot, could still anchor one of the decade’s most ambitious science-fiction epics.
These ten films share a common thread even though they span nearly five decades and wildly different genres. In each case, music stopped being a finishing touch and became a working tool, something directors leaned on while blocking shots, guiding performances, or shaping the rhythm of an edit. That reversal of the usual process rarely happens by accident, and when it works, audiences tend to remember the music as vividly as anything on screen.