Comedy is supposed to be universally appealing, but it often stumbles up against the fact that not everyone thinks the same thing is funny. I was struck anew by this at the comic opera “The Inspector,” by John Musto and Mark Campbell, which had its world premiere at the Barns at Wolf Trap on Wednesday night.

Midway through the opera, which is chockablock with characters portrayed as broad cartoons, the corrupt wife of the corrupt mayor of a small Sicilian town launches into a description of the shoes she will wear when she gets to Rome: “Open-toed, buckled and bowed, beaded, bejeweled, embroidered . . . bold and brassy! Chic and classy! Quaint and lacy! Slightly racy!”

It goes on in this vein for quite a while, and moves on to hats and then gowns before she’s done. Sarah Larsen — originally scheduled as the role’s cover but taking over when Luretta Bybee had to cancel due to illness — savored the words, rolled around the stage and got a lot of laughter from the audience.

For me, though, comedy is generally funnier when the characters are playing it straight, when they’re three-dimensional enough that you believe in their emotions and motivations, and they aren’t simply aiming at laughs. There wasn’t anything in this aria that told you much about the character who was singing it, beyond that she was greedy. (Compare Leporello’s aria in “Don Giovanni” enumerating the different kinds of women Giovanni likes to sleep with, which provides a snapshot of both the master and his servant.)

“The Inspector” is entirely caricature: Its goal is to be a broad slapstick. Loosely based on a short story by Gogol, but moved to Mussolini-era Italy, it’s the story of a city government thrown into turmoil by the impending arrival of a government inspector from Rome, traveling incognito. Predictably, the local officials fasten on an unsuspecting stranger, decide he must be the inspector in question, and wine, dine and bribe him until he makes his escape.

There’s a lot to like about the show — including the turntable-based set by Erhard Rom that makes maximum use of the Barns’ small stage, and some very strong musical performances led by conductor Glen Cortese — but I found it got a little old not having anything or anyone really to care about. Your mileage, however, may vary. Certainly, the piece was received with audible amusement and warm applause.

There was plenty of depth in the music. Both Campbell’s words and Musto’s music work with familiar opera or musical-comedy tropes (“The Inspector” has its own “Giovanni”-like master-servant pairing in the figures of Cosimo and the romantic lead, Tancredi), but Musto is better at bringing new life to the familiar forms. His score is studded with dance rhythms and patter figures and even a recurring Italian-film-score motif (you can imagine a camera panning over ocher walls blurred by the rising heat). It also draws heavily on the musical theater idiom of Bernstein and Sondheim, rife with syncopations and catchy but complex melodies.

The resulting music sparkles; it’s also rendered with a harmonic substance and intricacy that give the ear a lot to enjoy every step of the way. Happily, these performances are being recorded for a forthcoming CD.

And the musical gags succeeded better than the words at combining adroitness and broad humor. For instance: the four soloists who played the four no-good members of the town council (a chain-smoking minister of health played by Dorothy Byrne; a lissome dumb-blond bombshell of a “directress of education managementation,” the creamy-voiced soprano Angela Mannino; a sadistic police chief sung strongly by bass Matt Boehler; and a cynical priest called Padre Ruffiano, overcast with keen tenor Javier Abreu) kept chiming in with echoes of one another’s observations on different notes of a chord, like a warped barbershop quartet.

Leon Major’s direction also made the most out of what he had — even if that meant simply trying to find ways to communicate the relentless mugging of Campbell’s texts, having the quartet pop up and down like jack-in-the-boxes. The other denizens of Santa Schifezza — the fictive town where the action is set (“schifo” being Italian for “disgusting”) — included a pair of hapless postal workers named Bobachina (Andrea Shokery) and Bobachino (Hilary Ginther, sometimes hard to hear), who bumble about and jumble their words unconvincingly.

Then there were Cosimo and Tancredi, two fugitives from Mussolini’s Rome who are stranded penniless in the local hotel when the mayor finds them and decides Tancredi is the inspector he’s waiting for. Here lay the piece’s greatest missed opportunity for character development. Both singers and roles were promising: Local favorite William Sharp (as the baritone teacher-servant Cosimo) sang soundly in his one big aria, but all he was recounting was the different foods he would like to eat. And Vale Rideout expended tenorial ardor on his delight at the payoffs he was getting from the mayor. Only when confronted by the mayor’s inexplicably upright daughter, Beatrice, did Tancredi reveal his political leanings and show himself to be more than fatuous and shallow — by which time it was too late to get deeply involved with his character. Even Beatrice, though portrayed with some fine jewel-toned singing from Anne-Carolyn Bird as a girl eager to escape this awful town, remained largely a stereotype of bluestockinged awkwardness. And the expected romantic denouement remained offstage. Real feelings had no place in this piece — which is how the creators wanted it.

The plum role went to Robert Orth, as Mayor Fazzobaldi (say it out loud to get the joke). The stereotype of the greedy local potentate with delusions of grandeur is a comedic standby, and the veteran Orth was able to mine it with just the right tone and a great deal of enjoyment. Indeed, he may have been the deepest character in the whole opera and certainly had the most face time. He was onstage right through the end, when this shaggy-dog story of an opera concluded, to everyone’s credit, with an unexpected and genuinely funny punch line.

The Inspector

will be performed Friday at 8 p.m. and Sunday at 3 p.m. at the Barns at Wolf Trap, 1635 Trap Rd., Vienna. Visit or call 877-965-3872.