In music, variation is a formal technique where material is repeated in an altered form. The changes may involve melody, rhythm, harmony, counterpoint, timbre, orchestration or any combination of these.

Variation is often contrasted with musical development, which is a slightly different means to the same end. Variation depends upon one type of presentation at a time, while development is carried out upon portions of material treated in many different presentations and combinations at a time.

Variation techniques Mozart's Twelve Variations on "Ah vous dirai-je, Maman" (1785), a French folk song known in the English-speaking world as "Twinkle, Twinkle, Little Star", exemplifies a number of common variation techniques. Here are the first eight bars of the theme:

Melodic variation Mozart's first variation decorates and elaborates the plain melodic line:

Rhythmic variation The fifth variation breaks up the steady pulse and creates syncopated off-beats:

Harmonic variation The seventh variation introduces powerful new chords, which replace the simple harmonies originally implied by the theme with a prolongational series of descending fifths:

Minor mode In the elaborate eighth variation, Mozart changes from the major to the parallel minor mode, while combining three techniques: counterpoint, suspensions and imitation:

Other examples Variation techniques are frequently used within pieces that are not themselves in the form of theme and variations. For example, when the opening two-bar phrase of Chopin's Nocturne in F minor returns later in the piece, it is instantly repeated as an elegant melodic re-working:

Debussy's piano piece "Reflets dans l'eau" (1905) opens with a sequence of chords:

These chords open out into arpeggios when they return later in the piece:

Sometimes melodic variation occurs simultaneously with the original. In Beethoven's "Waldstein" piano sonata, the main second-subject theme of the opening movement, which is in sonata form, is heard in the pianist's left hand, while the right hand plays a decorated version. (See also heterophony.)

While most variations tend to elaborate on the given theme or idea, there are exceptions. In 1819, Anton Diabelli commissioned Viennese composers to create variations on a waltz that he had composed:

Beethoven contributed a mighty set of 33 variations on this theme. The thirteenth of these stands out in its seemingly wilful eccentricity and determination to reduce the given material to its bare bones:

Wilfrid Mellers describes this variation as "comically disruptive... The original tonal sequence is telescoped, the two-bar sequences being absorbed into the silences."

In a similar fashion, the first of the 24 variations of Rachmaninoff's Rhapsody on a Theme of Paganini for piano and orchestra presents a terse summary of Paganini's original:

Variations on material originally by other composers

Many composers have taken pieces composed by others as a basis for elaboration. John Dowland's "Lachrimae" was frequently used by other composers as a basis for sets of variations during the 17th century. Composed in 1700, the final movement of Arcangelo Corelli's Violin Sonata Op. 5, No. 9, opens with this rather sparse melodic line:

Corelli's fellow-composer and former student Francesco Geminiani produced a "playing version" as follows:

According to Nicholas Cook, in Geminiani's version "all the notes of Corelli's violin line ... are absorbed into a quite new melodic organization. With its characteristic rhythmic pattern, Geminiani's opening is a tune in a way that Corelli's is not... whereas in the original version the first four bars consist of an undifferentiated stream of quarter-notes and make up a single phrase, Geminiani's version has three sequential repetitions of a distinctive one-bar phrase and a contrasted closing phrase, producing a strongly accented down-beat quality."

Jazz arrangers frequently develop variations on themes by other composers. For example, Gil Evans' 1959 arrangement of George Gershwin's song "Summertime" from the opera Porgy and Bess is an example of variation through changing orchestral timbre. At the outset, Evans presents a single variation that repeats five times in subtly differing instrumental combinations. These create a compelling background, a constantly-changing sonic tapestry over which trumpeter Miles Davis freely improvises his own set of variations. Wilfrid Mellers (1964) wrote that "[i]t called for an improviser of Davis's kind and quality to explore, through Gil Evans' arrangement, the tender frailty inherent in the 'Summer-time' tune... Between them, solo line and harmonic colour create a music that is at once innocent and tense with apprehension".

Variation form Variation forms include ground bass, passacaglia, chaconne, and theme-and-variations. Ground bass, passacaglia and chaconne are typically based on brief ostinato motifs providing a repetitive harmonic basis and are also typically continuous evolving structures. Theme-and-variation forms are, however, based specifically on melodic variation, in which the fundamental musical idea, or theme, is repeated in altered form or accompanied in a different manner. Theme-and-variation structure generally begins with a theme (which is itself sometimes preceded by an introduction), typically between eight and thirty-two bars in length; each variation, particularly in music of the eighteenth century and earlier, will be of the same length and structure as the theme. This form may in part have derived from the practical inventiveness of musicians; "Court dances were long; the tunes which accompanied them were short. Their repetition became intolerably wearisome, and inevitably led the player to indulge in extempore variation and ornament"; however, the format of the dance required these variations to maintain the same duration and shape of the tune.

Variation forms can be written as free-standing pieces for solo instruments or ensembles, or can constitute a movement of a larger piece. Most jazz music is structured on a basic pattern of theme and variations.

