Page 1 of 1

tuna-dialog - dialog-based guitar tuner

Posted: Wed Jan 13, 2016 5:20 pm
by machinebacon

Code: Select all

#!/bin/bash
# tuna-dialog - guitar tuner, depends on dialog and speaker-test

. /usr/share/doc/dialog/examples/setup-vars
. /usr/share/doc/dialog/examples/setup-tempfile

menu(){
dialog --backtitle "tuna" --title "Guitar Tuner" --menu "Pick a string" 7 29 0 \
        "329.63" "high E4 string" \
        "246.94" "B3 string" \
        "196" "G3 string" \
        "146.83" "D3 string" \
        "110" "A string" \
        "82.41" "low E2 string" 2> $tempfile
retval=$?
case $retval in
  $DIALOG_CANCEL)
    exit 0;;
esac
speaker-test -f `cat $tempfile` -t sine -l 1 -p 10 > /dev/null
menu
}
menu

Re: tuna-dialog - dialog-based guitar tuner

Posted: Wed Jan 13, 2016 6:39 pm
by wuxmedia
nice. not that I can tune by ear or even have a guitar..

Re: tuna-dialog - dialog-based guitar tuner

Posted: Wed Jan 13, 2016 9:11 pm
by Theo
Thanks!
I don't have a guitar, but ukelele.
So with some small changes, this should be the one to tune it (US Standard)

Code: Select all

 
#!/bin/bash
# uketune-dialog - Ukelele tuner, depends on dialog and speaker-test

. /usr/share/doc/dialog/examples/setup-vars
. /usr/share/doc/dialog/examples/setup-tempfile

menu(){
dialog --backtitle "uketune" --title "Ukelele Tuner" --menu "Pick a string" 7 29 0 \
        "392.0" "G string" \
        "261.6" "C string" \
        "329.6" "E string" \
        "440.0" "A string" 2> $tempfile               
retval=$?
case $retval in
  $DIALOG_CANCEL)
    exit 0;;
esac
speaker-test -f `cat $tempfile` -t sine -l 1 -p 10 > /dev/null
menu
}
menu


Re: tuna-dialog - dialog-based guitar tuner

Posted: Wed Jan 13, 2016 10:04 pm
by simgin
^ Damn you are quick to adapt Theo :)

Re: tuna-dialog - dialog-based guitar tuner

Posted: Wed Jan 13, 2016 10:17 pm
by Theo
^ I liked the idea, but I can't play the guitar (camptodactyly).. So, this one is for the uke, which I can play a little :)

Re: tuna-dialog - dialog-based guitar tuner

Posted: Thu Jan 14, 2016 6:43 am
by rhowaldt
^ if Django could do it with his penguin-hand, why can't you? https://www.youtube.com/watch?v=PQhTpgicdx4 ;)

really cool adaption of the script though Theo, and really cool script in the first place, didn't know it was possible to tune guitar through Linux. personally I use an app for it because I will always have my phone at hand and don't have to depend on my crappy laptop mic and all that :)

Re: tuna-dialog - dialog-based guitar tuner

Posted: Thu Jan 14, 2016 7:00 am
by machinebacon
huh, you would not use laptop microphone to listen to a tone, would you? ;)

Re: tuna-dialog - dialog-based guitar tuner

Posted: Thu Jan 14, 2016 8:16 am
by rhowaldt
aaah like that... my ear isn't good enough to tune the guitar properly i think... although maybe... ill give it a try sometime :)

Re: tuna-dialog - dialog-based guitar tuner

Posted: Thu Jan 14, 2016 8:25 am
by Snap
That's great. Easy to adapt to open tunings also (or whatever tuning)

Would be nice having a sort of chooser to pick different tunings for those who don't stuck to the standard tuning. I will give it a try.

Re: tuna-dialog - dialog-based guitar tuner

Posted: Thu Jan 14, 2016 8:50 am
by machinebacon
^ fun fact, when I posted the script here I knew that people would come with "ukulele" and "bass guitar" and "drop D" and 7-th B and so on, and then I even thought about not posting it. :)

/closed