Compare commits

..

No commits in common. "master" and "v2018.07.27" have entirely different histories.

4 changed files with 13 additions and 92 deletions

14
LICENSE
View File

@ -1,14 +0,0 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

View File

@ -2,5 +2,4 @@
A guitar tuner written in bash.
To extend, add new tunings to the array. More are coming soon. I may also add other instruments such as the mandolin
<script src="https://liberapay.com/stormdragon2976/widgets/button.js"></script>
<noscript><a href="https://liberapay.com/stormdragon2976/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></noscript>
Want to support my work? Check out my [Liberapay page](https://liberapay.com/stormdragon2976), or my membership options on [Patreon](https://patreon.com/stormdragon2976).

View File

@ -1,34 +0,0 @@
# Bash Tuner, a stringed instrument tuner written in bash
# Copyright (C) 2018 Storm Dragon
# This file is distributed under the same license as the Bash Tuner package.
# Storm Dragon <stormdragon2976@gmail.com>, 2018.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-30 23:06-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: bashtuner.sh:50
msgid "Usage: $0 tune_id"
msgstr ""
#: bashtuner.sh:51
msgid "Where tune_id is one of"
msgstr ""
#: bashtuner.sh:57
msgid "Welcome to Bash Tuner"
msgstr ""
#: bashtuner.sh:59
msgid "Select tuning"
msgstr ""

View File

@ -1,70 +1,40 @@
#!/usr/bin/env bash
#!/bin/bash
# Written by Storm Dragon https://social.stormdragon.tk/storm
# Released under the terms of the WTFPL License http://wtfpl.net
trap 'exit 0' SIGINT
declare -A tuning=(
# Dropped 1 step.
[6d]="D2 G2 C3 F3 A3 D4"
# Standard tuning
[6e]="E2 A2 D3 G3 B3 E4"
# Half step down
[half-step-down]="D#2 G#2 C#3 F#3 A#3 D#4"
#dadgad 6-string
[dadgad]="D2 A2 D3 G3 A3 D4"
#Open D
[open-d]="D2 A2 D3 F#3 A3 D4"
#drop D 6 String
[drop-d]="D2 A2 D3 G3 B3 E4"
#Drop DG
[Drop-dg]="D2 G2 D3 G3 B3 E4"
#Open G
[[open-g]]="D2 G2 D3 G3 B3 D4"
#dadgad 6-string
[dadgad]="D2 A2 D3 G3 A3 D4"
#drop D 6 String
[drop-d]="D2 A2 D3 G3 B3 E4"
# 12 string dropped 1 step.
[12d]="D3 D2 G3 G2 C4 C3 F4 F3 A3 D4"
# 12 string standard tuning
[12e]="E3 E2 A3 A2 D4 D3 G4 G3 B3 E4"
# Mandolin
[mandolin]="G3 D4 A4 E5"
#Ukulele
[ukulele]="G4 C4 E4 A4"
[ukulele-half-step-down]="F#4 B3 D#4 G#4"
[violin]="G3 D4 A4 E5"
#lap Steel 6 String C6
[steel-C6]="C3 E3 G3 A3 C4 E4"
#Nick Drake Tuning
[nick-drake-tuning]="C2 G2 C3 F3 C4 E4"
#banjo
[banjo]="G4 D3 G3 B3 D4"
# Chromatic Scale, 2 octaves.
[chromatic-scale]="C2 C#2 D2 D#2 E2 F2 F#2 G2 G#2 A2 A#2 B2 C3 C#3 D3 D#3 E3 F3 F#3 G3 G#3 A3 A#3 B3 C4 C#4 D4 D#4 E4 F4 F#4 G4 G#4 A4 A#4 B4 C5"
[Nick-Drake-Tuning]="C2 G2 C3 F3 C4 E4"
)
# For multi-language support
export TEXTDOMAIN=bashtuner
export TEXTDOMAINDIR=/usr/share/locale
source gettext.sh
export DIALOGOPTS='--insecure --no-lines --visit-items'
flush_keys() {
local keys
read -st0.001 keys
}
show_help() {
echo "$(eval_gettext "Usage: \$0 tune_id")"
echo "$(gettext "Where tune_id is one of")"
echo "Usage: $0 tune_id"
echo "Where tune_id is one of"
echo "${!tuning[@]}"
exit 0
}
if [[ $# -eq 0 ]]; then
set -- $(dialog --backtitle "$(gettext "Welcome to Bash Tuner")" \
set -- $(dialog --backtitle "Welcome to Bash Tuner" \
--no-tags \
--menu "$(gettext "Select tuning")" 0 0 10 \
--menu "Select tuning" 0 0 0 \
$(for i in ${!tuning[@]} ; do echo "$i";echo "$i";done) --stdout)
[[ -z $1 ]] && exit 0
fi
@ -75,6 +45,7 @@ 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
@ -86,8 +57,7 @@ for i in ${tuning[$1]} ; do
play -qnV0 synth $timeout pl $i &
notePID="$!"
read -sN1 -t $timeout continue
flush_keys
done | dialog --progressbox "${i//[[:digit:]]/}" 0 0
done
IFS="$ifs"
done
# Kill the final process when the program exits.