In the story a computer is used to analyze all music for the perfect tune. By the end, when the tune is found, it mesmerizes the man, and he becomes near catatonic. Anyone remember the title or author?
"The Ultimate Melody", a short story by Arthur C. Clarke, one of his Tales from the White Hart; also the answer to the question Name of a short story about the ultimate earworm. A shorter version, minus the "White Hart" frame, appeared in If, February 1957, which is available at the Internet Archive. Any of these covers ring a bell?
"For what Gilbert was trying to do was to lay a scientific foundation for the theory of hit-tunes. Of course, he didn't think of it that way: he regarded it as a pure research project, and didn't look any further ahead that a paper in the Proceedings of the Physical Society. But I spotted its financial implications at once. They were quite breath-taking.
[. . . .]
"Huh!" said John Christopher. "It's only a rehash of Plato's theory of ideals. You know—all the objects of our material world are merely crude copies of the ideal chair or table or what-have-you. So your friend was after the ideal melody. Did he find it?"
"I'll tell you," continued Harry imperturbably. It took Gilbert about a year to complete his analysis, and then he started on the synthesis. To put it crudely, he built a machine that would automatically construct patterns of sound according to the laws that he'd uncovered. He had banks of oscillators and mixers—in fact, he modified an ordinary electronic organ for this part of the apparatus—which were controlled by his composing machine. In the rather childish way that scientists like to name their offspring, Gilbert had called this device Ludwig.
[. . . .]
"There was no doubt of one thing. Ludwig had finally worked. The assistant had gone off to lunch while Gilbert was making the final adjustments, and when he came back an hour later the laboratory was pulsing with one long and very complex melodic phrase. Either the machine had stopped automatically at that point, or Gilbert had switched it over to REPEAT. At any rate, he had been listening, for several hundred times at least, to that same melody. When his assistant found him, he seemed to be in a trance. His eyes were open yet unseeing, his limbs rigid. Even when Ludwig was switched off, it made no difference. Gilbert was beyond help.
In case anyone is wondering how the assistant escaped:
"Really!" he said. "Is this a cross-examination? I didn't mention the point because it was rather trivial. But it explains why I was never able to get the slightest inkling of the nature of that melody. You see, Gilbert's assistant was a first-rate lab technician, but he'd never been able to help much with the adjustments to Ludwig. For he was one of those people who are completely tone-deaf. To him, the Ultimate Melody meant no more than a couple of cats on a garden wall."