misc/scripts/beep-charlie

13 lines
359 B
Plaintext
Raw Normal View History

2019-01-26 18:51:26 +01:00
#!/bin/sh
2019-09-24 16:58:49 +02:00
lock=/tmp/.beep-lock
test -f $lock && exit 1 || touch $lock
2019-01-26 18:51:26 +01:00
head -c 8 /dev/urandom | \
hexdump -v -e '/1 "%u\n"' | \
awk '{ split("0,3,5,6,7,10,12",a,","); \
2020-07-06 11:57:22 +02:00
for (i = 0; i < 1; i+= 0.00012) \
2019-01-26 18:51:26 +01:00
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
2019-09-24 16:58:49 +02:00
rm -f $lock