#!/bin/sh

input=q8nc1
output=$input.sd

xwaves -s &

# This time-consuming conversion with copysd is needed owing to a bug in 
# some versions of the play programs (1 Nov. 1993, confusion over byte 
# ordering).  The play programs will be fixed in the next release.  If you 
# need the fixed versions now, please contact Entropic.  
# Note that # waves will display the NIST file directly.  

if test ! -f $output
then 
  echo "Converting file (takes a while)..."
  cat $input.nst $input.ses > sd.tmp
  copysd sd.tmp $output
  rm sd.tmp
fi

if test ! -f $output.1 -o ! -f $output.2
then
  echo "Demuxing (takes a while)..." 
  demux $output $output.1 $output.2
fi

send_xwaves set first_y 100 y_increment 250

send_xwaves make file $output 
send_xwaves make file $output.2
send_xwaves make file $output.1


echo "Don't forget to remove $output, $output.1, and $output.2 when done."


