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))));}

fsLeg

It turned out, that I need a full featured website much less than a simple blog. I don’t want to have a blog on Tumblr, but I do like their implementation of it, so I went with Chyrp, which is pretty close. But then Chyrp died, so I moved to Hugo. The blog is NSFW, as I might occasionally post some pr0n and other disturbing stuff.

Tags
Archives