:;# generation of javascript sound fonts for abc2svg

if test "x$1" = x; then
 echo "Usage: ./sf.sh <sfname>"
 echo "reads ./<sfname>.sf2 and generates ./<sfname>.js"
 exit 1
fi

echo '// abc2svg full soundfont' > $1.js
echo 'if (typeof abc2svg == "undefined") var abc2svg = {}' >> $1.js
echo "abc2svg.sf2 = '\\" >> $1.js
base64 $1.sf2 | sed 's/$/\\/' >> $1.js
echo "'" >> $1.js
