Sometime in 1765, Haydn composed a piano piece (admittedly one which was based upon a traditional South German folk song) with what must surely be the most unlikely title to be found anywhere in his vast catalog of works, or elsewhere for that matter. But Haydn's Capriccio (Hob. XVII:1) for solo piano after the song "Acht Sauschneider musen seyn" ("Eight castrators there must be") proved to be one of the ambitious and effective of all his earlier keyboard compositions, and one with tremendous future implications. In essence this was a tremendously skilled elaboration of some 368 measures in all, in full variation form, of the original folk song theme. Many of Haydn's contemporaries must surely have been astonished--and perplexed--to find that such an intriguing, complex, and gratifying work had come from a less than usually wholesome source!
Haydn arranged for this piece to be published in 1791, but as result of his renewed interest in variation form, he had already felt compelled to write something else along similar lines, once again following the free rondo outline so popular for variations. In a letter to his publisher Artaria, which dates from March 1789, we find Haydn's interesting reference to it: "In a moment of most excellent good humour I have written a quite new Capriccio for the pianoforte whose tastefulness, singularity, and special construction cannot fail to win applause from connoisseurs and amateurs alike."
Publication was actually delayed, and when the piece finally appeared, it was at first known as a "Fantasia" in G major. Marked Presto, the work we know as the Capriccio in G, Hob. XVII:4, is set in 3/8 time, and is a composition of exceptional verve and brilliance, and despite Haydn's populist claims, it was quite obviously intended for real virtuosos, and not mere amateurs to play. The harmonic blueprint for the Capriccio is no less startling nor original. The main sections are in B flat, E flat (major and minor), and the tonic of G. But as Haydn scholar Professor H. C. Robbins Landon points out "on many occasions routine tonal preparations are ironically deflected to more remote destinations. The upward-moving chromatic lines in strident octaves that feature in Haydn's C major piano sonata No. 58 appear in the unbuttoned coda of the Capriccio, where they are joined by three downward glissandi in the right hand, much easier to play on an eighteenth-century piano than on a modern instrument."