misc/scripts/beep-wigfrid

16 lines
345 B
Plaintext
Raw Normal View History

2019-08-29 11:09:05 +02:00
#!/bin/sh
2019-09-24 16:58:49 +02:00
lock=/tmp/.beep-lock
2020-07-25 17:38:45 +02:00
test -f $lock && exit 1
touch $lock
2019-08-29 11:09:05 +02:00
head -c 4 /dev/urandom | \
2020-07-25 17:38:45 +02:00
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", 40*sin(450*exp((a[$1 % 8]/12)*log(2))*i)) }' |
xxd -r -p |
2019-08-29 11:09:05 +02:00
aplay -c 2 -f S16_LE -r 48000 -Dplug:hdmi1
2020-07-25 17:38:45 +02:00
2019-09-24 16:58:49 +02:00
rm -f $lock