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.
|
2017-10-13 17:19:06 +01:00
|
|
|
find $booke -maxdepth 1 -name "*.abc" |
|
2012-03-04 12:00:30 +00:00
|
|
|
while read filename
|
|
|
|
do
|
|
|
|
name=`basename $filename .abc`
|
2012-03-04 20:16:48 +00:00
|
|
|
|
2023-02-28 17:36:06 +00:00
|
|
|
# Make the tune graphic PDF.
|
2012-04-21 19:47:30 +01:00
|
|
|
abcm2ps -E -F singletune -O $graphicsdir/$name.eps $filename
|
2023-02-28 17:36:06 +00:00
|
|
|
epstopdf --outfile=$graphicsdir/$name.pdf $graphicsdir/${name}001.eps
|
|
|
|
rm $graphicsdir/${name}001.eps
|
2012-03-04 20:16:48 +00:00
|
|
|
|
|
|
|
# and make the first line graphic.
|
|
|
|
$dir/abcfirstline.py $filename > firstline.abc
|
2013-07-12 14:25:05 +01:00
|
|
|
abcm2ps -E -F firstline -O $graphicsdir/firstline-$name.eps firstline.abc
|
2023-02-28 17:36:06 +00:00
|
|
|
epstopdf --outfile=$graphicsdir/firstline-$name.pdf $graphicsdir/firstline-${name}001.eps
|
|
|
|
rm firstline.abc $graphicsdir/firstline-${name}001.eps
|
2012-03-04 12:00:30 +00:00
|
|
|
done
|
2017-10-13 15:44:15 +01:00
|
|
|
|
|
|
|
# And make any compact tune graphics.
|
|
|
|
if [ ! -d ${booke}/Compact ]; then
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2017-10-13 17:19:06 +01:00
|
|
|
find ${booke}/Compact -maxdepth 1 -name "*.abc" |
|
2017-10-13 15:44:15 +01:00
|
|
|
while read filename
|
|
|
|
do
|
|
|
|
name=`basename $filename .abc`
|
|
|
|
|
2023-02-28 17:36:06 +00:00
|
|
|
# Make the tune graphic PDF.
|
2017-10-13 15:44:15 +01:00
|
|
|
abcm2ps -E -F singletune -O $graphicsdir/compact-${name}.eps $filename
|
2023-02-28 17:36:06 +00:00
|
|
|
epstopdf --outfile=$graphicsdir/compact-${name}.pdf $graphicsdir/compact-${name}001.eps
|
|
|
|
rm $graphicsdir/compact-${name}001.eps
|
2017-10-13 15:44:15 +01:00
|
|
|
done
|