That's The 5000 Fingers of Dr. T
a 1953 Technicolor American musical fantasy film about a boy who dreams himself into a fantasy world ruled by a diabolical piano teacher enslaving children to practice piano forever, the only feature film written by Theodor Seuss Geisel (Dr. Seuss), who wrote the story, screenplay and lyrics.
Young Bart Collins (Tommy Rettig) lives with his widowed mother Heloise (Mary Healy). The bane of Bart's existence is the hated piano lessons he endures under the tutelage of the autocratic Dr. Terwilliker (Hans Conried). Bart feels that his mother has fallen under Terwilliker's influence, and gripes to their plumber, August Zabladowski (Peter Lind Hayes), without result. While hammering at his lessons, Bart dozes off and enters a musical dream.
In the dream, Bart is trapped at the surreal Terwilliker Institute, where the piano teacher is a madman dictator who has imprisoned non-piano-playing musicians. He built a piano so large that it requires Bart and 499 other boys (hence, 5,000 fingers) to play it. Bart's mother has become Terwilliker's hypnotized assistant and bride-to-be, and Bart must dodge the Institute's guards as he scrambles to save his mother and himself. He tries to recruit Mr. Zabladowski, who was hired to install the Institute's lavatories ahead of a vital inspection, but only after skepticism and foot-dragging is Zabladowski convinced to help. The two construct a noise-sucking contraption which ruins the mega-piano's opening concert. The enslaved boys run riot, and the "atomic" noise-sucker explodes in spectacular fashion, bringing Bart out from his dream.
Here's a trailer from Youtube, cued to where it starts showing scenes from the movie: