diff options
| -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 |
