It is possible to play music using random data from /dev/urandom. This is a nice shell trick.
┗━━━━━━━━━━┓ john@localhost ~ ┗━━━━━━━━━━━━━╾ ╍▷ hexdump -e '/1 "%un"' /dev/urandom | \ awk '{ split("0,2,4,5,7,8,10,12",a,",");for (i = 0; i < \ 1; i+= 0.0001) printf("%08Xn", 100*sin(1392*2**(a[$1 %8]/12)*i)) }'\ | xxd -r -p | aplay -c 2 -f S32_LE -r 16000 |
This is the one-liner I used. This will play random tunes reminiscent of chiptunes from random data.
┗━━━━━━━━━━┓ john@localhost ~ ┗━━━━━━━━━━━━━╾ ╍▷ hexdump -e '/1 "%un"' /dev/urandom | awk '{ split("0,2,4,5,7,8,10,12",a,",");for (i = 0; i < 1; i+= 0.0001) printf("%08Xn", 100*sin(1392*2**(a[$1 %8]/12)*i)) }' | xxd -r -p | aplay -c 2 -f S32_LE -r 16000 Playing raw data 'stdin' : Signed 32 bit Little Endian, Rate 16000 Hz, Stereo ^CAborted by signal Interrupt... aplay: pcm_write:2127: write error: Interrupted system call |
It is great to try out stuff like this and get it to work.