Using over 20k tunes in ABC notation from https://thesession.org/ and awesome deep learning library called Keras I've trained a multi-layer recurrent neural model that can build some melodies from scratch predicting exactly the next character in the text representation of a song. The output of this model then gets converted to MP3 format so it can be played in a browser right away.
You can try it here — https://zhebrak.io/composer/
There is also a Telegram bot by AyumuKasuga — https://telegram.me/SongComposerBot