Created
March 26, 2024 17:31
-
-
Save nicheath/c9db93deba2513a9cc2c17911b9d928d to your computer and use it in GitHub Desktop.
Morse Code or CW generator using speaker-test in linux [dirty hack]
This file contains 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
#!/bin/sh | |
# speaker-test is not designed for this.. you could make this longer but | |
# making it shorter just won't work due to silly way I am doing this. | |
long=0.2 | |
short=0.1 | |
lspace=0.3 | |
wspace=0.5 | |
# letter space | |
lspace() { | |
sleep $lspace | |
} | |
# word space | |
wspace() { | |
sleep $wspace | |
} | |
long() { | |
speaker-test -t sine -f 600 1> /dev/null & sleep $long && kill -9 "$!" | |
} | |
short() { | |
speaker-test -t sine -f 600 1> /dev/null & sleep $short && kill -9 "$!" | |
} | |
# TU 5NN 73 | |
long | |
lspace | |
short | |
short | |
long | |
wspace | |
short | |
short | |
short | |
short | |
short | |
lspace | |
long | |
short | |
lspace | |
long | |
short | |
wspace | |
long | |
long | |
short | |
short | |
short | |
lspace | |
short | |
short | |
short | |
long | |
long |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment