Computer generated electro music
Do you want your computer to generate some music for you? Then you are in luck - the following code snippet does just that (Linux only; adjust the playback method for other systems). The resulting “music” will play for about 4m22s and then loop back. The attached audio is just a short sample.
$ echo "main(i){for(i=0;;i++)putchar(((i*(i>>8|i>>9)&46&i>>8))^(i&i>>13|i>>6));}" | gcc -x c - && ./a.out | aplay
(If aplay
gives you error, try putting the C code into a *.c
file and compiling it manually.)
Original message: http://www.xkcdb.com/?9067
UPDATE Another short sample found at http://countercomplex.blogspot.ru/2011/10/algorithmic-symphonies-from-one-line-of.html
main(t){for(t=0;;t++)putchar(t*(((t>>12)|(t>>8))&(63&(t>>4))));}