Chamber music in its broadest sense already existed in the late Middle Ages. The "instrumental motets" of the Codex Bamberg, ensemble pieces such as occur in the Glogauer Liederbuch, or the "carmina" of Obrecht, Isaac, and Hofhaimer (c. 1500) bear all the hallmarks of true chamber music. So do the 16th-century ensemble ricercars of Willaert, Buus, and Padovano, as well as the instrumental canzonas from the end of the century. The chief type of Baroque chamber music is the trio sonata in its two varieties, the sonata da chiesa and the sonata da camera.
The present-day repertory of chamber music begins with the late string quartets (written after 1780) of Haydn and Mozart. These works established the basic principles of form and style to which practically all composers of chamber music have adhered: the form is that of the sonata in four movements; the style is characterized by individual treatment of the parts and exclusion of virtuoso-like elements. Naturally, in some cases these principles have not been observed, as in Beethoven's String Quartet in C-sharp minor, op. 131, with its extremely free form. Yet the fact remains that in chamber music composers have shown a greater respect for tradition than in other fields, the obvious reason being that the relatively limited and fixed resources of, e.g., a string quartet prohibited the introduction of novel features comparable to those of contemporary orchestral or piano music.
The chamber music works (chiefly string quartets) of Haydn, Mozart, and Beethoven (opus numbers below 100), and Schubert represent the classical period of chamber music. In his late quartets, (written between 1824 and 1826) Beethoven created an entirely singular type of chamber music, a type too personal to be called "classic" yet too transcendental to be considered romantic. The romantic period of chamber music embraces Schumann, Brahms, Dvorak, and Franck (to name only the most important composers), with Brahms ranking fist among them. While Debussy, Ravel, and others tried to exploit the impressionist and colorist resources of chamber music, some later composers returned to a purer style, as a result of the contemporary revival of the contrapuntal approach to composition and of the adoption of a more objective and sober type of expression than prevailed in late romanticism and impressionism.