Here’s an interesting song I wrote based on math. I wrote a perl script to generate the lot of it. It plays the prime factorization of each number from 2 to 197, where I assigned a pitch to each prime. Many primes I gave the midi note 0, which means “don’t play” (lest it should be way too many notes). It’s a little dissonant, but it holds your attention nonetheless. Go, math!
I plan to write a few more music-generating perl scrips; this was fun!