During the sixteenth and seventeenth centuries, polyphonic composition was refined into a practice called counterpoint. To generalize, the harmonic structure in contrapuntal writing is determined first, and the melodies are written to fit this structure; this is different from Renaissance-style polyphony, where the melodies are written first and the harmonies are more incidental. In other words, counterpoint is polyphonic composition laid over a homophonic texture.
The practice of counterpoint culminated in the fugue, a (usually) four-part composition that uses a number of important techniques. A fugue is based around a central theme called the subject. The subject is introduced seperately in each of the fugue's voices, and then varied in different ways, such as the following:
- Inversion: The theme is played upside-down by flipping the intervals.
- Retrogression: The theme is played backwards.
- Augmentation: The duration of all the rhythms is increased, making the theme slower.
- Diminution: The duration of all the rhythms is decreased, making the theme faster.
- Transposition: The theme is moved up or down by a generic interval.
- Tonicization: The whole piece shifts momentarily into a new key.
- Sequencing: The theme is repeated a number of times as the harmony shifts by a generic interval each time.
These techniques are not exclusive to fugues and can be found in most baroque music.