The word fugue means to flee. When applied to music, it describes a contrapuntal convention used by many composers in which the voices or parts in the arrangement successively play the same theme or subject in imitatation of each other at different pitches. When this happens as a passage within a larger piece it is said to be a fugal section or a fugato. A small fugue is called a fughetta.
Fugues are generally in three or three or four parts, meaning melodic voices, but more parts up to eight or even ten are possible in large choral or orchestral fugues. Fugues in fewer than three parts are rare, because with two parts the subject can only jump back and forth between the upper and lower part. The best-known example is the E minor fugue from Book 1 of The Well-Tempered Clavier by Johann Sebastian Bach.
The small musical phrase or theme which constitutes the subject may run on into another phrase called the counter-subject which it plays when another voice comes in with the main subject. A skillful counter-subject works equally well whether the main subject comes in above it in pitch or below it. This is called invertibility. If the countersubject is distinctive enough to be used on its own, or if a new subject comes in later on which combines with the main subject, the fugue is a double fugue.
The fugal form evolved from the Renaissance fantasia, in which a performer would combine and invert a given subject against itself at the organ or harpsichord 'segundo la sua fantasia' - according to his or her fancy. This was regarded as a test of musical skill, and in written form the fugue continued to be a significant test of academic musical skill until the mid twentieth century, as a result nearly all composers of note have written at least one fugue. But during the baroque era the scholarly or church fugue, which usually appeared as a showpiece in large choral works written for big occasions, declined in favour of a new, lighter kind of instrumental fugue particularly associated with the Italian overture form, where it made up the fast middle section, and with the instrumental sonata. Fugues are often used for the finale of multi-movement works. Many baroque keyboard suites end with a fugal gigue, and all of Joseph Haydn's Opus 20 string quartets end with a fugue.
Fugues always start with the subject played by the first voice. At some point after the first voice has started, the subject is played against it by the second voice at a higher or lower pitch, sometimes with one of the intervals in the subject altered to preserve the musical mode. Thereafter, the next voice enters with the subject at a new pitch again, and so on until all voices have played the subject. The last entry of the subject is usually the top or the bottom voice, as all the voices are now going and it would get lost if it was somewhere in the middle. Typically, the first voice enters on the tonic or dominant note of the fugue's key, the second voice then answers on the dominant or tonic respectively, and so on for the remaining voices. The textbook term for this whole section is the exposition.
There usually follows an episode before the subject is heard again, which is a sequential pattern based on some melodic detail already heard or a new motif, which leads to a new key and usually a change of musical mode. If the fugue starts in a major key, it will now probably arrive at a minor one and vice versa. Once the subject returns, it will get played in various modes, ornamentations, inversions, retrogrades[?], or other music tricks (perhaps with an occasional bridging passage or another episode to get back to the home key). One common trick is the so-called `stretto' where voices enter at a short distance from each other, one voice starting the theme before the last one has finished its entry.
The final stage of a fugue is the "recapitulation" where the subject is repeated in the manner it was first introduced (using the same musical mode and without any ornamentations). This eventually leads to the end of the fugue.
According to the critic Donald Tovey "Fugue is not so much a musical form as a musical texture". In other words, it can be introduced anywhere as a distinctive and recognizable technique. This is reflected in the experimentation with fugue compositional techniques by jazz composers in the 20th century. While all fugues have an exposition, they may not have the other sections described above. The form of a fugue generates itself out of the characteristics of the subject, rather than being a required sectional structure.
The 18th century composer Johann Sebastian Bach is generally regarded as the greatest composer of fugues. He often entered into contests where he would be given a subject with which to spontaneously improvise a fugue on the organ or harpsichord.
Bach's most famous works as far as fugues go are the unfinished Art of Fugue and The Well-Tempered Clavier. The former is a collection of fugues (and a few canons) on a single theme; the latter is two volumes written in different times of his life, each comprising 24 prelude and fugue pairs, one for each major and minor key. Bach also wrote smaller single fugues, and incorporated fugal writing in many of his works that were not fugues per se.
This idea of writing a cycle of fugues on all keys has been taken up by Paul Hindemith in his Ludus Tonalis, and Dmitri Shostakovich. A famous orchestral fugue is the last movement of Symphony No.1 by the British composer William Walton.
"Row, Row, Row Your Boat" is sometimes mistaken for a fugue, but it is actually a round, as the subject is identical for all four voices, and they repeat the subject in the same mode and key.