Linuxwave: Generate Music from the Entropy of Linux
github.com
github.com
----
¹: https://github.com/orhun/linuxwave/pull/8
²: I could've just did an "asdf install zig 0.10" and plopped in a corresponding ".tool-versions", or just used the Dockerfile, but what's the fun in that?
cat /dev/urandom | hexdump -v -e '/1 "%u\n"' | awk '{ split("0,2,4,5,7,9,11,12",a,","); for (i = 0; i < 1; i+= 0.0001) printf("%08X\n", 100*sin(1382*exp((a[$1%8+1]/12)*log(2))*i)) }' | xxd -r -p | aplay -c 2 -f S32_LE -r 16000Hard drive is more fun than urandom because it actually contains audibly structured data.
Note: You may have to stop Pulseaudio or Pipewire if you have it running.
Note: May create very loud noises or even break your headphones.
If you write the motifs to seamlessly transition then you can get musical data without any manual steps (besides the definition of the motifs).
I know other games have done this very well.
This, though, falls into the enormous genre of algorithms that take some cool phenomenon (often pi) and then quantize it to some tempo, and some scale, and some set of samples, thereby killing everything that was interesting about the original phenomenon.