The long careers of Carl Philipp Emanuel Bach and Joseph Haydn coincided with fundamental transformations in how keyboard instruments were built and played and how composers wrote for them. Haydn's keyboard music probably saw the more profound changes in compositional style, yet C. P. E. Bach and others preceded him in discovering ways to incorporate new keyboard idioms into pieces written for new types of instruments. Bach gradually shifted from writing generic keyboard music to composing in idioms most appropriate to two-manual harpsichords, unfretted clavichords or fortepianos. Haydn likewise began writing in a generic idiom; many works that have been posited as having been meant for the clavichord cannot in fact be assigned clearly to that or any other specific instrument. Although Haydn did eventually turn to writing specifically for the fortepiano, he too made a gradual, and relatively late, transition from a generic approach to one that centred on the grand fortepianos of the late eighteenth century. Bach's influence on Haydn is inseparable from the matter of the keyboard instruments. Although the precise nature and extent of Bach's influence cannot be determined, compositional elements derived by Haydn from Bach's music range from superficial thematic and notational parallelisms to fundamental conceptions of what keyboard music could be or could express.