There is a long tradition in classical music of writing music in sets of pieces that cover all the major and minor keys of the chromatic scale. These sets typically consist of 24 pieces, one for each of the major and minor keys (sets that comprise all the enharmonic variants include 30 pieces).
Examples include Johann Sebastian Bach's The Well-Tempered Clavier and Frédéric Chopin's 24 Preludes, Op. 28. Such sets are often organized as preludes and fugues or designated as preludes or études. Some composers have restricted their sets to cover only the 12 major keys or the 12 minor keys; or only the flat keys (Franz Liszt's Transcendental Études) or the sharp keys (Sergei Lyapunov's Op. 11 set). In yet another type, a single piece may progressively modulate through a set of tonalities, as occurs in Ludwig van Beethoven's Two Preludes through all twelve major keys, Op. 39.
The bulk of works of this type have been written for piano solo, but there also exist sets for piano 4-hands; two pianos; organ; guitar; two guitars; flute; recorder; oboe; violin solo; violin and piano; cello solo; cello and piano; voice and piano; and string quartet. There are examples of attempts to write full sets that, for one reason or another, were never completed (Josef Rheinberger's organ sonatas, Dmitri Shostakovich's string quartets, César Franck's L'Organiste).