Created
March 12, 2016 21:42
-
-
Save socantre/c6f0cca7555b3b173e40 to your computer and use it in GitHub Desktop.
random note generator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# based on http://blog.robertelder.org/bash-one-liner-compose-music/ | |
# with overflow, channels, timing, etc. bugs fixed | |
< /dev/urandom hexdump -v -e '/1 "%u\n"' | | |
gawk 'BEGIN { split("0,2,4,5,7,9,11,12",a,",")} | |
{ for (i = 0; i < 0.3125; i += 0.0000625) | |
printf("%02X\n", 100*sin(1382*exp((a[$1 % 8]/12)*log(2))*i)) }' | | |
sed -e 's/.*\(..\)$/\1/g' | | |
xxd -r -p | | |
sox -traw -c 1 -r16000 -b8 -e signed-integer - -tcoreaudio |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment