A helper script for writing music in the form of small c programs
Inspired by this blog post: http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
- sox (with soxplay)
- a c compiler with support for the -o flag
Usage: ./smallprogram.sh -cc compiler -rate bitrate -duration seconds script filename.wav
If you provide an output filename, the script will produce a file with that filename, whether or not one already exists. If you do not provide an output filename, it will use sox to play the result.
./smallprogram.sh 't&t>>8' # play the plain vanilla 'sierpinski harmony' ./smallprogram.sh -rate 8000 '((t\*(t>>8|t>>9)&46&t>>8))^(t&t>>13|t>>6)' # play xpansive's 'Lost in Space' from http://pouet.net/topic.php?which=8357&page=2
For a lot of interesting examples, try viznut's collection of notable one-line music formulas. To try to build your own more scientifically, take a look at his blog post, analysing the attributes of these formulas.