Sonata form
In the Baroque period composers like Bach and Handel wrote pieces with dance movements such as minuets. These were in “binary form”. This meant that there were two sections. The two sections were often the same length, and were separated by a double bar line which meant that each section was repeated. The music would not be in the same key all the time. The first section could modulate (change key) and then the second section would gradually modulate back again so that it sounded finished at the end.