Domenico Scarlatti wrote sonatas for harpsichord also in binary form, but long and with additional complexity. The first section would start with a theme in the main key, and then modulate to another key for contrast. The second section might be longer than the first second, starting off by modulating to remote keys before arriving back to repeat the main theme. This kind of piece is the beginning of sonata form.