More recently, Cheap Imitation (1969) by John Cage was produced by systematically changing notes from the melody line of Socrate by Erik Satie using chance procedures.
[1] As a compositional device, it was of particular importance in the 1940s development of bop, since it allowed jazz musicians to create new pieces for performance and recording on which they could immediately improvise, without having to seek permission or pay publisher fees for copyrighted materials (while melodies can be copyrighted, the underlying harmonic structure cannot be).
Contrafacts are not to be confused with musical quotations, which comprise borrowing rhythms or melodic figures from an existing composition.
Well-known examples of contrafacts in jazz include the Charlie Parker/Miles Davis bop tune "Donna Lee," which uses the chord changes of the standard "Back Home Again in Indiana"[2] or Thelonious Monk's jazz standard[3] "Evidence", which borrows the chord progression from Jesse Greer and Raymond Klages's song "Just You, Just Me" (1929).
Examples from the classical oeuvre include the Ave Maria (Bach/Gounod); Sinfonia by Luciano Berio using fragments from Mahler; George Crumb borrowing Chopin's nocturnes; or Matt A. Mason's "Heiligenstadt Echo" which takes from Beethoven's Sonata in A♭ major, op.