Examples include John Bull's Salvator Mundi, Bach's Canonic Variations on "Vom Himmel hoch da komm' ich her, Passacaglia and Fugue in C minor, Violin Chaconne, and (D minor solo violin suite), Corelli's La Folia Variations, Beethoven's Diabelli Variations, the Finales of his Third "Eroica" and Ninth "Choral" Symphonies, the Finale of Brahms's Fourth Symphony, Variations on a Theme of Haydn, Op. 56, Elgar's Enigma Variations, Franck's Variations Symphoniques, and Richard Strauss's Don Quixote. Both Schubert's Death and the Maiden Quartet and Trout Quintet take their titles from his songs used as variation movements.

Chopin's Berceuse for piano, Op. 57, was first called Variantes, and consists of 16 continuous variations on a ground bass.

History of variations

Renaissance and Baroque periods Although the first isolated example emerged in the 14th century, works in theme-and-variation form first emerge in the early sixteenth century. Possibly the earliest published example is the diferencias for vihuela by Luis de Narváez (1538). A favorite form of variations in Renaissance music was divisions, a type in which the basic rhythmic beat is successively divided into smaller and smaller values. The basic principle of beginning with simple variations and moving on to more elaborate ones has always been present in the history of the variation form, since it provides a way of giving an overall shape to a variation set, rather than letting it just form an arbitrary sequence.

Keyboard works in variation form were written by a number of 16th-century English composers, including William Byrd, Hugh Aston and Giles Farnaby. Outstanding examples of early Baroque variations are the "ciaccone" of Claudio Monteverdi and Heinrich Schütz. Two famous variation sets from the Baroque era, both originally written for harpsichord, are George Frideric Handel's The Harmonious Blacksmith, and Johann Sebastian Bach's Goldberg Variations, BWV 988.

Classical and Early Romantic periods In the Classical era, Wolfgang Amadeus Mozart wrote a great number of variations, such as the first movement of his Piano Sonata in A, K. 331 (1783), and the finale of his Clarinet Quintet, K. 581 (1789). Joseph Haydn specialized in sets of double variations, in which two related themes, usually minor and major, are presented and then varied in alternation; outstanding examples include the slow movement of his Symphony No. 103 (the Drumroll, 1794–5), and the Variations in F minor for piano, H XVII:6 (1793).

As the Classical transitioned towards the Romantic era, the variation form began to reach monumental scales. Anton Reicha's L'art de varier for solo piano, Op. 57 (1803–04), consists of 57 variations ranging from very easy to extremely virtuosic pieces. Ludwig van Beethoven also wrote many variation sets in his career, including the independent sets, the Eroica Variations, Op. 35 (1802) and the Diabelli Variations, Op. 120 (1819–23). Others form single movements or parts of movements in larger works, such as first movement of the Piano Sonata No. 12, Op. 26 (1800–1), or the variations in the final movement of the Third Symphony "Eroica" (1803/1805). The variation form also occur in several of his late works, such as the slow movement of his String Quartet No. 12, Op. 127 (1825), the second movement of his final Piano Sonata No. 32, Op. 111 (1822), and the slow third movement of the Ninth Symphony, Op.125 (1824).

Franz Schubert wrote five sets of variations using his own lieder as themes, taking their namesake as epithets. For example, the second movement Andante of his fourteenth string quartet Death and the Maiden, D. 810 (1824), consists of an intense set of variations on his somber lied of the same title (D. 531, 1817). Similarly, his Piano Quintet in A major ("Trout Quintet", D. 667, 1819) includes a set of variations on The Trout (D. 550, 1817), and the second movement of the Fantasy in C major for solo piano ("Wanderer Fantasy", D. 760, 1822) is based on The Wanderer (D. 489, 1816).

Romantic period As the Romantic era proceeded, the theme-and-variations form developed into a demonstration of compositional and virtuosic technique, particularly that of pianists. In 1824, Carl Czerny premiered his Variations for piano and orchestra on the Austrian National Hymn Gott erhalte Franz der Kaiser, Op. 73. Frédéric Chopin wrote many variations for solo pianists, notably his Variations on "La ci darem la mano" for piano and orchestra on an aria from Mozart's Don Giovanni, Op. 2 (1827). Another example is Felix Mendelssohn's virtuousic Variations sérieuses for solo piano, Op. 54 (1841). Charles-Valentin Alkan wrote many sets of variations in his works, notably using the form in Le Festin d'Ésope to cap off his 12 Études dans tous les tons mineurs for solo piano, Op. 39 (1857). Johannes Brahms' Variations and Fugue on a Theme by Handel, Op. 24 (1861), and Variations on a Theme of Paganini, Op. 35 (1863), are notable for their large scale and high level of difficulty. Richard Wagner, a radical compared to Brahms' conservative style, remarked after hearing Op. 24 that "One sees what still may be done in the old forms when someone comes along who knows how to use them".