From 7d1e13d99dd87883320ba5b582d579aeb9982e78 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sat, 28 Jul 2018 10:39:19 -0400 Subject: [PATCH] Arrow keys shouldn't cause craziness with tuner. --- bashtuner.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bashtuner.sh b/bashtuner.sh index 879d79c..36a7829 100755 --- a/bashtuner.sh +++ b/bashtuner.sh @@ -27,6 +27,10 @@ declare -A tuning=( ) export DIALOGOPTS='--insecure --no-lines --visit-items' +flush_keys() { + read -st0.001 continue +} + show_help() { echo "Usage: $0 tune_id" echo "Where tune_id is one of" @@ -48,7 +52,6 @@ fi [ "$1" == "--help" ] && show_help # Continuously play the notes until a key is press. -# Note key can not be enter or space. # This will adjust how long each note plays. timeout=2 for i in ${tuning[$1]} ; do @@ -60,6 +63,7 @@ for i in ${tuning[$1]} ; do play -qnV0 synth $timeout pl $i & notePID="$!" read -sN1 -t $timeout continue + flush_keys done IFS="$ifs" done