To many, musical theater has a reputation for being pretentious, overwrought and sometimes plain boring.

But when composer David Mallamud was approached about contributing a new piece to Water Music NY — a feature of the Erie Canal’s bicentennial celebration — he wanted something everybody in the audience could enjoy and relate to.

With help from playwright Nathan Christensen, Mallamud ended up writing a localized and comedic ­take on Cinderella. Their version is named “Spittoonia on the Erie Canal.”

About 40 members of the Albany Symphony will perform the piece on a barge in Lockport’s stretch of the Erie Canal on July 8. It’s the last of seven Water Music performances across upstate New York, each featuring an original composition.

“I think it’s a lot of fun,” Christensen said. “A lot of times when you see a classical music concert, you expect it to be very serious. But this is a lot of fun.”

Mallamud, who has composed for Carnegie Hall and the Kennedy Center, was approached about creating a piece for the Albany Symphony’s Lockport concert in March. Faced with a tight deadline — he prefers to let ideas gestate for a few months before getting to work — he hatched the plan to rework Cinderella to include Lockport and Erie Canal history. Needing help with the narration, Mallamud reached out to Christensen, a successful playwright for the past 15 years.

“He’s telling a Cinderella story on the Erie Canal,” Mallamud said. “So it’s plugging these things into a story and going from there.”

Through their research, Mallamud and Christensen found natural ways to connect the Cinderella story to the canal and the early 19th century. The ball takes place on Gov. DeWitt Clinton inaugural barge on the canal, spiritualists play a large role in the story (a nod to the Second Great Awakening that swept the region at the time) and the play concludes at the Flight of Five Locks.

The title is a play off the original. Mallamud noted the name Cinderella comes from ash cinders, which the titular character had to clean; in their play, she is tasked with cleaning tobacco spittoons. It’s just one example of the humor Christensen included in the piece.

“It just sort of lives in that world around that time period,” Christensen said.

Musically, the nearly 40-minute piece will span centuries of American music, incorporating elements of early country, bluegrass, Americana, vaudeville and rock music. Mallamud is known for incorporating rock and other modern genres into his music, composing Alice Cooper-style rock for one recent musical and working with Mike Mills of R.E.M. fame.

“I’m influenced by everything under the sun,” Mallamud said. “I’ve written in a lot of different styles. It’s definitely part of how I write and listen to music.”

“With this piece, I’ve written it so that each style carries its own weight,” he added.

Mallamud and Christensen hope that with a familiar story, good humor and popular music styles, “Spittoonia” will be enjoyable to musical theater newcomers and buffs alike.

“The goal is always to reach and engage the listener,” Mallamud said. “This seemed like a very universal story to use.”

The performance will take place at 8 p.m. July 8 at the Flight of Five Locks. A fireworks display will follow the performance.