Chromatic fantasia

A chromatic fantasia is a specific type of fantasia (or fantasy or fancy) originating in sixteenth-century Europe. In its earliest form, it is based on a chromatically descending tetrachord which arises naturally out of the dorian mode. Consequently, the chromatic fantasia is almost invariably in D minor (D-E-F-G-A-B♭-C rather than D-E-F-G-A-B-C) even as late as Bach.

Some early examples
Among the earliest examples are two celebrated lute pieces by John Dowland, the Farewell and Forlorn Hope Fancy. These were obviously highly influential of Jan Pieterszoon Sweelinck whose own Fantasia Chromatica in many ways forms a link between the Renaissance and the Baroque.

Bach's chromatic fantasia
The chromatic fantasy, as a form, fell into neglect in the later seventeenth century. About a century after Sweelinck, J. S. Bach contributed the most famous examples of the form, in his Chromatic Fantasia and Fugue, BWV 903.