Damien Chazelle made L.A. his film set — shutting down the 105 so Emma Stone and Ryan Gosling could dance on car roofs — to shoot a modern musical.

Damien Chazelle was certain he had a flop on his hands. Test screenings of La La Land had not gone well: For whatever reason, audiences weren't connecting to his retro musical about a couple of Hollywood dreamers who dance atop cars on L.A.'s 105 Freeway and sing while floating through the air at Griffith Observatory. So in August, as the 31-year-old director sat down for the movie's debut at the Venice Film Festival, he kept his eyes shut through a solid half-hour of the picture.

"I had this feeling like, 'Oh my God, this is tanking,' " says Chazelle. "I was just a dazed, terrified mess."

But La La Land got a standing rousing ovation, and Emma Stone, who stars with Ryan Gosling as one of the lovestruck Angelenos, won the festival's best actress award. A few days later the movie earned critical acclaim at the Telluride Film Festival, and then, at the end of that week, it took the top prize at the Toronto Film Festival. The kudos haven't stopped since (La La Land already has a 96 percent rating on Rotten Tomatoes, and it doesn't open until Dec. 9).

Chazelle had been through the awards circuit with the 2014 drumming drama Whiplash, a Sundance breakout that won three Oscars (including a supporting actor trophy for J.K. Simmons) and catapulted Chazelle to the top ranks of Hollywood's hot young directors. But while Whiplash (which cost only $3.3 million to make) was a dark, sometimes-harrowing drama about a young musician and his abusive teacher, La La Land (which cost $30 million) is a joyous update of Hollywood musicals of the 1930s. Although set against contemporary L.A. landmarks, it's filled with the type of song-and-dance numbers not seen onscreen since Fred Astaire twirled with Ginger Rogers on the old RKO soundstages.

Stone plays an aspiring actress serving cappuccinos at the coffee shop on the Warner Bros. lot, and Gosling stars as a jazz composer eking out a living playing Christmas tunes in restaurants (Simmons pops up for a small role as a manager who fires him). The two meet cute, fall in love and scramble to make it in the tough but gorgeously shot city of Los Angeles.

[promo:924458]

Chazelle came up with the idea for La La Land when he was a student at Harvard, long before he wrote Whiplash. He and classmate Justin Hurwitz (the composer on Whiplash and La La Land) explored the concept in their senior thesis, a low-budget musical about a Boston jazz musician titled Guy and Madeline on a Park Bench. After graduating, both moved to Los Angeles in 2010 and continued writing their modern version of an old-fashioned musical — only they reset the action in L.A. "There is something very poetic about a city that is built by people with these unrealistic dreams," says Chazelle, "and they just put it all on the line for that."

Such unrealistic dreams could include finding funding for a film in an extinct genre. "I was told the concept and the material for La La Land seemed brazenly uncommercial," says Chazelle. "The movie is not based on anything, and there are no familiar songs to build off the pre-existing fan base. And it's a jazz musical."

Chazelle managed to find producers — a friend introduced him to Fred Berger and Jordan Horowitz, two young New York transplants to Hollywood — and the script landed at Focus as a much-lower-budget film, in the $1 million range. Still, it stalled. "There were a lot of people saying we were trying to make a really expensive museum piece," says Horowitz. Chazelle was told to change the male lead from a jazz pianist to a rock musician, change the complicated opening number and drop the story's bittersweet ending. Says Berger, "Every one of the contours that felt special and distinctive were the things we were urged to change."

Eventually the script went into turnaround, and a heartbroken Chazelle moved on to his next project, Whiplash. But he never gave up on getting La La Land to the screen. Even as the director was being celebrated at the 2014 Sundance Film Festival, where Whiplash opened to raves, he was pitching his musical to distributors.

What a difference a hit makes. After Sundance, Lionsgate and Black Label Media signed on, along with producer Marc Platt, to make La La Land with a much larger budget — and actual stars. Chazelle first offered the female lead to Emma Watson, but the former Harry Potter star instead signed to topline Disney's live-action Beauty and the Beast. For the male lead, he reached out to his Whiplash star, Miles Teller. But negotiations over Teller's pay — the actor reportedly balked at the $4 million being offered — dragged on. Teller has said he heard he had been dropped from the project when his agent called and said: "Damien told them that he no longer thinks you're creatively right for the project. He's moving on without you."

Recalls Chazelle of those trying times: "Everything felt like a complete mess and a complete jumble. It was a moment where it felt like it was never going to come together."

Things began to unjumble after Chazelle met with Stone, then starring in Broadway's Cabaret, and Gosling, who was about to shoot Adam McKay's The Big Short. "He had a very infectious attitude toward film," says Gosling of their first meeting at a bar near the star's Hollywood Hills home. "He talked a lot about wanting to make movies for the big screen that you want to experience with an audience."

[promo:942913]

Stone and Gosling had acted together before, in Crazy Stupid Love and Gangster Squad, but Gosling would have to play jazz piano, and both would need to learn how to sing and dance for the film's six original tunes (including the upbeat opening number "Another Day of Sun" and the flirtatious duet "A Lovely Night"). For three months beginning in May 2015, Chazelle and his stars prepped inside a group of adjacent warehouses in L.A.'s Atwater Village. Gosling practiced piano in one room, Stone worked with dance choreographer Mandy Moore in another, and costume designer Mary Zophres had her own corner of the complex.

"Musicals are such interdisciplinary movies," says Chazelle. "They require so many different crafts and performers to work closely together. One of the reasons Hollywood was able to churn out these really high-level musicals was because of the studio system. We kind of hoped we could create our own smaller version of that." To help his cast and crew get their creative juices flowing, Chazelle also hosted screenings on the soundstages every Friday night of films that had inspired La La Land, including The Umbrellas of Cherbourg, Singin' in the Rain, Top Hat and, somewhat improbably, Boogie Nights (the Paul Thomas Anderson movie about the 1970s porn industry).

Hurwitz continued reworking the songs — ranging from the upbeat opening group number "Another Day of Sun" to the flirtatious duet "A Lovely Night" and the sweeping ballad "The Fools Who Dream,"— as the story changed (when Gosling and Stone signed on, Chazelle aged up his main characters, who were originally younger newbies just arriving in Los Angeles). It was a painstaking process: It took Hurwitz 31 attempts to get the film's main melody, a melancholy song called "City of Stars," just right, or at least right enough for Chazelle. "He knew when we had it," the composer says of the director. "That's always been our process. Damien is very demanding but when he finally says yes, I'm the first one to recognize that it's great we didn't settle on anything up until that point."

[promo:931138]

Shooting began in August 2015 with a complicated musical number featuring dozens of performers hopping out of their cars on a traffic-stalled freeway. The scene originally was planned for a stretch of ground-level highway, but then Chazelle fell in love with the 105-110 interchange, which arcs 100 feet in the air ("I thought somebody was going to fall off and get killed," says production designer David Wasco). After rehearsals in the warehouses, Chazelle and his team got a permit to shoot throughout a 48-hour period on the closed interchange (both days turned out to be scorchers, with temperatures above 100 degrees). The rest of the 40-day shoot took place at more than 60 other L.A. locations, from a downtown trolley to houses in the Hollywood Hills, with many scenes shot in one take. "It was important that it didn't feel too realistic and then suddenly they break out into musical numbers," says director of photography Linus Sandgren. "The entire film should feel like something magical could happen at any time."

Chazelle spent nearly a year in the editing room with editor Tom Cross focused mainly on getting the tone just right, a concern Stone says was a focus for everyone working on the film. "How do we have a conversation at a jazz club and then float up into space and still feel like the way we're portraying these people feels consistent and coherent?" she says. "That fear followed me for the first two weeks into shooting, and then I realized I had to let it go and trust in the process."

That trust was tested often, especially after those first bad screenings in early 2016. "We would see that a part of the movie wasn't working at all," says Chazelle. "You get hurt for a second, but then you have to regroup and figure it out." The challenge was finding a balance between the film's fantastical, romantic musical numbers and its story about a young couple trying to achieve their dreams in Los Angeles. "It took a while to find the movie," he adds. "Sometimes we weren't positive we could find the balance we wanted."

As Chazelle makes his way through awards season again, he already is gearing up for his next film and hopes to reunite with Gosling. He's working on the script with writer Josh Singer for First Man, a movie about astronaut Neil Armstrong. It's obviously a completely different type of story than La La Land, but Chazelle sees connections. "The space program at that time seemed full of reckless, insane decisions, but basically they set a goal, even though they had no idea how to get there," he says. "That was a little bit the attitude with La La Land: set a goal that we do not exactly know how to get to and then have faith that we would find our way."

A version of this story first appeared in the Nov. 11 issue of The Hollywood Reporter magazine. To receive the magazine, click here to subscribe.