8 bit chip tune from one line of code on Linux

Chiptune_by_curpoplikI stumbled across this great tune today that is created by one line of code!

Just copy any paste the code below into a text file, make it executable and run it.

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

Many thanks to Martin Holec for creating the code, and Rob Kendrick for linking to it on Google+.

Enjoy!

One thought on “8 bit chip tune from one line of code on Linux

  1. I fixed it to avoid leaving litter (a.out), and allow passing args (e.g. rate) to aplay.

    trap ‘rm $bin 2>/dev/null ; exit’ 0 2 15 ; bin=`mktemp` && echo “main(i){for(i=0;;i++)putchar(((i*(i>>8|i>>9)&46&i>>8))^(i&i>>13|i>>6));}” | gcc -o $bin -x c – && $bin | aplay “[email protected]

Leave a Reply

%d bloggers like this: