Parody music, or
musical parody, involves changing or recycling existing (usually very well known) musical ideas or lyrics - or copying the peculiar style of a composer or artist, or even a general style of music. Although the result is often very funny, and this is the usual intent - the term "
parody" in musical terms has a slightly different meaning from the general term, as it includes some kinds of quite serious (or at least not intentionally humorous) re-use of music. Parody of music has probably existed as long as music itself, but in the 20th century it has emerged as a category of music in itself.
In the Middle Ages and Renaissance, parody masses were written using tunes from folk music and other sources. Later popular song returned the compliment, borrowing hymn tunes and other church music and substituting secular (sometimes obscene) words. John Brown's Body, the great marching song of the American Civil War, was based on the tune to a hymn; it was in turn borrowed back for a new hymn. This continued into World War I, with many of the soldiers' songs being based on hymn tunes (for instance When this bloody war is over, to the tune of What a friend we have in Jesus).
Classical composers often borrowed folk and popular tunes, as well as making fun of each other's musical styles. Bach and his contemporaries were very fond of the quodlibet - taking popular tunes and playing them in grotesque ways - often combining several of them at once. Haydn (who had a very strong sense of musical humour) was notorious for taking popular melodies and giving them mock serious treatment. Sir Arthur Sullivan was a master of parody of other composers' styles - in the dramatic works he wrote with W. S. Gilbert he parodies at different times the styles of Mendelssohn, Wagner, and even Handel, although (usually) avoiding the stealing of actual musical ideas. As might have been expected, his own music has been parodied ever since.
The 18th century ballad opera - which included satirical songs set to popular melodies of the time, involved some of the broadest (and funniest) musical parody of all time.