Eddie Perfect — yes, that’s the name he was born with — wanted this gig really badly. So when his agent secured a chance for Perfect to pitch himself as a Broadway-caliber composer, he made it clear he was willing to go all in.

“I said, ‘What if I wrote two songs for free?’ ” Perfect recalled recently in a midtown Manhattan dining spot. “ ‘If they hate them — fine. At least I’d get my shot.’ ”

Mind you, this composer was not perfectly situated for the task of writing the score for the musical version of Tim Burton’s “Beetlejuice,” a project that had been brewing for several years. Perfect was living with his wife and young daughters in his native Melbourne, writing show tunes and cabaret songs mostly for Australian consumption. The American writing-directing team that had started work on “Beetlejuice” in 2010, five years before a final composer would be settled on — was 10,000 miles away.

Still, Perfect went to work, writing a pair of numbers for the two pivotal characters of the stage version of the 1988 ghoulishly funny Warner Bros. comedy. And on the basis of those songs, whipped up in about two weeks in 2015 and shipped off to director Alex Timbers and book writers Scott Brown and Anthony King, Perfect was headed on an arduous, high-stakes path to Broadway.

Theatergoers in the nation’s capital will assemble at the National Theatre — where the world premiere musical begins preview performances Sunday — to render the initial verdict on the latest in a burgeoning series of musicals that have been re-engineered for the stage out of Hollywood movies. Washington audiences have become increasingly well-schooled in the tryout process, having bought tickets to “Dear Evan Hansen,” “If/Then,” “Come From Away,” “Next to Normal” and “Mean Girls” before those shows landed on Broadway. How they react to this latest offering, reported to cost $21 million, will be a barometer of “Beetlejuice’s” fortunes in Broadway’s Winter Garden Theatre, where it is scheduled to begin performances in March.

And although this is also a maiden excursion to the theatrical big time for the show’s other writers — Brown and King authored “Guttenberg, the Musical,” an off-Broadway spoof — no one involved in “Beetlejuice” has more riding on this moment than the 40-year-old Perfect.

Perfect is credited as “songwriter” for the Broadway premiere of “King Kong,” a spectacle hatched in Australia that met with mixed reviews in Melbourne, but it is “Beetlejuice,” with its Broadway-proven actors and star director (Timbers is coming off the critically acclaimed Boston tryout of a musical version of the 2001 movie “Moulin Rouge!”) that is likely to be the more definitive proving ground.

 “It took a long time to get here, and it’s been really hard,” said the composer, who has just moved his family to Manhattan. “And to be honest, I never thought I’d get here.”

Perfect has been a popular recording artist and comic songwriter in Australia. He ventured into musical comedy a decade ago with his satirical bio-musical “Shane Warne: The Musical,” based on a onetime Australian star cricketer. Though he has been eager to break into theater here, a musical about a former captain of the Australian national team playing something called “limited overs cricket” was never a safe bet to get him noticed. When he learned that “Beetlejuice” was on a wide search for a composer, he saw his opening.

 “He just immediately got the voice, the sound of the show,” Timbers said recently during a break from technical rehearsals at the National. Once Perfect was hired, he and the rest of the creative team would hold long-distance conference calls, with Perfect contributing from his dining room in Melbourne.

 “When he played things, he would pull a blanket over his head so he could get the right acoustical intimacy,” Timbers said. “I went, ‘Wow, he’s doing monster voices under a blanket.’ ”

“Beetlejuice” takes place in a house haunted by a trickster named Betelgeuse, portrayed by Michael Keaton in the hit film and by Alex Brightman (of “School of Rock” on Broadway fame) in the musical. His role and that of Lydia, the death-obsessed teenager who moves into the house (Winona Ryder in the movie and Sophia Anne Caruso onstage), have been enlarged for the musical. That a composer was not enlisted at the outset was a bit unorthodox, but as the creative team explained, a lot of effort went into working out a narrative framework for a stage version first. And to get to the right songwriter, there was, as Timbers put it, “a very long journey to find who that person was, and that person ended up living in Australia.”

For the record, Brown, King and Timbers all loved the two songs Perfect submitted as a job applicant. For Betelgeuse, he composed “The Whole Being Dead Thing” in a crazy salad of styles, “everything from ska to folk to death metal to swing jazz,” he said. For Lydia, it was the song “Dead Mom.” “I wanted an angsty teen singing with a Fender guitar plugged into a little amp,” Perfect said.

“Oh, my God, he completely found it,” King said in a conference call with Brown. “It was so funny and it felt like the spirit of the comedy in our script.”

Brown concurred: “When someone sings their feeling onstage, it can even sound like the most mannered thing in the world — or it can sound like the most wonderful anarchy. And Eddie knocked it right out of the park.”

So productive were these first at-bats that both songs made it into the show. Given the number of melodies that end up in a Broadway songwriter’s file of drafts, that’s pretty remarkable. As a matter of fact, such an outcome sounds, well, almost too perfect.

If you go


National Theatre, 1321 Pennsylvania Ave. NW. 202-628-6161. thenationaldc.org.

Dates: Sunday-Nov. 18.

Tickets: $54-$170.