NEWCASTLE — Aaron Robinson didn’t know much about the lynching of Jim Cullen, but he knew something about the fear of God.

The composer wrote the music for Heartwood Theater’s production of “The Legend of Jim Cullen,” which opens this week at Parker B. Poe Theater at Lincoln Academy in Newcastle.

While Robinson grew up on the midcoast, graduating from Medomak Valley High School in 1989, he spent some of his early years in Aroostook County. His father was a Nazarene minister in Houlton, and Robinson has written a score full of religious overtones and judgment-day darkness.

“You have a lot of hymn sounds, a lot of organ, a lot of fiddle, a lot of bass,” he said. “You might hear a little jig in there, and there’s definitely religious aspect to it. There’s a lot of darkness.”

Robinson, 43, was only vaguely familiar with the Cullen story before Heartwood artistic director Griff Braley pitched the idea. “But I knew what it felt like to know that darkness, that ‘Scared of God’ part of it,” he said. “That’s what I was aiming for.”

Heartwood debuted “The Legend of Jim Cullen” last summer as a dramatic play. This time, Braley and Robinson are telling the story as a musical. It is the true story of a Canadian immigrant lynched in 1873 by a mob in northern Maine. Cullen was accused of killing two men. He was captured by a group of angry residents and hanged on the side of a road.

Portland audiences may remember Robinson as the music director for many Good Theater productions. He also was music director at Immanuel Baptist Church, where he created “Black Nativity – In Concert: A Gospel Celebration,” which recreated the original performance of Langston Hughes’s “Black Nativity.” He has released several CDs and earned a regional Emmy Award nomination for his work on MPBN’s “Maine Arts!” series.

Robinson moved back to midcoast in 2009 and got married a year later. He lives with his wife and young son in Damariscotta.

In addition to a cast of 19, the musical features an 11-piece orchestra. It opens Thursday.

THE SCORE: “This is an incredibly thick orchestra score. Very dark. Very Sondheim, very Bernstein, which is what I grew up listening to. It’s not a standard musical. It’s not a ‘Music Man.’ But it is very ‘Candide’-like, very ‘Sweeney Todd’-like, very dark.”

HOW IT FEELS: Braley asked him, “If you were to take this into the next realm of a musical, what do you think you could you do with it?” Robinson mapped out the play and suggested changes and places to insert songs. He wrote about 90 minutes of music. “We wanted to deliver the light at the beginning of this play, and just darken it straight through all the way to the end. With this musical, we did not end with a big finale. There is no music at the end. There is no big company number at the end. Nobody sings at the end. The end of this show is this big build up, and it just cuts right off — and he hangs.”

IN PORTLAND: “I loved what I was doing, but I was doing something that I termed as fast-food music. I prepared it, I served it, they ingested it and I moved on to the next one.”

THE OBSTACLE: Robinson developed anxieties related to performing in 2006 and eventually stopped playing in public. “I was physically ill at the piano for a lot of years. I was scared to sit at the piano in front of the audience. I could not sit at the keyboard without getting ill. I remember playing for PORTopera and being ill with one hand and playing with the other.”

LEAVING IT BEHIND: He stopped performing in 2007, and two years later moved to back to the midcoast, where he works as a self-employed composer. “It was a bold thing to do. How are you going to put food on the table? How are you going to support yourself, let alone your family? So I moved up here, and everything clicked. Things started to happen. My muse, thank goodness, came fast and furious. I always wonder what I had been suppressing because of time through all of those years.”

ON HOW HE WORKS: Braley “loves the idea of process, which means you start with a blank canvas and you work your way through it. I see the painting completely done, and I just apply it… My wife will tell you, I will say goodnight to her at 8:30 and I’ll go up and come back down in a couple hours and the song will be done. It just flows that way.”

HIS TRAINING: Brian Allen, co-founder and artistic director at Good Theater, Braley and Robinson all graduated from Medomak Valley High School in Waldoboro. “In the 80s, that was a wonderful place. We had a slew of teachers and an administration who were art-oriented, big time. They instilled strong values in so many kids. It was a magical place. To know how much art and theater came out of there is really amazing.”