DeepBach: a steerable model for Bach chorales generation

Polyphonic music generation is a difficult task due to the complex interplay between melody and harmony.

We developed a model of polyphonic music generation, which learns to compose chorales in the style of Bach.  This model is capable of producing convincing chorales, even if it is trained with no other data that the 400 chorale sheets by Bach.

A key feature is that we are able to constrain the generated chorales in many ways: we can for instance impose the melody, the bass, the rhythm but also the cadences (when the musical phrases end). With this, we can for instance reharmonize in the style of Bach chorales well-known melodies.
If you want to see if you are able to distinguish between Bach and DeepBach, try out this test.
This is an example of a reharmonization of Wer nur den lieben Gott läßt walten (He who allows dear God to rule him), a 1641 hymn by Georg Neumark. generated by DeepBach and played by Emmanuel Deruty:
Other two examples:

God Save the Queen I

God Save the Queen II

Please refer to this paper for a presentation of the model and comments on the examples:
DeepBach: a Steerable Model for Bach chorales generation, Gaëtan Hadjeres, François Pachet