While in Munich in early 1775, Mozart composed five piano sonatas, K. 189d-h (K. 279-283); the Sonata in D major, K. 205b (K. 284), appeared shortly afterward. Mozart and his father had traveled to Munich in early December 1774 to oversee the premiere of Mozart's new opera buffa, La finta giardiniera (The Imitation Gardener), commissioned by the Munich court. The opera received its first performance on January 13, 1775, two weeks before Mozart's nineteenth birthday.
It is remarkable that Mozart, who had made his reputation as a keyboard virtuoso, had even waited this long to compose sonatas. He had written sets of variations, but nothing in the sonata style. This may be because his Salzburg patrons were not interested in solo keyboard compositions. The six sonatas of K. 279-84 were apparently written as a set for which Mozart deliberately chose "easy" keys, although he referred to the works as his "difficult" sonatas. Mozart worked his way around the circle of fifths, first toward the flat side, composing the sonatas in the order, C, F, B flat, E flat, then moving to the sharp side and writing those in G and D. He may have used one of his new sonatas in a keyboard contest between himself and Ignaz van Beecke (1733-1803), a contest in which the latter was judged superior.
Each sonata is in three movements, and each differs from the others in several ways. The grace and charm we find in some of the first movements, especially that of the C major sonata, are reminiscent of J. C. Bach's keyboard style. Mozart chose various contrasting keys for his middle movements and a wide range of expressive devices and moods throughout the set. Only the D major sonata was published during Mozart's lifetime.
The K. 279 sonata, in C major, begins with an Allegro sonata-form movement featuring a four-measure theme that is more a group of single-measure gestures than a melody. A more tuneful secondary theme, on G major, dissolves into the scales and leaping motives of the closing group. The development section begins in G minor, after which Mozart moves the opening material of the piece through several keys and breaks it down into its constituent parts in a manner that looks forward to Beethoven. In a brilliant gesture, Mozart alters the transition in the recapitulation by building a passage based on the bass line from the main theme. Through variation technique, Mozart extends the secondary theme to such a degree it sounds as if we have entered a coda, but this impression fades as soon as the closing material, transposed to the tonic, appears and concludes the movement.
In sonata form with a brief development, the central Andante is set in F major. The occasional juxtaposition of duple-metered melodic lines with nearly constant triplets produces a sense of rhythmic freedom. The development section is unusually periodic, using several measures of the main theme. Great dynamic contrasts mark the movement, in which changes from piano to forte sometimes occur from beat to beat.
The finale, marked Allegro, is a rapid, straightforward sonata-form movement in C major. The second theme could not be more different from the first: its repeated notes, played staccato, contrast with leaping and falling pattern of the first theme. The development section focuses on the main theme and is relatively brief, maintaining the light atmosphere expected of finales. Three false starts precede the actual recapitulation, after the first few measures of which Mozart inverts the material, placing the melodic line in the bass. Sudden dynamic contrast again rears its head in the developmental coda.