sxiii icon

Linux Cool Music Generator via Bash and C - try it yourself!

sxiii | PRO | 05/28/16 02:12:27 AM UTC | 0 ⭐ | 557 👁️ | Never ⏰ | []
Bash |

830 B

|

None

|

0 👍

/

0 👎

# 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/

Comments