You don’t create a lavish movie musical in a hurry. It took “Whiplash” writer-director Damien Chazelle and composer Justin Hurwitz six years to realize their long-held dream of making “La La Land.”

Friends dating back to their Harvard days a decade ago, Chazelle and Hurwitz loved the ’60s Jacques Demy-Michel Legrand musicals “The Umbrellas of Cherbourg” and “The Young Girls of Rochefort” — their splashy colors, the memorable songs, the romance and heartbreak of their stories.

“That is a very French sensibility, but of course they are completely indebted to the most American movies you can imagine, the MGM musicals, the Gene Kelly and Fred Astaire musicals,” Chazelle says.

Just as the Demy films embraced the American musical sensibility, “La La Land” embraces the classic style, but adds its own contemporary touches.

“It was about finding a tone that would never veer too old but never too new, never too magical or fantastical, but never too realist,” Chazelle says. “It needed to have its foot in both worlds at all the times.”

For composer Hurwitz, and lyricists Benj Pasek & Justin Paul, that meant going back to the drawing board again and again. “I was working on the music at the same time Damien was writing the script,” Hurwitz recalls. “Melodies that stick with you are so important. I do so many demos for him, and he says ‘no’ a lot until I finally get to the right one. It may be the 25th or 30th, but I’m the first to recognize that it’s worth waiting for.”

With most of the tunes in place, they hired Broadway songwriters Pasek and Paul (“A Christmas Story”) in late summer 2014 to pen the lyrics. “Damien would go through every shot that he had in his head, where the camera would swoop in, where we would meet the characters, how they would move,” says Pasek. “That was so informative to our process, because we knew exactly how it would look and how the characters would be using language.”

For the next year, about once a month they would all meet, either in L.A. or New York. Then, when Emma Stone and Ryan Gosling were cast as the leads, they tweaked and rewrote the songs. “The actors become sort of the litmus test,” adds Paul.

Case in point: the flirtatious “A Lovely Night,” which started out with the two “making fun of each other, based on the stereotypes of being a jazz musician or an actress,” Pasek says.

“When we began to tailor it for their voices, it became a little more sophisticated, a little more mature in their interaction.”

The big production numbers (the freeway opening “Another Day of Sun,” the roommate song “Someone in the Crowd,” the dance number “A Lovely Night”) were pre-recorded, but the more intimate “City of Stars” duet and “Audition” were done live on-set, with the actors hearing the music (with Hurwitz just off-camera playing electric piano) via tiny earpieces.

Hurwitz was wowed by Gosling’s commitment to learning the piano, specifically seeming to play the elaborate jazz solos laid down by veteran L.A. pianist Randy Kerber.

“There are no CGI hands, no piano doubles, he really had to learn it,” Hurwitz says.

The background score, with a 95-piece L.A. orchestra and 40-voice choir, was recorded in May through June, with Hurwitz using additional material that he had written over the years as well as adaptations of his song melodies.

Thanks to the Alan Menken-Howard Ashman Disney musicals of the late ’80s and early ’90s, Pasek believes, “our entire generation is primed to believe that characters can express their emotion through song. Not in an ironic way, not winking at the audience, but really buying into the truth of using a song to heighten the emotion and using songs to tell a story. It’s something that feels so refreshing because musicals are a true American art form that people love.”