LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > peonuser
User Name
Password

Notices


Rate this Entry

Autoharp

Posted 06-27-2013 at 06:49 PM by peonuser
Updated 07-16-2013 at 11:25 AM by peonuser

Just like a regular autoharp, all you have to do is press a key for the chord sounding.

$ autoharp.sh

************************
* Mom's autoharp *
************************
* [1] C major *
* [2] A minor *
* [3] G major 7th *
* [4] F major *
* [5] D minor *
* [6] E minor *
* [7] E major 7th *
* [8] A major 7th *
* [9] C major 7th *
* [+] D major 7th *
* [-] G major *
* *
* [0] Exit/Stop *
************************

Enter your menu choice [1-9, +, - or 0]:




Use it. (super simple example):

On Top of Old Smokie

(C) On top of old (F)Smokie, all covered in (C)snow,
I lost my true (G7)lover, by courtin' too (C)slow
(C)On top of old (F)Smokie, I went there to (C)weep
For a false hearted (G7)lover, is worse than a (C)thief

(C)A thief he will (F)rob you, and take what you (C)save
But a false hearted (G7)lover, will put you in your (C)grave
(C)On top of old (F)Smokie, all covered in (C)snow
I lost my true (G7)lover, by courtin' too (C)slow

(C) They'll hug you and (F)kiss you, then tell you more (C)lies
Than the crossties on the (G7) railroad, or the stars in the (C)skies
(C)On top of old (F)Smokie, all covered in (C)snow
I lost my true (G7)lover, by courtin' too (C)slow

Here is the source code that you can cut and paste into your favorite linux editor.

#!/bin/bash

#

# Script to emulate an autoharp.

#

while :

do

clear

echo "************************"

echo "* Mom's autoharp *"

echo "************************"

echo "* [1] C major *"

echo "* [2] A minor *"

echo "* [3] G major 7th *"

echo "* [4] F major *"

echo "* [5] D minor *"

echo "* [6] E minor *"

echo "* [7] E major 7th *"

echo "* [8] A major 7th *"

echo "* [9] C major 7th *"

echo "* [+] D major 7th *"

echo "* [-] G major *"

echo "* *"

echo "* [0] Exit/Stop *"

echo "************************"

echo

echo "Enter your menu choice [1-9, +, - or 0]: "

read -n 1 yourch

case $yourch in

1) play -n synth pl C2 pl E2 pl G2 pl C3 pl E3 pl G3 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1 ;;

2) play -n synth pl A2 pl C2 pl E2 pl A3 pl C3 pl E3 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1 ;;

3) play -n synth pl G2 pl B2 pl D2 pl F4 pl G3 pl B3 pl D3 pl F4 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1 ;;

4) play -n synth pl F2 pl A2 pl C2 pl F3 pl A3 pl C3 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1 ;;

5) play -n synth pl D2 pl F2 pl A2 pl D3 pl A3 pl F4 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1 ;;

6) play -n synth pl E2 pl G2 pl B2 pl E3 pl B3 pl G4 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1 ;;

7) play -n synth pl E2 pl G#2 pl B2 pl D2 pl E3 pl B3 pl G#4 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1 ;;

8) play -n synth pl A2 pl C#2 pl E2 pl G2 pl A3 pl C#3 pl E3 pl G3 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1 ;;

9) play -n synth pl C2 pl E2 pl G2 pl A#2 pl C3 pl E3 pl G3 pl A#3 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1 ;;

+) play -n synth pl D2 pl F#2 pl A2 pl C3 pl D3 pl F#3 pl A3 pl C4 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1 ;;

-) play -n synth pl G2 pl B2 pl D2 pl G3 pl B3 pl D3 delay 0 .05 .1 .15 .2 .25 remix - fade 0 1.5 .1 norm -1 ;;

0) exit 0;;

*) echo "Oopps!!! Please select choice 1,2,3,4,5,6,7,8,9,-, or +"

echo "Press Enter to continue. . ." ; read ;;

esac

done
Posted in Uncategorized
Views 1118 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 04:48 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration