Introduce mechanism for having different tune images for compact printed output.

Sort alternate .abc in subdir 'Compact' under the booke dir. Use that as
the graphic for A5 output, assuming it will be vertically more compact.
Use Bear Dance as an example, as it has commentary that currently
overflows an A5 landscape page.

For the moment, transposed Bookes don't transpose and so don't use Compact.
This commit is contained in:
Jim Hague 2017-10-13 15:44:15 +01:00
parent 7915144930
commit a5b76de484
13 changed files with 94 additions and 17 deletions

View File

@ -0,0 +1,10 @@
X:1
T:Bear Dance
M:2/4
L:1/16
Q:1/4=120
K:Em
"Em" B2 E2 E4| B2 E2 E3 F| G2G2F2G2|"D" A4G2A2| \
|"Em" B2B2 "D" A2A2|"Em" G2G2 "D" F4|"Em" E2G2 "D" F2D2|"Em" E4 E4:|
"Em" E2G2E2G2|"D" F2D2D4|"C" E2G2E2G2|"D" A4G2A2| \
|"Em" B2B2 "D" A2A2|"C" G2G2 "D" F4|"Em" E2G2 "D" F2D2|"Em" E4 E4:|

View File

@ -1 +1 @@
\showfirstline{$name}{$fulltitle}{$graphicsdir/firstline-$name}
\showfirstline{$name}{$fulltitle}{$firstlineimagefile}

View File

@ -1,5 +1,5 @@
\tunestart
\showtune{$name}{$title}{$subtitle}{$fulltitle}{$tradition}{$composer}{$parts}{$graphicsdir/$name}
\showtune{$name}{$title}{$subtitle}{$fulltitle}{$tradition}{$composer}{$parts}{$tuneimagefile}
$notes
$history

View File

