I came across this short piece by Joe Zach where he uses tracery to generate a sequence of chords (the names of chords) which he then feeds into another library, scribbletune to write those chords to a midi file.

https://github.com/shawngraham/mini-code-adventures-generate-music-with-js/blob/master/index.js

Give it a listen: https://soundcloud.com/shawn-graham-60451318/sand

I’m thinking that this could be plumbed into a twitter bot somehow, write the midi overtop of an autoplaying video…? I dunno.