This repo is a prototype for music synth AI. It takes in a midi file and returns a midi file.




  1. Clone the repo
  2. Make sure you have python and java installed
  3. Download midi of a song you like. (mp3 to midi won’t work)
  4. Put the midi in the “rawmidis” folder (you should see Beethoven’s moonlight sonata there)
  5. run
  6. A few new folders will be created automatically.
  7. The newly generated midi will appear in the “generatedMIDIs” folder.
  8. You can use sound fonts to make this midi sound more organic, cut out parts you don’t like or simply re run again to get a different result.


I first convert midi to ABC notation and extract the verses
I then use Byte Pair encoding to compress the repeated patterns and finally a markov model to generate the sequence.


View Github