Kenta Cho is a brilliant game maker, and he’s come up with a couple of generators that can generatively make short stretches of music, suitable for classic-inspired arcade games.
Short VGM Generator is on itch.io, and works by taking a pre-existing piece of music and attempting to make another piece of a similar style.
The Good Old Game Sound Generator is on GitHub, but for playing around you might be more interested in its Demo page. It takes a bit more effort to make something with it, but it’s a much more flexible tool. I must leave you to your own devices to make something of value, or at least of interest, using it.
The process that let him to create these tools is up on a page he made on dev.to. If you’re interested in generative music you should take a look!