In 1740 he moved to Berlin to become the harpsichord player for Frederick the Great. Frederick played the flute, and it was Bach's job to provide the keyboard accompaniment. This left him with plenty of time to compose music. Bach married Johanna Maria Dannemann in 1744. They had a number of children, but only three lived to be adults. His son, also Johann Sebastian Bach, became a painter in Rome, but died at the age of 30. Life in Berlin became difficult for Bach during the Seven Years' War. Frederick was often away and so there was little musical activity in the court. He was paid with paper money which did not keep its value, and so he had to be careful with his spending. There was also criticism of his playing style, it was becoming "affected", too modern for the conservative tastes of Frederick's court.