Ludwig van Beethoven composed his Piano Sonata No. 12 in A♭ major, Op. 26, in 1800–1801, around the same time as he completed his First Symphony. He dedicated the sonata to Prince Karl von Lichnowsky, who had been his patron since 1792.
Consisting of four movements, the sonata takes around 20–22 minutes to perform.
The structure of the sonata is unconventional in that the piece opens with a relatively slow movement in the format of theme and variations. The third movement incorporates a funeral march, clearly anticipating the watershed of the Eroica Symphony that Beethoven wrote in 1803–1804. This is the only movement from his sonatas that Beethoven arranged for orchestra, and was played during Beethoven's own funeral procession in 1827.
This sonata is also unusual in that none of its four movements is in sonata-allegro form.
In most of Beethoven's four-movement sonatas, the third movement is in 3
4 and in ternary form, while the second movement is slow and in a different key from the other movements. In this sonata, the second and third movements have switched roles, where the second movement is the ternary scherzo and trio, while the third movement is the slow movement in the tonic minor.
The main theme of Schubert's Impromptu in A♭ major, Op. 142 No. 2 is strikingly similar to the theme in the first movement of Beethoven's sonata. The four-bar phrases that open these pieces are almost identical in most musical aspects: key, harmony, voicing, register, and basic as well as harmonic rhythm. Another less immediate connection exists with the main theme, also in A♭ major, of the Adagio movement in Schubert's piano sonata in C minor, D. 958. Indeed, Schubert may have borrowed these themes from Beethoven, as he often did in his compositions.