2012-03-04 12:39:12 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Make items required for the website but not for the book.
|
|
|
|
# They go into web/<book>.
|
|
|
|
#
|
|
|
|
|
|
|
|
if [ $# != 1 ]; then
|
|
|
|
echo "Usage: makeWebItems.sh <book dir name>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
dir=`pwd`
|
|
|
|
|
|
|
|
booke=$dir/$1
|
|
|
|
builddir=$dir/web/$1
|
|
|
|
graphicsdir=$dir/graphics/$1
|
|
|
|
|
|
|
|
mkdir -p $builddir
|
|
|
|
|
2012-03-04 16:09:06 +00:00
|
|
|
# Now, for each tune, make the tune JPG and sound. Do this to temp
|
|
|
|
# files and rename into place to make updates as atomic as possible.
|
2012-03-04 12:39:12 +00:00
|
|
|
find $booke -name "*.abc" | sort |
|
|
|
|
while read filename
|
|
|
|
do
|
|
|
|
name=`basename $filename .abc`
|
2012-03-04 16:09:06 +00:00
|
|
|
convert $graphicsdir/${name}.eps $builddir/${name}.jpg.tmp
|
2012-03-04 12:39:12 +00:00
|
|
|
|
2012-03-04 16:09:06 +00:00
|
|
|
abc2midi $filename -o $builddir/${name}.mid.tmp
|
|
|
|
timidity -Ow -o $builddir/${name}.wav.tmp $builddir/${name}.mid.tmp
|
|
|
|
lame --quiet $builddir/${name}.wav.tmp $builddir/${name}.mp3.tmp
|
|
|
|
|
|
|
|
mv $builddir/${name}.jpg.tmp $builddir/${name}.jpg
|
|
|
|
mv $builddir/${name}.mid.tmp $builddir/${name}.mid
|
|
|
|
mv $builddir/${name}.mp3.tmp $builddir/${name}.mp3
|
|
|
|
rm $builddir/${name}.wav.tmp
|
2012-03-04 12:39:12 +00:00
|
|
|
done
|
|
|
|
|