[net.sources] Cassette Labels for Grateful Dead Concerts

zben@umd5.UUCP (04/13/87)

Here is the final version of the cassette label shell script.  It extracts
the songlists from the 75.enc, 76.enc, etc. database posted by Cliff Matthews
from unmvax.uucp in April of 1985.  It cannot know exactly when the tapes
were flipped, so it puts in the "flip" word halfway down the song list. 
My recommendation is to use this script to produce a file, use a text editor
to make it correspond to your tape, then download it to a Postscript printer.

One calls it like this:

   deadshow 6 17 75 >place

This is a derivative of the cassette label program posted by Scott Anderson
of the University of Minnesota at Duluth a few weeks ago.  Credits for the
idea and the original Postscript program go to him, and to Cliff for the
database.  I just coupled the two together and optimized the result a bit.

The major change from the version I posted last week is the reversal of the
text on the cassette.  The -v option is there to make the new one do what the
old one did.  There are also two new Postscript words "set3" and "set4".

The shell script will never produce the set3 or set4 words, but if you're
editing the output anyway they might be handy for some of those really long
shows (like 12/31/78 or 10/14/80).

#! /bin/sh

# Produce a cassette label for a Grateful Dead concert...   [:-)]

DEDIR=/usr/users/zben/Dead

case $1 in
-v|-V) VFLAG= ; shift ;;
esac

case $# in
3) ;;
*) echo Usage: $0 [-v] month day year 1>&2 ; exit 2 ;;
esac

STUFF=`grep $1-$2-$3 $DEDIR/$3.enc`

case $? in
0) ;;
1) echo Concert not found 1>&2 ; exit 2 ;;
2) echo Year not found 1>&2 ; exit 2 ;;
*) echo Grep error 1>&2 ; exit 2 ;;
esac

DATE=`echo $STUFF | sed -n 's|^ *\([-0-9]*\) .*$|\1|p'`
# echo $DATE 1>&2

PLACE=`echo $STUFF | sed -n 's|^ *[-0-9]* *\([^~]*\)~~.*$|\1|p'`
echo $PLACE 1>&2

SETONE=`echo $STUFF | sed -n 's|^[^~]*~~\([^~]*\).*$|\1|p'`
# echo "|${SETONE}|" 1>&2
case "$SETONE" in
"") echo Set one not extracted 1>&2 ; exit 2 ;;
esac

cat <<@
%!PS-Adobe-1.0 
/in { 72 mul } def 
/date { /datevar exch def } def
/place { /placevar exch def } def
/drawcass { 2 setlinewidth 2 setlinecap .4 setgray newpath
    0    0    moveto
    0    4 in lineto  
 .625 in 4 in lineto  
 .625 in 0    lineto 
    0    0    lineto  
fill 0 setgray
 .625 in 0    moveto  .625 in 4 in lineto stroke 
    0    0    moveto     0    4 in lineto stroke 
1.125 in 0    moveto 1.125 in 4 in lineto stroke 
 3.75 in 0    moveto  3.75 in 4 in lineto stroke 
    0    0    moveto  3.75 in 0    lineto stroke 
1.125 in 2 in moveto  3.75 in 2 in lineto stroke 
    0    4 in moveto  3.75 in 4 in lineto stroke 
${VFLAG-3.725}${VFLAG+1.25 } in ${VFLAG-281}${VFLAG+7  }  translate
${VFLAG--}90 rotate } def 
/deadcass { initmatrix translate drawcass
gsave /Helvetica-Bold findfont 14 scalefont setfont  
  0      ${VFLAG--3 }${VFLAG+0.2} in translate
  0      0.2 in moveto (Grateful Dead) show
  1.6 in 0.2 in moveto datevar show
  3.2 in 0.2 in moveto show
  0      0      moveto placevar show
grestore 0 0 moveto } def
/set1 { (Set I)   4.3 in 5.1 in deadcass } def
/set2 { (Set II)  4.3 in 1.0 in deadcass } def
/set3 { (Set III) 0.5 in 5.1 in deadcass } def
/set4 { (Set IV)  0.5 in 1.0 in deadcass } def
/flip { 148 0 translate 0 0 moveto } def
/song { currentpoint 12 sub 0 exch moveto pop show } def 
/Helvetica findfont 10 scalefont setfont
@

echo \(${DATE}\)date
echo \(${PLACE}\)place
echo set1
OFFSET=`echo ${SETONE}aaa | wc -c`
OFFSET=`expr $OFFSET / 4`
# echo $OFFSET 1>&2
echo $SETONE | sed -f $DEDIR/dead1.sed | sed -f $DEDIR/dead2.sed | sed 's|^|(|' | sed 's|$|)song|' | sed $OFFSET's|$|\
flip|'

SETTWO=`echo $STUFF | sed -n 's|^[^~]*~~[^~]*~\([^~]*\)~.*$|\1|p'`
# echo "|${SETTWO}|" 1>&2
ENCORE=`echo $STUFF | sed -n 's|^[^~]*~~[^~]*~[^~]*~\(.*\)$|\1|p'`
# echo "|${ENCORE}|" 1>&2

case "${SETTWO}${ENCORE}" in
"") echo No second set 1>&2; ;;
*)
OFFSET=`echo ${SETTWO}aaa${ENCORE} | wc -c`
OFFSET=`expr $OFFSET / 4`
# echo $OFFSET 1>&2

echo set2
echo ${SETTWO}~${ENCORE} | sed -f $DEDIR/dead1.sed | sed -f $DEDIR/dead2.sed | sed 's|^|(|' | sed 's|$|)song|' | sed $OFFSET's|$|\
flip|'

esac

echo showpage
-- 
                    umd5.UUCP    <= {seismo!mimsy,ihnp4!rlgvax}!cvl!umd5!zben
Ben Cranston zben @ umd2.UMD.EDU    Kingdom of Merryland UniSys 1100/92
                    umd2.BITNET     "via HASP with RSCS"