William Mayer, a prolific composer who ranged from orchestral and chamber music to choral works, operas and more, all while displaying a whimsical streak to go along with his serious one, died at his home in Manhattan on Nov. 17, the day before his 92nd birthday.

His daughter the journalist Jane Mayer said the cause was heart failure.

Mr. Mayer received his first commission in 1952, for “Essay for Brass and Winds,” and was still creating new works in the 21st century. His better-known ones included the opera “A Death in the Family,” first produced in 1983 by the Minnesota Opera Company. His compositions were performed at major halls all over the world and recorded by ensembles of various sizes.

Mr. Mayer, though, was not confined to the usual classical music boxes. He once wrote a three-act, six-minute opera, “Brief Candle.”

“The Brooklyn Philharmonic can usually be relied upon to come up with something unusual,” Tim Page wrote in The New York Times in his review of a 1985 performance that included “Brief Candle,” “and Friday night’s program at Cooper Union did not disappoint.”