Created
January 30, 2017 05:01
-
-
Save terraboops/7a1b0383f22d831e55d2c401505ead90 to your computer and use it in GitHub Desktop.
Generates music from entropy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(42*exp((a[$1 % 8]/6)*log(2))*i)) }' | xxd -r -p | sox -traw -r 44100 -e unsigned -b 32 -c 2 - -d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment