The stage brightens. All that is visible is a wall and a door that opens to reveal the protagonist, Merricat. She begins to sing, informing the audience that the towering wooden structure behind her is her house, and prances backward as the wall lifts to reveal the inhabitants within.

[ydn-legacy-photo-inline id=”6209″ ]

Lifting the walls and peering in is one of the central ideas of “We Have Always Lived in the Castle,” a musical based on the Shirley Jackson novel by the same name, which premiered at the Yale Repertory Theatre on Friday. Written by Obie Award-winner Adam Bock and Todd Almond, the musical depicts a family touched by tragedy, examining its characters not from outside the house, but from within its walls.

“Something I realized we never know is what’s going on inside a house,” Bock said. “We don’t know who people really are. We make judgments without knowing. That, to me, feels like a universal quandary.”

The Yale Rep commissioned Bock to write “Castle” in 2008, in line with its support of the production of new theatrical works. But because about 95 percent of the Yale Rep premieres are plays, “Castle” — a musical with a cast of 12 professional actors — is an exception.

Casting for the musical took place last March, with rehearsals starting in the beginning of August. Bock, who said he usually gets three-and-a-half weeks of rehearsal time, said the seven-week rehearsal schedule for this play is indicative of its importance for the Yale Rep.

[ydn-legacy-photo-inline id=”6207″ ]

[ydn-legacy-photo-inline id=”6210″ ]

“People usually think musicals are ‘light,’ ” Bock said. “So we had to ask ourselves: ‘Can we tell this story, which is both dark and light, with music?’ ”

Almond, who created the music for the play, said he has always been interested in the role of music in theater, and was particularly drawn to the dark tone of Jackson’s novel after Bock approached him with the idea.

Jackson, a mid-20th century American writer, was under-appreciated for most of the century, said Yale Rep spokesman Steven Padla. But recently, after the Library of America published a collection of Jackson’s writings this year, Jackson’s work is getting a closer look than it has in a long time, he added.

The process of adapting the novel into a musical was an artistic challenge.

“Adaptation from one medium to another is more than just taking the plot and just saying, ‘This is what happens,’ ” Almond said. “It’s like taking a sculpture and turning it into a poem, but trying to create the same interaction with the audience that the sculpture has.”

Bock added that he wanted the musical to be elegant, but shocking and exciting at the same time.

Though “Castle” is up and running at the Yale Rep, Bock and Almond have yet to determine the future of the play following its three-week stint here. Bock and Almond both have plans for after “Castle” premiers: Bock will premier “A Small Fire” in New York City, while Almond will work on a production of “Hamlet” in New York and Abu Dhabi.

“We actually really like this,” Almond said. “Hopefully people want to see more.”

“We Have Always Lived in the Castle” is playing through Oct. 9.