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, Frédéric Chopin's 24 Preludes, Op. 28 and Dmitri Shostakovich's 24 Preludes and Fugues, Op. 87 (1950–51). 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 2 Preludes through all the 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).
Notable sets that cover all 24 keys Vincenzo Galilei: Libro d’intavolature di liuto, (1584) - a work containing an early set of 24 dances for lute in all 24 keys Johann Sebastian Bach: The Well-Tempered Clavier, Books I and II (1722 and 1742) – two separate sets of 24 preludes and fugues, together known as "the 48". Frédéric Chopin: 24 Preludes, Op. 28 (1835–39) Franz Liszt: Transcendental Études, S. 139 (1826–52) cover only the keys in flats and with no accidentals. Liszt did not fulfill his original intention to write the full suite of 24 études in all keys. In 1897–1905, Sergei Lyapunov wrote his 12 Études d'exécution transcendante, Op. 11, which cover the remaining keys, in sharps, and are dedicated to Liszt's memory."Liszt: The complete music for solo piano, Vol. 4 – Transcendental Studies performed by Leslie Howard", Hyperion-Records.co.uk. Charles-Valentin Alkan: 25 Preludes, Op. 31 (1847); 24 études in all the major and minor keys, Opp. 35, 39 (1848 and 1857) Alexander Scriabin: 24 Preludes, Op. 11 (1893–95) – Scriabin wrote a total of 90 preludes for piano (50 in major keys, 31 in minor keys, and 9 in indeterminate keys). These contained only one complete set of preludes in all 24 major and minor keys. Sergei Rachmaninoff: 24 Preludes, Opp. 3/2, 23, and 32 (1892, 1901–03, and 1910) Paul Hindemith: Ludus Tonalis (1942) – 12 fugues and 12 interludes covering all twelve keys, where the major/minor distinction does not apply, book-ended by a praeludium and a postludium. Dmitry Kabalevsky: Preludes, Op. 38 (1943–44) – each in a different key and each based on a folksong Dmitri Shostakovich: 24 Preludes and Fugues, Op. 87 (1950–51) – Shostakovich also wrote a separate set of 24 Preludes, Op. 34 in 1933.
Composers who wrote multiple sets
A number of composers have written multiple sets of works covering all the keys of the scale. 14 sets: Niels Viggo Bentzon (1919–2000) wrote 14 complete sets of 24 Preludes and Fugues, a total of 336 pieces in this genre alone."Niels-Viggo Bentzon", Musicweb-international.com. Retrieved 2 February 2015 Roberto Novegno (born 1981) has also written 14 complete sets of preludes so far, each using a different sequence of keys. 8 sets: Carl Czerny 5 sets: Charles-Valentin Alkan, Joachim Andersen 4 sets: Richard Hofmann, Franciszek Zachara 3 sets: Adolf von Henselt, Charles Koechlin, Christian Heinrich Rinck 2 sets: Lera Auerbach, David Cope, Johann Baptist Cramer, Ferdinand David, Hans Gál, Stefano Golinelli, Johann Nepomuk Hummel, Aaron Andrew Hunt, Friedrich Kalkbrenner, Nikolai Kapustin, Joseph Christoph Kessler, Craig Sellar Lang, Trygve Madsen, Désiré Magnus, Ignaz Moscheles, Rob Peters, Jaan Rääts, Igor Rekhin, Dmitri Shostakovich (he also left unfinished a set of string quartets in all keys), Sir Charles Villiers Stanford, Sulkhan Tsintsadze, Louis Vierne, Vsevolod Zaderatsky other: Franz Liszt wrote only one set of his own, but he also transcribed for piano solo a set for violin and piano by Ferdinand David. Josef Rheinberger wrote one full set, and died before completing a further set of organ sonatas.
Full details are shown in the tables below.
Variants
Single pieces that modulate through many keys
Ludwig van Beethoven wrote 2 Preludes through all 12 Major Keys, Op. 39 for piano (1789). These two preludes each progressively traverse the 12 major keys. In Prelude No. 1, each key occupies from 2 to 26 bars. The keys of C and D, which are enharmonically equivalent, are both represented. C major both opens and closes the set. In Prelude No. 2, the cycle of keys appears twice; in the first cycle, the number of bars per key ranges from 1 to 8; in the second half, after C every new key signature lasts for only one bar; the cycle concludes with 15 bars of C major. There is no evidence that Beethoven intended to write similar sets in the 12 minor keys.
Giovanni Battista Vitali (1632–1692) included in Artificii musicali, Op. 13 (1689) a passacaglia which modulates through eight major keys (out of twelve) from E major to E major through the cycle of fifths.
Fugue No. 8 from Anton Reicha's Trente six Fugues pour le Piano-Forté composées d'après un nouveau systême (subtitled Cercle harmonique) modulates through all keys.
The rondo theme of Darius Milhaud's Le bœuf sur le toit is played fifteen times in all 12 major keys (twice in A major and three times in the tonic, C major). It also passes through every minor key except E minor and B minor.
Works covering all eight church modes
Around 1704, Johann Pachelbel completed his 95 Magnificat Fugues, which covered all eight of the church modes.
Charles-Valentin Alkan composed Petits préludes sur les huit gammes du plain-chant, for organ (1859, no opus number), a sequence of eight organ preludes covering each of the church modes.
In the music of the Eastern Orthodox Church, the doxasticon for Vespers of the Dormition is notable as a single hymn that includes passages in all eight tones of the Byzantine Octoechos.John Sanidopoulos, The Unique Eight Toned Hymn of the Dormition of the Theotokos, August 14, 2013
Other sets of 24 pieces Not all sets of 24 pieces belong in this category. For example, there was no intention in Niccolò Paganini's 24 Caprices for solo violin, Claude Debussy's 24 Préludes for piano, or Pavel Zemek Novak's 24 Preludes and Fugues for piano to cover all the keys. (Paganini may not have been aware of Pierre Rode's 24 Caprices for violin, which did span the 24 keys and were written almost at the same time as Paganini's.)
Chopin's 24 Études, Opp. 10 & 25 might have originally been planned to be in all 24 keys. In fact, apart from Nos. 7 and 8, the first series (Op. 10) is made of couples of études in a major key and its relative minor (the major key either preceding the minor key or following it) with none of the tonalities occurring twice (except for C major, which appears in No. 1 and then in the only couple which is not major-minor, i.e. Nos. 7 and 8). But in the second series (Op. 25) this tonal scheme gets more and more loose. It is still possible to see connections on a tonal basis between the couples of études in Op. 25, but they are not based on one principle (e.g. Nos. 3 and 4 in F major – A minor, two tonalities which Chopin likes to put together very often, as in his second Ballade).
Keys There are 12 notes in the octave, and each of them can be the tonic of one major and one minor key. This gives 24 possible keys, but each note can be represented by several enharmonic note names (note names which designate the same actual note in the 12 note octave such as G and A) and so each key can be represented by several enharmonic key names (e.g. G minor and A minor).
In practice, the choice of key name is restricted to the 30 keys whose signatures have no double flats or double sharps. (Such key signatures are used for so-called theoretical keys which are almost never encountered outside music-theoretical exercises.) Keys with 6 flats and 6 sharps, with 7 flats and 5 sharps and with 5 flats and 7 sharps are enharmonic to one another. Composers will, in most (though not all) cases, choose only one key from each enharmonic pair. But there are also cases of sets covering all 30 keys, which, in other words, include all enharmonic variants.
The table below outlines the choices made in the various collections listed here. The keys are in the order that J.S. Bach used.
Key Key signature Comments 1 C major No sharps or flats 2 C minor 3 flats 3 C major 7 sharps J.S. Bach and Alkan chose C major, but most composers have used D major. D major 5 flats 4 C minor 4 sharps 5 D major 2 sharps 6 D minor 1 flat 7 E major 3 flats 8 D minor 6 sharps Most composers of sets of 24 pieces used E minor rather than D minor. J.S. Bach, Lyapunov and Ponce are among the few who have used D. The first use of D minor was in J.S. Bach's The Well-Tempered Clavier, in Fugue No. 8 from Book 1 (although its corresponding Prelude was written in E minor), while D minor was used for both the Prelude and the Fugue in Book 2. Another is in Lyapunov's Étude d'execution transcendante No. 2, subtitled "Ronde des Fantômes". E minor 6 flats 9 E major 4 sharps 10 E minor 1 sharp 11 F major 1 flat 12 F minor 4 flats 13 F major 6 sharps F major was the choice of J.S. Bach, Hummel, Chopin, Heller, Busoni, Lyapunov, Arensky, Blumenfeld, Ponce, Shostakovich, Cui and Glière. G major, on the other hand, was preferred by Alkan, Rachmaninoff, Scriabin, Shchedrin, Bowen, Stanford and Winding. G major 6 flats 14 F minor 3 sharps 15 G major 1 sharp 16 G minor 2 flats 17 A major 4 flats 18 G minor 5 sharps Alkan wrote a piece in A minor, and Brahms a fugue in this key, but most composers have preferred G minor. A minor 7 flats 19 A major 3 sharps 20 A minor No sharps or flats 21 B major 2 flats 22 A minor 7 sharps No well-known sets of 24 pieces include A minor. Two examples are from Bartolomeo Campagnoli's 30 Preludes for violin, and Christian Heinrich Rinck's 30 Préludes from his Practical Organ School, Op. 55, published before 1821. B minor 5 flats 23 B major 5 sharps No well-known sets of 24 pieces include C major. While this key is sometimes used in compositions (particularly for the harp, which is especially suited to this key), it is not generally considered one of the standard keys because it is enharmonically equivalent to B major. With its tonic note being a white key on the piano, and its parallel minor (relative to E major) having 10 flats, its usage is generally undesirable. C major does appear in Campagnoli's and Rinck's works mentioned below, along with A minor, but those collections include both members of all six enharmonically equivalent pairs. C major 7 flats 24 B minor 2 sharps
Order of keys in published works The circle of fifths, whereby each major key is followed by its relative minor key, and the sequence proceeds in fifths (C, a, G, e, D, b ...) is a commonly used schema. Angelo Michele Bartolotti used this approach as early as 1640, and it was also adopted by such later composers as Rode, Hummel, Chopin, Heller, Busoni, Scriabin, Shostakovich, Kabalevsky and Kapustin.
In J.S. Bach's The Well-Tempered Clavier and some other earlier sets, major keys were followed by their parallel minor keys, and the sequence ascends chromatically (C, c, C/D, c, D, d, ...). The Bach order was adopted by Arensky, Glière, York Bowen and others.