The fantasia (Italian: [fanta'zi:a]; also English: fantasy, fancy, fantazy, phantasy, German: Fantasie, Phantasie, French: fantaisie) is a musical composition with its roots in the art of improvisation. Because of this, like the impromptu, it seldom follows the textbook rules of any strict musical form.
The term was first applied to music during the 16th century, at first to refer to the imaginative musical "idea" rather than to a particular compositional genre. Its earliest use as a title was in German keyboard manuscripts from before 1520, and by 1536 is found in printed tablatures from Spain, Italy, Germany, and France. From the outset, the fantasia had the sense of "the play of imaginative invention", particularly in lute or vihuela composers such as Francesco Canova da Milano and Luis de Milán. Its form and style consequently ranges from the freely improvisatory to the strictly contrapuntal, and also encompasses more or less standard sectional forms (Field 2001).
According to the Oxford Dictionary of Music, in the 16th century the instrumental fantasia was a strict imitation of the vocal motet (Kennedy 2006). The English composers William Byrd and John Jenkins both wrote and developed fantasias for viol consort, while Henry Purcell's fantasias are the last 17th century examples of the genre.
From the Baroque period, J. S. Bach's Chromatic Fantasia and Fugue, BWV 903, for harpsichord; Great Fantasia and Fugue in G minor, BWV 542, for organ; and Fantasia and Fugue in C minor, BWV 537, for organ are examples. Georg Philipp Telemann published Twelve Fantasias for Solo Flute in 1733, and Twelve Fantasias for Solo Violin and Twelve Fantasias for Viola da Gamba solo in 1735.
Examples from the Classical period are Mozart's Fantasia in D minor, K. 397 for fortepiano and his Fantasia in C minor, K. 475. Franz Schubert composed the Fantasie in C major nicknamed the Wanderer Fantasy for solo piano and the Fantasia in F minor for piano four hands. Three works by Chopin belong in the genre: The Fantaisie in F minor, Op. 49, the Polonaise-Fantaisie in A♭ major, Op. 61, and the Fantaisie-Impromptu in C♯ minor, Op. post. 66. Later examples of fantasias include Anton Bruckner's Fantasia in G major (WAB 118), Busoni's Fantasia contrappuntistica, Vaughan Williams' Fantasia on a Theme by Thomas Tallis, and Corigliano's Fantasia on an ostinato.
Walter Willson Cobbett, in the opening decades of the 20th century, attempted to revive the fantasia style via a competition, to which works like the Phantasie trios and quartets by William Hurlstone, Armstrong Gibbs, John Ireland, Herbert Howells and Frank Bridge owe their existence (Howes and Bashford 2001), as does Benjamin Britten's Phantasy in F minor for string quintet written in 1932, the year in which he also composed a Phantasy Quartet for oboe and strings (Brett, Doctor, LeGrove, and Banks 2001, §2).