#!/bin/sh
#
# Play Midi files even if compressed
#
# 19940305 csh
# 19940505 csh added support for multiple files and fixed bugs
#
touch /tmp/igotrun
trap 'rm -f $tfile' 0 1 2 9 15
tfile=/tmp/pmid$$
echo
for i in $*; 
do 
  if [ -e $i ]; then
    echo Playing: $i
    gzip -dc $i > $tfile  2>/dev/null
    if [ $? = 0 ]; then
      mp $tfile 
      rm $tfile
    else
      mp $i
    fi
  fi
done
