I read this years ago and often cite the premise to vocalist friends that a good duet is about blend, not competition, as wonderfully demonstrated in this story — and I am always disappointed that I've never been able to remember its title. About the only concrete detail I can recall is that the whole realm was competition-based, and this was just one of many that the hero was involved in.
Probably Blue Adept, the second in the Apprentice Adept series by Piers Anthony. The competitions on the world of Proton are a major plot point, especially the broad variety of such competitions involved. Although as far as I can tell, the duet competition in that book was a harmonica one (that being the favoured instrument of the protagonist).
“Precisely. Now if you play a duet with one person, then with another, and your performance stands improved on the second—?”
“Then probably the other player is superior, enabling me to—“ Stile paused. It was beginning to penetrate. “If I improve because of the other player, it’s him that really makes the difference!”
“When we played together, I improved more than you did,” Clef said. “Who, then, contributed more to the joint effort? The one who flew the heights—or the one who lifted him there?”
“That duet—it was not to show individual expertise,” Stile said, working it out. “It was to show cooperative expertise. How each person fit in as part of a team. Yet surely the Computer did not see it that way; the machine lacks the imagination. So it shouldn’t have—“
“The machine was not the final arbiter. The musicians saw it that way, and their vote was decisive.” The human mind remained more complex than the most sophisticated of machines! Of course the musicians had imposed their standard! “So I supported your effort—“