From: belonis@dirac.phys.washington.edu (Jim Belonis)
Newsgroups: alt.tv.ren-n-stimpy
Subject: Re: HHJJ Song Used In Rubber Nipple Salesmen
Date: 5 Sep 92 00:33:41 GMT
Distribution: na
Organization: University of Washington

Ok.  So here is an NCD Xterminal music playing program modified by me
to play the Happy, Happy, Joy, Joy song.
The program is a Bourne shell script.  The original script played Jingle Bells.

#!/bin/sh
# From comp.windows.x Sat Dec 21 13:34:14 1991
# Path: milton!usenet.coe.montana.edu!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!oakhill!melton.sps.mot.com!rhca80
# From: rhca80@melton.sps.mot.com (Henry Melton)
# Newsgroups: comp.windows.x
# Subject: Jungle Bells on Xterms
# Keywords: crude hack for christmas
# Message-ID: <1991Dec19.161645.7691@oakhill.sps.mot.com>
# Date: 19 Dec 91 16:16:45 GMT
# Sender: news@oakhill.sps.mot.com
# Organization: /etc/organization
# Lines: 141
# Nntp-Posting-Host: 222.1.248.94
# 
#!/bin/ksh
# notes, a simple shell script to play music -- by Henry Melton
#	uses xset to modify the bell tone and duration on Xterminals
#	and then sends a bell character to stdout
#	start the script in an xterm window.
#
#	The only claim I make is that it works on NCD Xterminals
#	when running under A/UX or M88k Delta boxes.
#
#	 
#
# Jingle bells score at the bottom of the script
# 
# Henry Melton rhca80@melton.sps.mot.com || hutto!henry@emx.utexas.edu
# 
# set default volume here
vol=60;export vol

dur=100;export dur

delay()
{
	l=`expr $dur / 50`
	xx=1
	while [ $xx -lt $l ]
	do
		xx=`expr $xx + 1`
	done
}

settone()
{
	case "$1"
	in
		"r")
			xset b 0 440 $dur; echo "\007\c";;
		"a")
			xset b $vol 440 $dur; echo "\007\c";;
		"b-")
			xset b $vol 466 $dur; echo "\007\c";;
		"b")
			xset b $vol 494 $dur; echo "\007\c";;
		"c")	
			xset b $vol 523 $dur; echo "\007\c";;
		"c+")
			xset b $vol 554 $dur; echo "\007\c";;
		"d")
			xset b $vol 587 $dur; echo "\007\c";;
		"e-")
			xset b $vol 622 $dur; echo "\007\c";;
		"e")
			xset b $vol 659 $dur; echo "\007\c";;
		"f")
			xset b $vol 698 $dur; echo "\007\c";;
		"f+")
			xset b $vol 740 $dur; echo "\007\c";;
		"g")
			xset b $vol 784 $dur; echo "\007\c";;
		"g+")
			xset b $vol 830 $dur; echo "\007\c";;
		"^a")
			xset b $vol 880 $dur; echo "\007\c";;
		"^b-")
			xset b $vol 932 $dur; echo "\007\c";;
		"^b")
			xset b $vol 988 $dur; echo "\007\c";;
		"^c")	
			xset b $vol 1046 $dur; echo "\007\c";;
		"^c+")
			xset b $vol 1108 $dur; echo "\007\c";;
		"^d")
			xset b $vol 1174 $dur; echo "\007\c";;
		"^e-")
			xset b $vol 1244 $dur; echo "\007\c";;
		"^e")
			xset b $vol 1318 $dur; echo "\007\c";;
		"^f")
			xset b $vol 1396 $dur; echo "\007\c";;
		"^f+")
			xset b $vol 1480 $dur; echo "\007\c";;
		"^g")
			xset b $vol 1568 $dur; echo "\007\c";;
		"^g+")
			xset b $vol 1660 $dur; echo "\007\c";;
			
	esac
	delay
}

play()
{
	case "$1"
	in
		"1")
			dur=400;export dur;;
		"1.")
			dur=600;export dur;;
		"2")
			dur=200;export dur;;
		"2.")
			dur=300;export dur;;
		"4")
			dur=100;export dur;;
		"4.")
			dur=150;export dur;;
		"8")
			dur=50;export dur;;
		"8.")
			dur=75;export dur;;
		"16")
			dur=25;export dur;;
		"16.")
			dur=37;export dur;;
		"q")
			vol=25;export vol;;
		"m")
			vol=50;export vol;;
		"l")
			vol=100;export vol;;
	esac

	settone $1
}


#==================== Main Loop =======================

nt()
{
	for note in $*
	do
		play $note
	done
} 

# Jingle Bells
# nt 4 d 4 d 2 d 4 d 4 d 2 d 4 d 4 f 4. b 8 c 1 d 
# nt 4 e 4 e 4. e 8 e 4 e 4 d 4 d 8 d 8 d 4 d 4 c 4 c 4 d 2 c 2 f
# nt 4 d 4 d 2 d 4 d 4 d 2 d 4 d 4 f 4. b 8 c 1 d 
# nt 4 e 4 e 4. e 8 e 4 e 4 d 4 d 8 d 8 d 4 f 4 f 4 e 4 c 1 b   
# exit 0
# # -- 
# # Henry Melton rhca80@melton.sps.mot.com || hutto!henry@emx.utexas.edu
# 
# J.James Belonis II changed to do the Ren & Stimpy cartoon show song...
# Happy, Happy, Joy, Joy

nt 2 b 2 b 2 b 2 b 1 b 1 d 2 r
nt 2 c 2 c 2 c 2 b 1 a 1 d 2 r
nt 2 c 2 c 2 c 2 c 1 c 1 e 2 r
nt 2 d 2 d 2 d 2 d 1 b 1 d 2 r 
nt 2 d 2 d 2 d 2 d 1 d 1 f 2 r
nt 2 e 2 e 2 e 2 e 1 e 1 g 2 r
#nt 2 e 2 e 2 e 2 e 1 e 1 e 2 r
nt 2 f+ 2 f+ 2 f+ 2 f+ 1 f+ 1 a 2 r
nt 1 g

exit 0
# 


--
J.James(Jim)Belonis II, U of Washington Physics Computer Cost Center Manager
belonis@dirac.phys.washington.edu  Internet    Physics Hall FM-15
BELONIS@UWAPHAST BITNET       noon to midnite  U of W, Seattle, WA 98195
24683::PHAST::BELONIS SPAN,HEPNET  7 days      room 32a   (206) 685-8695
Newsgroups: alt.tv.ren-n-stimpy