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.
Mozart's Twelve Variations on "Ah vous dirai-je, Maman" (1785), 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:
Mozart's first variation decorates and elaborates the plain melodic line:
The fifth variation breaks up the steady pulse and creates syncopated off-beats:
The seventh variation introduces powerful new chords, which replace the simple harmonies originally implied by the theme with a prolongational series of descending fifths:
In the elaborate eighth variation, Mozart changes from the major to the parallel minor mode, while combining three techniques: counterpoint, suspensions and imitation:
A complete performance can be heard by following this link: Listen.
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:
Follow this link for a complete performance of "Reflets dans l'Eau". 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 theme.
Main article: List of variations on a theme by another composer
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 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 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.
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 set, and Johann Sebastian Bach's Goldberg Variations, BWV 988.
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, or the finale of his Clarinet Quintet. 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 are the slow movement of his Symphony No. 103, the Drumroll, and the Variations in F minor for piano, H XVII:6.
Ludwig van Beethoven wrote many variation sets in his career. Some were independent sets, for instance the Diabelli Variations, Op. 120, and the Eroica Variations in E♭ major, Op. 35. Others form single movements or parts of movements in larger works, such as first movement of the Piano Sonata No. 12, Op. 26, or the variations in the final movement of the Third Symphony (Eroica). Variation sets also occur in several of his late works, such as the slow movement of his String Quartet No. 12, Op. 127, the second movement of his final Piano Sonata No. 32, Op. 111, and the slow third movement of the Ninth Symphony, Op.125.
Franz Schubert wrote five variation sets using his own lieder as themes. Amongst them is the slow movement of his string quartet Death and the Maiden D. 810, an intense set of variations on his somber lied (D. 531) of the same title. Schubert's Piano Quintet in A (The Trout, D. 667) likewise includes variations on his song The Trout D. 550. The second movement of the Fantasie in C major comprises a set of variations on Der Wanderer; indeed the work as a whole takes its popular name from the lied.
In the Romantic era, the variation form was developed further. 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 four sets for solo piano, and also the Variations on "La ci darem la mano" from Mozart's opera Don Giovanni, Op. 2, for piano and orchestra (1827). A further example of the form is Felix Mendelssohn's Variations sérieuses.
Johannes Brahms wrote a number of sets of variations; some of them rely on themes by older composers, for example the Variations and Fugue on a Theme by Handel (1861; piano), and the Variations on a Theme by Haydn (1873; orchestra). The latter work is believed to be the first set of variations for orchestra alone that was a work in its own right, rather than part of a symphony, suite or other larger work. Karl Goldmark's Rustic Wedding Symphony (1875) starts out with a set of variations as its first movement. Antonín Dvořák's Symphonic Variations (1877) and Edward Elgar's Enigma Variations (1899) are other well-known examples. Anton Arensky's Variations on a Theme by Tchaikovsky (1894) is among his most popular compositions.
Variation sets have also been composed by notable twentieth-century composers, including
An unusual option was taken in 1952 with the Variations on an Elizabethan Theme, a set of six variations on Sellenger's Round for string orchestra, in which each variation was written by a different composer: Lennox Berkeley, Benjamin Britten, Arthur Oldham, Humphrey Searle, Michael Tippett, and William Walton.
Graham Waterhouse composed a trio Gestural Variations in 1997 and Variations for Cello Solo in 2019, and Helmut Lachenmann composed a trio Sakura-Variationen on the Japanese song in 2000.
A significant sub-set of the above consists of variations on a theme by another composer.
Skilled musicians can often improvise variations on a theme. This was commonplace in the Baroque era, when the da capo aria, particularly when in slow tempo, required the singer to be able to improvise a variation during the return of the main material. During this period, according to Nicholas Cook, it was often the case that "responsibility for the most highly elaborated stage in the compositional process fell not upon the composer but upon the executant. In their instrumental sonatas composers like Corelli, Geminiani, and Handel sometimes supplied the performer with only the skeleton of the music that was to be played; the ornamentation, which contributes crucially to the music's effect, had to be provided by the performer." Cook cites Geminiani's elaboration of Corelli (see above) as an example of an instance "in which the composer, or a performer, wrote down a version of one of these movements as it was meant to be played."
Musicians of the Classical era also could improvise variations; both Mozart (see Mozart's compositional method) and Beethoven made powerful impressions on their audiences when they improvised. Modern listeners can get a sense of what these improvised variations sounded like by listening to published works that evidently are written transcriptions of improvised performances, in particular Beethoven's Fantasia in G Minor, Op. 77, and Mozart's Variations on an Aria by Gluck, K. 455.
Improvisation of elaborate variations on a popular theme is one of the core genres of jazz. According to William Austin, the practice of jazz musicians "resembles the variations on popular songs composed for the keyboard at the end of the 16th century by Byrd, Bull, Sweelinck and Frescobaldi, more than the cumulative variations of Beethoven and Brahms." Generally, the theme used is stated quite explicitly at the outset. However, some jazz musicians employ a more oblique approach. According to Gamble, "Charlie Parker's performance of Embraceable You can be appreciated fully only if we are familiar with the tune, for unlike many jazz performances in which the theme is stated at the beginning, followed by improvisations on the theme, Parker launches almost immediately into improvisation, stating only a fragment of the tune at the end of the piece." Coleman Hawkins' famous interpretation of "Body and Soul" shows a similar approach. "On 11 October 1939, Coleman Hawkins went into New York's RCA studios with an eight-piece band to record the 1930 composition Body and Soul. It was already a favourite among jazz musicians, but nobody had ever played it like this. Pianist Gene Rodgers plays a straight four-bar introduction before Hawkins swoops in, soloing for three minutes without playing a single note of the tune, gliding over the chord changes with such harmonic logic that he ends up inventing bebop."
Improvisation by means of spontaneous variations, ornaments, embellishments and/or alterations to a melody is the basis of most sub-Saharan African music (traditional and pop) extending from melody and harmony to form and rhythmic embellishments.