Chorale fantasias first appeared in the 17th century in the works of North German composers such as Jan Pieterszoon Sweelinck (who arguably had the greatest influence on the genre), Heinrich Scheidemann and Franz Tunder (who, however, rarely used the term).
By mid-18th century this type of organ composition was practically non-existent.
Johann Sebastian Bach used the term first to designate a whole variety of different organ chorale types (during his period in Weimar), and then limited its use to large compositions with the chorale melody presented in the bass.
Bach also wrote movements which have been described as chorale fantasias scored for various combinations of singers and instruments, for example the opening choruses of his chorale cantatas and the opening and closing movements of Part I of the St Matthew Passion.
In the vocal pieces the chorale cantus firmus is often given to the soprano voice.