You're right, those games have generative/procedural/random music. I should clarify - they, or any other games I could find, do not generate
songs procedurally (such as a procedural song generators you might find online):
http://www.theverge.com/2013/1/31/3936670/proteus-musical-exploration-gameTrekking across the island will cue different sounds — from the soft tinkling of rainfall to the excited hops of pixelated rabbits — but unlike more obvious music-focused games like, say, Wave Trip, you can’t use Proteusto craft an inventive new song;
http://urustar.net/blog/zwan-soundtrack/ the song is in a major scale, in phase two I changed the notes to make it in a mixolydian mode, and in phase three in a natural minor scale; this way I kept the same procedurality playing different audio clips (or audio bricks, if you want), changing the general mood but not the logic behind it
http://www.eurogamer.net/articles/enos-unique-spore-soundtrackHe went on to demonstrate a simple software called 'The Shuffler', which even with a simple combination of samples possibly would never create the same composition twice within a lifetime."
http://www.edge-online.com/features/thomas-was-alone-composer-david-housden-from-quarter-life-crisis-to-bafta-nominee/So I’d write a base track of one to two minutes in length, and chop the rest of the instruments up into 4/8/16/24/32 bar loops, then these would be randomly generated over the base track. So every single loop had to be able to coexist with any other loop at any given time. Pretty much like a construction kit or something you’d get in Dance Ejay or something of the like.