misc/scripts/beep-charlie
2019-01-27 11:37:34 +01:00

9 lines
286 B
Bash
Executable File

#!/bin/sh
head -c 8 /dev/urandom | \
hexdump -v -e '/1 "%u\n"' | \
awk '{ split("0,3,5,6,7,10,12",a,","); \
for (i = 0; i < 1; i+= 0.00011) \
printf("%08X\n", 60*sin(450*exp((a[$1 % 8]/12)*log(2))*i)) }' | \
xxd -r -p | \
aplay -c 1 -f S32_LE -r 48000 -D plug:default