In music, a subject is the material, usually a recognizable melody, upon which part or all of a composition is based. In forms other than the fugue this may be known as the theme.
A subject may be perceivable as a complete musical expression in itself, separate from the work in which it is found (Drabkin 2001). In contrast to an idea or motif, a subject is usually a complete phrase or period (Dunsby 2002). The Encyclopédie Fasquelle defines a theme (subject) as "Any element, motif, or small musical piece that has given rise to some variation becomes thereby a theme" (Michel 1958–61).
Thematic changes and processes are often structurally important, and theorists such as Rudolph Reti have created analysis from a purely thematic perspective (Reti 1951; Reti 1967). Fred Lerdahl describes thematic relations as "associational" and thus outside his cognitive-based generative theory's scope of analysis (Lerdahl 2001, 5).
Music based on a single theme is called monothematic, while music based on several themes is called polythematic. Most fugues are monothematic and most pieces in sonata form are polythematic (Randel 2002, 429). In the exposition of a fugue, the principal theme (usually called the subject) is announced successively in each voice – sometimes in a transposed form.
In some compositions, a principal subject is announced and then a second melody, sometimes called a countersubject or secondary theme, may occur. When one of the sections in the exposition of a sonata-form movement consists of several themes or other material, defined by function and (usually) their tonality, rather than by melodic characteristics alone, the term theme group (or subject group) is sometimes used (Rushton 2001; Benward and Saker 2009, 136).