Johann Sebastian Bach
Bach often made journeys to other towns. In 1747 he visited the court of Prussian King Frederick the Great near Berlin. The king, a music lover, gave Bach a theme to improvise from on the harpsichord. Bach sat down and improvised a fugue using this theme. Later Bach wrote a very long composition for flute, violin and harpsichord with cello accompaniment, in many movements, all based on this theme. At the end, the theme is heard in 5 of the 6 voices. Bach called it The Musical Offering and he sent it to the king.