This is some code that will generate a midi file with different options, then play it. It uses mido to make the midi file and tinysoundfont to play the file.