cdr@thor.stolaf.edu (Craig D. Rice, St. Olaf College) (09/07/89)
Below is a shar file which will enable your TU78 tape drive to make music... Just a little hack - see the README for more information. Craig --- Craig D. Rice UNIX Systems Specialist cdr@stolaf.edu Academic Computer Center, St. Olaf College +1 507 663-3631 Northfield, MN 55057 USA ----- CUT HERE ----- #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of shell archive." # Contents: makesong makesong/NOTES makesong/README makesong/Songs # makesong/makesong makesong/Songs/BACH makesong/Songs/B_DAY # makesong/Songs/ENTERTAINER makesong/Songs/REVILE # makesong/Songs/SCALE makesong/Songs/SHORT makesong/Songs/UMYAYA # Wrapped by cdr@thor.acc.stolaf.edu on Tue Sep 5 09:18:43 1989 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test ! -d 'makesong' ; then echo shar: Creating directory \"'makesong'\" mkdir 'makesong' fi if test -f 'makesong/NOTES' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'makesong/NOTES'\" else echo shar: Extracting \"'makesong/NOTES'\" \(569 characters\) sed "s/^X//" >'makesong/NOTES' <<'END_OF_FILE' X/* Note declarations for TU78 */ X/* These values are approximate and need to be tuned (pun intended) */ X X X#define A1 4700 X#define B1b 4400 X#define B1 4200 X#define C1 3700 X#define C1s 3400 X#define Db 3400 X#define D 3050 X#define Eb 2700 X#define E 2500 X#define F 2100 X#define Fs 1900 X#define Gb 1900 X#define G 1700 X#define Gs 1500 X#define Ab 1500 X#define A 1300 X#define Bb 1100 X#define B 900 X#define Cb 770 X#define C 700 X#define Cs 625 X#define REST 100000 X X/* These are unused */ X X#define SIXTEENTH 1 X#define EIGTH 2 X#define QUARTER 4 X#define HALF 8 X#define WHOLE 10 X END_OF_FILE if test 569 -ne `wc -c <'makesong/NOTES'`; then echo shar: \"'makesong/NOTES'\" unpacked with wrong size! fi # end of 'makesong/NOTES' fi if test -f 'makesong/README' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'makesong/README'\" else echo shar: Extracting \"'makesong/README'\" \(1737 characters\) sed "s/^X//" >'makesong/README' <<'END_OF_FILE' X X"Makesong"* is a shell script which turns your TU78 tape-drive into Xa musical marvel... It is just a quick hack, so do not expect Xanything close to perfection. The numbers found in the "NOTES" file Xare approximate and could be a lot better, but I don't have the Xtime to do it. X XSee the example songs in the Songs/ directory... Format for a song file Xshould be obvious from the examples... Songfiles are run through the XC Preprocessor (/lib/cpp), so feel free to include comments, #defines, X#includes, etc. X XImprovements/Bugs X - the values for the notes should be tuned X - more notes should be added X - rests should be implemented a different way X - as it stands, higher-pitched notes are shorter in duration X than lower notes - the correct value for DURATION (now X a constant 1000) should be a function of pitch. X - different length notes (whole, half, quarter, etc.) should X also be added X - something other than /etc/termcap should be used as dd's if=, X preferably something with unlimited size -- maybe X /usr/ucb/yes "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" X or a variant X - due to the implementation of the MUSIC variable, there is X probably a sh-imposed limit on the number of notes X in a Songfile X XInteresting effects may be achieved by combining 'mt fsf' with 'mt bsf' Xcommands - 'bsf' produces a richer "timber" of sound than does 'fsf'. X XPlease let me know about changes and improvements you make -- also Xany songs you teach your TU78 to play! :-) X X[* Note, "makesong" works the tape drive pretty hard, so be nice. . .] X XEnjoy! XCraig Fri Aug 25 11:12:17 CDT 1989 X--- XCraig D. Rice UNIX Systems Specialist Xcdr@stolaf.edu Academic Computer Center, St. Olaf College X+1 507 663-3631 Northfield, MN 55057 USA END_OF_FILE if test 1737 -ne `wc -c <'makesong/README'`; then echo shar: \"'makesong/README'\" unpacked with wrong size! fi # end of 'makesong/README' fi if test ! -d 'makesong/Songs' ; then echo shar: Creating directory \"'makesong/Songs'\" mkdir 'makesong/Songs' fi if test -f 'makesong/makesong' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'makesong/makesong'\" else echo shar: Extracting \"'makesong/makesong'\" \(766 characters\) sed "s/^X//" >'makesong/makesong' <<'END_OF_FILE' X#!/bin/sh X X# This script empowers your TU78 tapedrive with musicical abilities X# you never knew it had! X X# makesong [-p] Songs/songfile X# -p is just "play-only" - do not write the song to tape X XNOTES=0 XDURATION=1000 XPLAY_ONLY=0 X Xif [ $# -gt 2 ]; then X echo "usage: makesong [-playonly] Songs/songfile" X exit 0 Xfi X X# Okay, so we don't care what the first argument is. . . Xif [ $# -eq 2 ]; then X PLAY_ONLY=1 X shift Xfi X XMUSIC=`/lib/cpp $1 | sed '1,/START/d'` X Xmt rewind Xif [ $PLAY_ONLY -eq 0 ]; then X echo Creating Tape... X for i in $MUSIC X do X echo -n "$i " X dd if=/etc/termcap of=/dev/nrmt8 bs=$i count=$DURATION 2> /dev/null X done X echo "" Xfi X XNOTES=`echo $MUSIC | wc -w` Xmt rewind X Xecho $1 had $NOTES notes Xecho Playing song... X Xmt fsf $NOTES X Xexit $NOTES END_OF_FILE if test 766 -ne `wc -c <'makesong/makesong'`; then echo shar: \"'makesong/makesong'\" unpacked with wrong size! fi chmod +x 'makesong/makesong' # end of 'makesong/makesong' fi if test -f 'makesong/Songs/BACH' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'makesong/Songs/BACH'\" else echo shar: Extracting \"'makesong/Songs/BACH'\" \(761 characters\) sed "s/^X//" >'makesong/Songs/BACH' <<'END_OF_FILE' X/* X Apologies to J.S. Bach X */ X X#include "../NOTES" X XSTART XC1 C1 E G E C1 B1 B1 A G G G B1 B1 D F D B1 C1 C1 A G G G XC1 C1 E G E C1 B1 B1 A G G G A A G F E D C1 C1 C1 C1 C1 C1 XC1 C1 E G E C1 B1 B1 A G G G B1 B1 D F D B1 C1 C1 A G G G XC1 C1 E G E C1 B1 B1 A G G G A A G F E D C1 C1 C1 C1 C1 C1 XC1 C1 E G E C1 B1 B1 A G G G B1 B1 D F D B1 C1 C1 A G G G XC1 C1 E G E C1 B1 B1 A G G G A A G F E D C1 C1 C1 C1 C1 C1 XC1 C1 E G E C1 B1 B1 A G G G B1 B1 D F D B1 C1 C1 A G G G XC1 C1 E G E C1 B1 B1 A G G G A A G F E D C1 C1 C1 C1 C1 C1 XC1 C1 E G E C1 B1 B1 A G G G B1 B1 D F D B1 C1 C1 A G G G XC1 C1 E G E C1 B1 B1 A G G G A A G F E D C1 C1 C1 C1 C1 C1 XC1 C1 E G E C1 B1 B1 A G G G B1 B1 D F D B1 C1 C1 A G G G XC1 C1 E G E C1 B1 B1 A G G G A A G F E D C1 C1 C1 C1 C1 C1 END_OF_FILE if test 761 -ne `wc -c <'makesong/Songs/BACH'`; then echo shar: \"'makesong/Songs/BACH'\" unpacked with wrong size! fi # end of 'makesong/Songs/BACH' fi if test -f 'makesong/Songs/B_DAY' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'makesong/Songs/B_DAY'\" else echo shar: Extracting \"'makesong/Songs/B_DAY'\" \(159 characters\) sed "s/^X//" >'makesong/Songs/B_DAY' <<'END_OF_FILE' X X/* X An interesting rendition of an old favorite... X */ X X#include "../NOTES" X XSTART XC1 C1 D C1 F E REST C1 C1 D C1 G F REST C1 C1 C A F E D REST XBb Bb A F G F END_OF_FILE if test 159 -ne `wc -c <'makesong/Songs/B_DAY'`; then echo shar: \"'makesong/Songs/B_DAY'\" unpacked with wrong size! fi # end of 'makesong/Songs/B_DAY' fi if test -f 'makesong/Songs/ENTERTAINER' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'makesong/Songs/ENTERTAINER'\" else echo shar: Extracting \"'makesong/Songs/ENTERTAINER'\" \(485 characters\) sed "s/^X//" >'makesong/Songs/ENTERTAINER' <<'END_OF_FILE' X X/* X Joplin's THE ENTERTAINER X */ X X#include "../NOTES" X XSTART X X/* XA1 B1b C1 G C1 G C1 G G A Bb B G A B Fs A G G G X */ X XB1b B1 C1 G C1 G C1 G G A Bb B G A B Fs A G G G XB1b B1 C1 G C1 G C1 G E D C1s E G B A G E A XB1b B1 C1 G C1 G C1 G G A Bb B G A B Fs A G XG A B G A B G A G B G A B G A G B G A B Fs A G XB1b B1 C1 G C1 G C1 G G A Bb B G A B Fs A G G G XB1b B1 C1 G C1 G C1 G E D C1s E G B A G E A XB1b B1 C1 G C1 G C1 G G A Bb B G A B Fs A G XG A B G A B G A G B G A B G A G B G A B Fs A G END_OF_FILE if test 485 -ne `wc -c <'makesong/Songs/ENTERTAINER'`; then echo shar: \"'makesong/Songs/ENTERTAINER'\" unpacked with wrong size! fi # end of 'makesong/Songs/ENTERTAINER' fi if test -f 'makesong/Songs/REVILE' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'makesong/Songs/REVILE'\" else echo shar: Extracting \"'makesong/Songs/REVILE'\" \(188 characters\) sed "s/^X//" >'makesong/Songs/REVILE' <<'END_OF_FILE' X X/* X Wake up!! X */ X X#include "../NOTES" X XSTART XD G B G D B G B G D B G B G D G B G XD G B G D B G B G D B G B G D D G XD G B G D B G B G D B G B G D G B G XD G B G D B G B G D B G B G D D G X END_OF_FILE if test 188 -ne `wc -c <'makesong/Songs/REVILE'`; then echo shar: \"'makesong/Songs/REVILE'\" unpacked with wrong size! fi # end of 'makesong/Songs/REVILE' fi if test -f 'makesong/Songs/SCALE' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'makesong/Songs/SCALE'\" else echo shar: Extracting \"'makesong/Songs/SCALE'\" \(88 characters\) sed "s/^X//" >'makesong/Songs/SCALE' <<'END_OF_FILE' X/* X Be sure to practice your scales! X */ X X#include "../NOTES" X XSTART XA B C# D E F# G# A END_OF_FILE if test 88 -ne `wc -c <'makesong/Songs/SCALE'`; then echo shar: \"'makesong/Songs/SCALE'\" unpacked with wrong size! fi # end of 'makesong/Songs/SCALE' fi if test -f 'makesong/Songs/SHORT' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'makesong/Songs/SHORT'\" else echo shar: Extracting \"'makesong/Songs/SHORT'\" \(76 characters\) sed "s/^X//" >'makesong/Songs/SHORT' <<'END_OF_FILE' X/* X Be sure to practice your scales! X */ X X#include "../NOTES" X XSTART XC1 E G END_OF_FILE if test 76 -ne `wc -c <'makesong/Songs/SHORT'`; then echo shar: \"'makesong/Songs/SHORT'\" unpacked with wrong size! fi # end of 'makesong/Songs/SHORT' fi if test -f 'makesong/Songs/UMYAYA' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'makesong/Songs/UMYAYA'\" else echo shar: Extracting \"'makesong/Songs/UMYAYA'\" \(507 characters\) sed "s/^X//" >'makesong/Songs/UMYAYA' <<'END_OF_FILE' X X/* X St. Olaf College School Song X X X We come from St. Olaf, we sure are the real stuff, X Our team is the cream of the college is great. X We fight fast and furious, our teem is injurous, X Tonight Carleton College will soon meet its fate! X X Um ya ya, um ya ya, um ya ya, um ya ya, um ya ya, um ya ya X Um Ya Ya Ya! X */ X X#include "../NOTES" X XSTART XE A A A Cs A A D Fs Fs D Fs F E Gs Gs E Fs Gs B A A A XE A A A Cs A A D Fs Fs D Fs F E Gs Gs E Fs Gs B A A A XCs A A Cs A A D Fs Fs D Fs Fs E Gs Gs E Fs Gs B A A A END_OF_FILE if test 507 -ne `wc -c <'makesong/Songs/UMYAYA'`; then echo shar: \"'makesong/Songs/UMYAYA'\" unpacked with wrong size! fi # end of 'makesong/Songs/UMYAYA' fi echo shar: End of shell archive. exit 0