Sonata form is a structure containing three main parts that emerged in mid-18th Century classical music. The three parts are called the exposition, development, and recapitulation, coming in that order. In the exposition, the main musical ideas that feature in the piece as a whole are heard, such as a prominent melody or rhythmic pattern. Typically, there are two contrasting musical ideas in the exposition which are called the 1st subject, being the first idea of the piece, and the 2nd subject following. Each subject is commonly a short musical idea which has a recogniseable or catchy quality to it so that the listener notices when it emerges and features in other later parts of the piece. The 1st subject is in the tonic or 'home' key of the piece and the 2nd subject is in the dominant key of the piece if the 1st subject is major, and the relative major key of the piece if the 1st subject is minor.
In the development section, the 1st and 2nd subjects from the exposition are heard in various forms of musical development and in different keys to those of the exposition. An example of musical development could be to change the interval between two notes within a melody that forms the 1st subject, so that where the interval of a 4th was heard in the exposition, that same part of the melody contains a 5th in the development. The effect of this is that the melody is still recogniseable as having come from the exposition section, but it now sounds slightly different due to the interval change and has hence been developed from its original form. The recapitulation follows the development and is characterised by the music returning to the tonic, home key in which the exposition began, and the 1st subject being heard in its original, undeveloped form. From this point, the music of the recapitulation is almost an exact repeat of the exposition, except that there is no change of key, like in the exposition, for the 2nd subject: in the recapitulation, both the 1st and 2nd subjects are in the tonic key of the piece. This means that the piece begins and ends in the same key, making sonata form a cyclical structure.