#!/bin/sh
# mktrfile: make waveshaping transfer function files
#
# Copyright (c) 1995 Kai Lassfolk
#
if test ! -f /usr/bin/sndconvert
then
	echo "mktrfile: cannot find sndconvert." >&2 exit 1
fi

case $# in
2) break;;
*) echo "Usage: mktrfile inputfile outputfile.snd"; exit 1;;
esac

spline -n 1024 < $1 |  awk '{print $2}' > /tmp/wshdata$$.txt
sndconvert -o $2 -f 3 -s 44100 -c 1 -a /tmp/wshdata$$.txt
rm -f /tmp/wshdata$$.txt