@ -9,12 +9,20 @@ fi
makeABooke()
{
# Print graphics.
./makeGraphics.sh "$1"
# Normal graphics printed output.
./makeBookeTunePages.sh "$1"
./makeBooke.sh A4 "$1"
./makeBooke.sh Nook "$1"
# Compact graphics printed output.
./makeBookeTunePages.sh --use-compact "$1"
./makeBooke.sh A5 "$1"
./makeBooklet.sh "$1"
./makeBooke.sh Nook "$1"
# Web output.
./makeWebGraphics.sh "$1"
./makeWebAudio.sh "$1"
./makeWeb.sh "$1" "$1" "$2"
@ -22,12 +30,20 @@ makeABooke()
makeATransposedBooke()
{
# Print graphics.
./makeGraphics.sh "$1"
# Normal graphics printed output.
./makeBookeTunePages.sh "$1"
./makeBooke.sh A4 "$1"
./makeBooke.sh Nook "$1"
# Compact graphics printed output.
./makeBookeTunePages.sh --use-compact "$1"
./makeBooke.sh A5 "$1"
./makeBooklet.sh "$1"
./makeBooke.sh Nook "$1"
# Web output. Uses audio from main booke.
./makeWebGraphics.sh "$1"
./makeWeb.sh "$1" "$2" "$3"
}

View File

@ -25,7 +25,7 @@ cp $booke/*.txt $outdir
echo "Alto Recorder (C Fingering)" > $outdir/instrument.txt
find $booke -name "*.abc" | sort |
find $booke -depth 1 -name "*.abc" | sort |
while read filename
do
name=`basename $filename .abc`

View File

@ -17,6 +17,12 @@ dir=`pwd`
builddir=$dir/build
booketex=$builddir/dottes.tex
bookepdf=$builddir/dottes.pdf
usecompact=""
if [ "$1" = "--use-compact" ]; then
usecompact="yes"
shift
fi
papersize=$1
shift

View File

@ -8,8 +8,15 @@
# makeGraphics.sh to make these.
#
usecompact=""
if [ $# -gt 1 -a "$1" = "--use-compact" ]; then
usecompact="yes"
shift
fi
if [ $# != 1 ]; then
echo "Usage: makeBookeTunePages.sh <book dir name>"
echo "Usage: makeBookeTunePages.sh [--use-compact] <book dir name>"
exit 1
fi
@ -25,11 +32,28 @@ mkdir -p $builddir
rm -f $tunesoutput $indexoutput
# Now, for each tune, make the tune graphic and add it, inside a
# centre section, so the document. Then add a TOC entry.
find $booke -name "*.abc" | sort |
# Now, for each tune, build the tunes part and the first line sections
# of the document.
find $booke -depth 1 -name "*.abc" | sort |
while read filename
do
$dir/abctemplate.py --latex --value "graphicsdir=$graphicsdir" --template $dir/dottes.tex.tune $filename >> $tunesoutput
$dir/abctemplate.py --latex --value "graphicsdir=$graphicsdir" --template $dir/dottes.tex.firstline-tune $filename >> $indexoutput
name=`basename $filename .abc`
tuneimagefile="${graphicsdir}/${name}"
compacttuneimagefile="${graphicsdir}/compact-${name}"
firstlineimagefile="${graphicsdir}/firstline-${name}"
if [ "$usecompact" -a -f ${compacttuneimagefile}.pdf ]; then
tuneimagefile=$compacttuneimagefile
fi
$dir/abctemplate.py \
--latex \
--value "tuneimagefile=${tuneimagefile}" \
--template $dir/dottes.tex.tune \
$filename >> $tunesoutput
$dir/abctemplate.py \
--latex \
--value "firstlineimagefile=${firstlineimagefile}" \
--template $dir/dottes.tex.firstline-tune \
$filename >> $indexoutput
done

View File

@ -53,7 +53,7 @@ cp $booke/*.txt $outdir
echo "Cello" > $outdir/instrument.txt
find $booke -name "*.abc" | sort |
find $booke -depth 1 -name "*.abc" | sort |
while read filename
do
name=`basename $filename .abc`

View File

@ -17,7 +17,7 @@ graphicsdir=$dir/graphics/$1
mkdir -p $graphicsdir
# Now, for each tune, make the tune graphic.
find $booke -name "*.abc" | sort |
find $booke -depth 1 -name "*.abc" | sort |
while read filename
do
name=`basename $filename .abc`
@ -42,3 +42,24 @@ find $booke -name "*.abc" | sort |
pdfcrop $graphicsdir/firstline-$name-tocrop.pdf $graphicsdir/firstline-$name.pdf
rm $graphicsdir/firstline-$name-tocrop.pdf
done
# And make any compact tune graphics.
if [ ! -d ${booke}/Compact ]; then
exit
fi
find ${booke}/Compact -depth 1 -name "*.abc" | sort |
while read filename
do
name=`basename $filename .abc`
# Make the tune graphic.
abcm2ps -E -F singletune -O $graphicsdir/compact-${name}.eps $filename
# Make $name.eps so we can build with LaTeX.
mv $graphicsdir/compact-${name}001.eps $graphicsdir/compact-${name}.eps
# And make the corresponding PDF.
epstopdf --outfile=$graphicsdir/compact-${name}-tocrop.pdf $graphicsdir/compact-${name}.eps
# And crop it, so the graphic is as big as possible on the page.
pdfcrop $graphicsdir/compact-${name}-tocrop.pdf $graphicsdir/compact-${name}.pdf
rm $graphicsdir/compact-${name}-tocrop.pdf
done

View File

@ -25,7 +25,7 @@ cp $booke/*.txt $outdir
echo "Horn in F" > $outdir/instrument.txt
find $booke -name "*.abc" | sort |
find $booke -depth 1 -name "*.abc" | sort |
while read filename
do
name=`basename $filename .abc`

View File

@ -67,7 +67,7 @@ cp $1-*.pdf $webdir
# Now, for each tune, make the tune page.
rm -f $webdir/$tunelist
declare -a filenames
filenames=(`find $bookedir -name "*.abc" | sort`)
filenames=(`find $bookedir -depth 1 -name "*.abc" | sort`)
nofiles=${#filenames[@]}
for (( i=0; i < ${nofiles}; i++ ))
do

View File

@ -66,7 +66,7 @@ makeaudiofortempo()
}
# Generate audio files and slow speed (currently half speed) audio files.
find $booke -name "*.abc" | sort |
find $booke -depth 1 -name "*.abc" | sort |
while read filename
do
makeaudiofiles $filename

View File

@ -20,7 +20,7 @@ mkdir -p $builddir
# Now, for each tune, make the main tune and tune first line bitmaps.
# Do this to temp files and rename into place to make updates as
# atomic as possible.
find $booke -name "*.abc" | sort |
find $booke -depth 1 -name "*.abc" | sort |
while read filename
do
name=`basename $filename .abc`