In vocal music, contrafactum (or contrafact, pl. contrafacta) is "the substitution of one text for another without substantial change to the music".
While translations meant for singing do not usually constitute intentional "substitution", examples of contrafacta which do constitute wholesale substitution of a different text include the following types.
Poems set to music
An existing tune already possessing secular or sacred words is given a new poem, as often happens in hymns; sometimes more than one new set of words is created over time. Examples:
- The words of What Child Is This? were fitted to the tune of the folksong "Greensleeves".
- The Charles Wesley hymn text Hark! The Herald Angels Sing was fitted by William Hayman Cummings to a tune from Mendelssohn's Gutenberg cantata Festgesang
- The hymn tune "Dix" has been given several sets of words, among them As with Gladness Men of Old and For the Beauty of the Earth.
- In Japan, the Scots song "Auld Lang Syne" (lit. "Long Time Ago", "Old Times") has a new set of words in the song "Hotaru no hikari" (lit. "The Light of the firefly"), and is used at graduation ceremonies. Another Western song, also reworked with different lyrics around the same period (late 19th century) and used at graduation ceremonies, sometimes confused with "Hotaru", is "Aogeba t?toshi".
A lyricist might re-cast his/her own song (or someone else's song) with new lyrics, as in the case of Alan Jay Lerner with the number She Wasn't You / He Isn't You from the stage and film versions, respectively, of the musical On a Clear Day You Can See Forever.
Intentional parodies (as opposed to mere translations) of lyrics, especially for satirical purposes, as practiced in the United States by "Weird Al" Yankovic with popular music; humorist Tom Lehrer with his song "The Elements", which uses a tune from The Pirates of Penzance; Forbidden Broadway with musicals; the Capitol Steps; and Mark Russell (the last two involving political parody).
Other notable songs with significantly different lyrics in different languages include:
- "Autumn Leaves" (French "Les Feuilles mortes", literally "The Dead Leaves") - French by Jacques Prévert (1945), English by Johnny Mercer (1947)
- "Comme d'habitude", music by Claude François and Jacques Revaux, original French lyrics by Claude François and Gilles Thibaut, rewritten as "My Way" with English lyrics by Paul Anka. Before Anka acquired the English-language rights to the song, David Bowie had written a different set of lyrics to the same tune, titled "Even a Fool Learns to Love".
- The "Wilhelmus" (or "het Wilhelmus"), parts of which form the national anthem of the kingdom of the Netherlands, suffers from the same fate, it is based on "The tune of Chartres', specified by the Beggars Songbook of 1576-77 is that of a French song about the siege of the city of Chartres by the Prince of Condé and the Huguenots in the beginning of 1568. This song with the title "Autre chanson de la ville de Chartres assiegee par le Prince de Condé, sur un chant nouveau", formed the base of "het Wilhelmus". 
Songs which have been re-written by the same writer with different lyrics include:
Contrafactum has been used in writing several national anthems, such as those of the United States,United Kingdom, Russia and the Netherlands.
This section needs expansion
. You can help by adding to it. (June 2008)
While the above examples involve either music that is in the public domain or lyrics that were modified by the original lyricist, one obvious consideration in producing a contrafactum of someone else's music in modern times is the copyright of the original music or lyrics upon which the contrafactum would be based.