You mean the organ puzzle? It controls the bars in the grate in another section of the castle.

SolutionHit all the keys at the same time to raise all the bars.