Toccata is a virtuoso piece of music typically for a keyboard or plucked string instrument featuring fast-moving, lightly fingered or otherwise virtuosic passages or sections, with or without imitative or fugal interludes, generally emphasizing the dexterity of the performer's fingers. Less frequently, the name is applied to works for multiple instruments.
The first page of J.S. Bach's Toccata and Fugue in D minor, BWV 565
In classical music, a fugue is a contrapuntal, polyphonic compositional technique in two or more voices, built on a subject that is introduced at the beginning in imitation, which recurs frequently throughout the course of the composition. It is not to be confused with a fuguing tune, which is a style of song popularized by and mostly limited to early American music and West Gallery music. A fugue usually has three main sections: an exposition, a development, and a final entry that contains the return of the subject in the fugue's tonic key. Fugues can also have episodes—parts of the fugue where new material is heard, based on the subject—a stretto, when the fugue's subject "overlaps" itself in different voices, or a recapitulation. A popular compositional technique in the Baroque era, the fugue was fundamental in showing mastery of harmony and tonality as it presented counterpoint.
The six-part fugue in the "Ricercar a 6" from The Musical Offering, in the hand of Johann Sebastian Bach
Example of a tonal answer in J.S. Bach's Fugue No. 16 in G minor, BWV 861, from the Well-Tempered Clavier, Book 1. The first note of the subject, D (in red), is a prominent dominant note, demanding that the first note of the answer (in blue) sound as the tonic, G.
The interval of a fifth inverts to a fourth (dissonant) and therefore cannot be employed in invertible counterpoint, without preparation and resolution.
Visual analysis of J.S. Bach's Fugue No. 2 in C minor, BWV 847, from the Well-Tempered Clavier, Book 1 (bars 7–12)