In music, an invention is a short composition (usually for a keyboard instrument) with two-part counterpoint. (Compositions in the same style as an invention but using three-part counterpoint are known as sinfonias. Some modern publishers call them "three-part inventions" to avoid confusion with symphonies.) Well-known are the fifteen inventions that make up the first half of Johann Sebastian Bach's Inventions and Sinfonias. Inventions are usually not performed in public, but serve as exercises for keyboard students, and as pedagogical exercises for composition students.
Inventions are similar in style to a fugue, though they are much simpler. They consist of a short exposition, a longer development, and, sometimes, a short recapitulation. The key difference is that inventions do not generally contain an answer to the subject in the dominant key, whereas the fugue does. Two-part and three-part inventions are in contrapuntal style.
In the exposition, a short motif is introduced by one voice in the tonic key. This is also known as the theme. The subject is then repeated in the second voice in the tonic key while the initial voice either plays a countersubject or plays in free counterpoint.
The development comprises the bulk of the piece. Here the composer develops the subject by writing variations either melodically or harmonically. This usually involves the alternation of episodes with statements of the theme, similar to the development of a fugue. In minor- and major-mode inventions, the theme is typically restated in the relative major and the dominant, respectively. New key areas are reached through episodes, which usually move sequentially through the circle of fifths. The final episode ends on a half cadence in the original key, and is often exaggerated to make the subject sound extra special when it returns. Many of Bach's Inventions follow this plan, including BWV 775 and BWV 782.
If an invention does have any recapitulation at all, it tends to be extremely short--sometimes only two or four measures. The composer repeats the theme in the upper voice and the piece ends. The repetition of the theme contains very little variation (or no variation at all) on the original theme. The lower line usually plays the countersubject, and if there is no countersubject, plays in free counterpoint.
The invention is primarily a work of Johann Sebastian Bach. Inventions originated from contrapuntal improvisations in Italy, especially from the form of the composer Francesco Antonio Bonporti. Bach adapted and modified the form to what is considered to be a formal invention. Bach wrote 15 inventions (BWV 772-786) as exercises for his son, Wilhelm Friedemann Bach. Bach later wrote a set of 15 three-part inventions, called sinfonias (BWV 787-801).