2012-03-04 12:00:30 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Make the tune graphics, EPS, PDF required by web and book into
|
|
|
|
# graphics/<book>.
|
|
|
|
#
|
|
|
|
|
|
|
|
if [ $# != 1 ]; then
|
|
|
|
echo "Usage: makeGraphics.sh <book dir name>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
dir=`pwd`
|
|
|
|
|
|
|
|
booke=$dir/$1
|
|
|
|
graphicsdir=$dir/graphics/$1
|
|
|
|
|
|
|
|
mkdir -p $graphicsdir
|
|
|
|
|
|
|
|
# Now, for each tune, make the tune graphic.
|
|
|
|
find $booke -name "*.abc" | sort |
|
|
|
|
while read filename
|
|
|
|
do
|
|
|
|
name=`basename $filename .abc`
|
2012-03-04 20:16:48 +00:00
|
|
|
|
|
|
|
# Make the tune graphic.
|
2012-03-04 12:00:30 +00:00
|
|
|
abcm2ps -j0 +c -n -E -O $graphicsdir/$name.eps $filename
|
|
|
|
# Make $name.eps so we can build with LaTeX.
|
|
|
|
mv $graphicsdir/${name}001.eps $graphicsdir/${name}.eps
|
|
|
|
# And make the corresponding PDF for pdflatex.
|
|
|
|
epstopdf --outfile=$graphicsdir/$name.pdf $graphicsdir/${name}.eps
|
2012-03-04 20:16:48 +00:00
|
|
|
|
|
|
|
# and make the first line graphic.
|
|
|
|
$dir/abcfirstline.py $filename > firstline.abc
|
|
|
|
abcm2ps +c -M +Q -E -O $graphicsdir/firstline-$name.eps firstline.abc
|
|
|
|
mv $graphicsdir/firstline-${name}001.eps $graphicsdir/firstline-${name}.eps
|
|
|
|
rm firstline.abc
|
|
|
|
epstopdf --outfile=$graphicsdir/firstline-$name.pdf $graphicsdir/firstline-${name}.eps
|
2012-03-04 12:00:30 +00:00
|
|
|
done
|