diff options
| author | Skladnayazebra <skladnayazebra@gmail.com> | 2026-10-05 19:33:02 +0200 |
|---|---|---|
| committer | Skladnayazebra <skladnayazebra@gmail.com> | 2026-10-05 19:33:02 +0200 |
| commit | c0ea006ee41c464ddc439c4690e6b9e4020154d1 (patch) | |
| tree | 766a20a7f0f0c42f02cadb2e250a6c15f2b3c1ff | |
| parent | 8195f9ca4cdebf8c0dc6ce51d1a3e28757d2b781 (diff) | |
| -rw-r--r-- | guitar-notes.sh | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/guitar-notes.sh b/guitar-notes.sh index a03c3fa..acc6015 100644 --- a/guitar-notes.sh +++ b/guitar-notes.sh @@ -1,10 +1,9 @@ #!/usr/bin/env bash -# Every few seconds, I show you a string and a fret/note and you play matching note/fret +# I show you a string and a fret/note and you play matching note/fret, then hit any key to continue -export STRINGS='5-5' +export STRINGS='1-6' export FRETS='0-12' -INTERVAL_SECONDS=5 if [ $# == 0 ]; then echo "No options given, use -n for notes or -f for frets" 1>&2 @@ -25,9 +24,13 @@ rand_note () { clear while true; do + test "$PRESSED" && echo "took $SECONDS second(s)" + SECONDS=0 printf "String %s; " "$(shuf -i "$STRINGS" -n 1)" test "$GUESS_NOTES" && printf "Fret %s " "$(shuf -i "$FRETS" -n 1)" test "$GUESS_FRETS" && printf "%s " "$(rand_note)" - sleep "$INTERVAL_SECONDS" + # press any key to continue + read -n 1 -s -r + PRESSED=true clear done |
