Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This oneliner creates simple C program to write computer music, then compiles it, than runs it
- # To use it you need gcc and aplay (sudo apt-get install gcc)
- # Run it in linux bash to hear the music
- a=10;b=8;c=63;d=5;echo "main(t){for(t=0;;t++)putchar(t*((t>>$a|t>>$b)&$c^t>>$d));}" | gcc -x c -o ttt - && ./ttt | aplay
- # Another sample (fun one ^_^ cute):
- a=10;b=8;c=63;d=25;echo "main(t){for(t=0;;t++)putchar(t*((t>>$a|t>>$b)&$c^t>>$d));}" | gcc -x c -o ttt - && ./ttt | aplay
- # Use Ctrl+C to stop the program
- # Please change a, b, c and d values to change the music
- # Also have a look at this links:
- # http://countercomplex.blogspot.ru/2011/10/algorithmic-symphonies-from-one-line-of.html
- # https://github.com/MattVitelli/GRUV
- # http://tones.wolfram.com/generate/
- # http://www.ibm.com/developerworks/java/library/j-camusic/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement