Google develops AI-powered Doodle. In which one enters 2 bars of, say, single notes (as the main melody melody) and then the AI creates a Bach arrangement based on these notes. This is based on a pattern analysis of a lot of Bach's written pieces to distill a kind of Bach principle from there.
Try it yourself? Go to : https://www.google.com/webhp?hl=nl&ictx=2&sa=X&ved=0ahUKEwiVqLDUsZXhAhWSalAKHf6WC-wQPQgH
(more at https://www.musicradar.com/news/bach-is-back-as-ai-google-doodle)