A melodic line that is the reverse of a previously or simultaneously stated line is said to be its retrograde or cancrizans (// "walking backward", medieval Latin, from cancer "crab"). An exact retrograde includes both the pitches and rhythms in reverse. An even more exact retrograde reverses the physical contour of the notes themselves, though this is possible only in electronic music. Some composers choose to subject just the pitches of a musical line to retrograde, or just the rhythms. In twelve-tone music, reversal of the pitch classes alone—regardless of the melodic contour created by their registral placement—is regarded as a retrograde.
Retrograde was not mentioned in theoretical treatises prior to 1500. Nicola Vicentino (1555) discussed the difficulty in finding canonic imitation: "At times, the fugue or canon cannot be discovered through the systems mentioned above, either because of the impediment of rests, or because one part is going up while another is going down, or because one part starts at the beginning and the other at the end. In such cases a student can begin at the end and work back to the beginning in order to find where and in which voice he should begin the canons." Vicentino derided those who achieved purely intellectual pleasure from retrograde (and similar permutations): "A composer of such fancies must try to make canons and fugues that are pleasant and full of sweetness and harmony. He should not make a canon in the shape of a tower, a mountain, a river, a chessboard, or other objects, for these compositions create a loud noise in many voices, with little harmonic sweetness. To tell the truth, a listening is more likely to be induced to vexation than to delight by these disproportioned fancies, which are devoid of pleasant harmony and contrary to the goal of the imitation of the nature of the words."
Thomas Morley (1597) described retrograde in the context of canons and mentions a work by Byrd. Friedrich Wilhelm Marpurg (1754) notes various names for the procedure imitatio retrograda or cancrizans or per motum retrogradum and says it is used primarily in canons and fugues.
Some writers acknowledge that hearing retrograde in music is a challenge, and consider it a self-referential compositional device.
Despite not being mentioned in theoretical treatises prior to 1500, compositions written before that date show retrograde. According to Willi Apel, the earliest example of retrograde in music is the 13th century clausula, Nusmido, in which the tenor has the liturgical melody "Dominus" in retrograde (found in the manuscript Pluteo 29.1, folio 150 verso, located in the Laurentian Library in Florence). (The word "Nusmido" is a syllabic retrograde of the word "Dominus.")
Surveying medieval examples of retrograde, Virginia Newes notes that early composers were often also poets, and that musical retrogrades could have been based on similarly constructed poetic texts. She quotes Daniel Poirion in suggesting that the retrograde canon in Machaut's three-voice rondeau, "Ma Fin est mon Commencement" could symbolize a metaphysical view of death as rebirth, or else the ideal circle of the courtly outlook, which encloses all initiatives and all ends. She concludes that, whatever the reasons, construction of retrogrades and their transmission were part of the medieval composers' world, as they prized symmetry and balance as intellectual feats in addition to the aural experience. 
Todd notes that although some composers (John Dunstaple, Guillaume Dufay and Johannes Ockeghem) used retrograde occasionally, they did not combine it with other permutations. In contradistinction, Antoine Busnois and Jacob Obrecht, used retrograde and other permutations extensively, suggesting familiarity with one another's compositional techniques. Todd also notes that, by use of retrograde, inversion, and retrograde-inversion, composers of this time viewed music in a way similar to serialists of the 20th century.
However, as Edmund Rubbra (1960, p. 35) points out, “This is, of course, a purely mental concept, as music can never do anything but go forwards, even if the given tune is reversed. The different relationships set up by reversing the direction of a theme make it completely unrecognizable; and when a composer indulges in this device the disclosure of it makes not the slightest difference to our apprehension of the music, which must be listened to as going parallel with the time-processes of our existence.”
Nevertheless, there are examples of retrograde motion in the music of J.S. Bach, Haydn and Beethoven. Bach’s Musical Offering includes a two-voice canon in which the second voice performs the melodic line of first voice backwards:
The minuet (third) movement of Joseph Haydn’s, Symphony no. 47, is an exact palindrome. Haydn also transcribed this piece for piano and this version forms the second movement of his Piano Sonata in A major XVI/26
The fugal fourth movement of Beethoven, Piano Sonata no. 29, op. 106, "Hammerklavier", has the following main theme:
Later in this movement, Beethoven conjures up and uses the retrograde version of the subject. Beethoven does not create a strict note-for-note reversal of the theme.
As early as 1923, Arnold Schoenberg expressed the equivalence of melodic and harmonic presentation as a "unity of musical space." Taking the example of a hat, Schoenberg explained that the hat remains the same no matter if it is observed from below or above, from one side or another. Similarly, permutations such as inversion, retrograde, and retrograde inversion are a way to create musical space.
Heinrich Jalowetz discussed Arnold Schoenberg's frequent use of retrograde (and other permutations) as a compositional device for twelve-tone music: "The technique serves two main functions. One is to provide a substitute for classical tonality, with all its melodic and harmonic consequences...The second function is to provide a means of interrelationship. This is done by presenting the row not only in normal position but in inversion, retrogression, and retrograde inversion. The music derives a strict inner cohesion through the artful treatment of such relationships, even though the listener may often be unable to follow what is happening."
In twelve-tone music, retrograde treatment of pitch is a commonplace, but rhythmic retrogrades are comparatively rare. Examples of rhythmic retrogrades occur in the music of Alban Berg, for example in the operas Wozzeck and Lulu, and in the Chamber Concerto. In discussing Berg's extensive use of retrograde and palindrome, Robert Morgan coins the word "circular" to describe musical situations "in which an opening gesture returns at a composition's close, thereby joining the music's temporal extremes."
Dorothy Slepian, writing in 1947, observed that "modern American composers write canons that, whether simple or complicated in structure, clearly discernible or subtly concealed, are a natural means of expression growing directly out of the individual needs of the melodic material. Therefore, most of the composers regard cancrizans as an artificial device imposed upon a theme rather than as a consequence germinated by it." Specifically, Douglas Moore, Harold Morris, Paul Creston, and Bernard Rogers "flatly refute the expressive powers of the cancrizans" whereas Walter Piston, Adolph Weiss, Wallingford Riegger, and Roger Sessions use it often. One particularly colorful and effective example is found in the second movement of Piston's Concerto for Orchestra, where continuous rapid string passages with an ostinato bass rhythm and a melody in the English horn returns later in the movement performed backwards as a recapitulation.
In music and music theory, a non-retrogradable rhythm is a rhythmic palindrome, i.e., a pattern of note durations that is read or performed the same either forwards or backwards. The term is used most frequently in the context of the music of Olivier Messiaen. For example, such rhythms occur in the "Liturgie de cristal" and "Danse de la fureur, pour les sept trompettes"—the first and sixth movements—of Messiaen's Quatuor pour la fin du temps.