Beneath a repetitive piano figure, a yearning string quartet and oboe telegraph the pain of a love forbidden. Interior monologues reveal secrets as a minor-key melody unfurls in strands that start, stop, and start again.

If a certain chic depravity hovers over Cymbeline, Michael Almereyda's dark film starring Ethan Hawke, Ed Harris, John Leguizamo, and Dakota Johnson, it's not just because of the drugs, torture, and a beheading. The author of those story elements is William Shakespeare. The setting's urban edge draws much of its poignance from the score by David Ludwig - a composer known perhaps more for being a part of the Curtis Institute of Music's genteel traditions than sex, low-life bikers, and Shakespearean tragedy.

"There's definitely a ton of crossover in skill sets between composing for stage and writing for screen, but in the end they are very different endeavors - like writing a screenplay vs. writing a play for live theater actors," said Ludwig, Curtis' dean of artistic programs and a composition professor. His score for the film, which opened Friday at area theaters, co-mingles nicely with Bryan Senti's substantially more gritty electronica music. "It is a fast learning curve, but few moments in my career have been as rewarding as hearing that first cue I wrote playing through the sound system there at the movies."

Ludwig, 42, met director Almereyda - much admired for his 2000 film of Hamlet in a contemporary setting - at the MacDowell Colony, the artists' retreat in New Hampshire, two summers ago while working on an orchestral piece. "We got along well, he asked to hear some of my music, so I gave him a couple of CDs," he said, "and didn't think much more of it."

Then he got a call asking whether he'd be interested in scoring a film. "Michael explained later that he heard the music and liked it very much and kept me in mind just as the time for adding music to Cymbeline was coming up."

The process started with Ludwig's meeting the film team in the studio space in New York to watch the whole film in a "spotting session" to talk through the narrative of the music. Then, the film was sent, digitally, to Ludwig, and he began scoring specific patches of music.

But the music Ludwig arrived at is different from his concert music. Why?

"For me, film music - especially when dialogue is involved - has to have a different sense of musical timing, or yes, 'density,' than stage music," says Ludwig. "One thing to notice is that in films, music dances in and out of the dialogue - it plays with it and weaves around spoken words. The music will also react in some way to what's happening on the screen to reflect the plot, mood in the scene, or in the psychology of the characters. So this extra element elicited a different style from me - still contemporary sounding, but really there to frame the drama, not get in its way. The director said to me, 'The music is stretched like a skin over the movie after it is made.' I think that's really so eloquently and well put."

Of Senti's music, he says, it "interacts nicely with what I've written to highlight some of the natural clashing in the film between Shakespeare's language and the more contemporary urban themes of Almereyda's adaptation." For his part, Senti - who wrote both the opening and closing music - says his electronica is, stylistically, at "the intersection between chill wave and grave wave."

And yet elements of concert music, and even perhaps Ludwig's compositional lineage, sneak into the score. Near the end of the film, there's a section that has the same melancholy as Dover Beach by Barber, who preceded Ludwig at Curtis by many chronological years, if not so many stylistic ones.

"Film composing is a great art form with a significant tradition. Some of my Curtis composer forebears, Leonard Bernstein and especially Nino Rota, were big 'teachers' of mine for Cymbeline. Of course, without John Williams and Philip Glass, movie music wouldn't be the same."

Glass figures into this Cymbeline, if indirectly.

"Coincidentally enough, maybe a year before this movie came up, I had dinner with Philip Glass after a performance of Einstein on the Beach in Berkeley, and he told me I should write music for film. Some of his music was in the temps [temporary space-holders in the audio] of this movie, too. Like many other composers, Phil's music was very influential on me, and I hear his echoes in my own music in Cymbeline."

One big difference between writing for the concert hall and film is obvious when you consider that Ludwig wrote about 90 minutes of music (over 28 days), and only about 30 minutes of music actually made it into the film.

"Lots of concert music composers would be perfectly happy to write that much in a full year, so the pressure to get the music in the can is pretty strong. Everyone is waiting on you! There's the adrenaline rush and inspiration of it all, but I felt lucky to have my training as a concert music composer to fall back on when I needed it."

Ludwig's work for the concert hall has included performances by the Minnesota Orchestra, National Symphony, and Chamber Music Society of Lincoln Center, and he leaves Cymbeline enamored with a genre that is at once more restrictive and less compartmentalized.

"I have to say, I loved the experience and loved working with these directors, producers, and film team," he said. "Counter to what we usually hear, they were always professional, very direct, but always in a thoughtful way, and very considerate of my artistic space - as long as it worked in the film. So I'd be very glad if this was a regular part of my career, and already there's been some interest expressed from other places."