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 \tunestart
\showtune{$name}{$title}{$subtitle}{$fulltitle}{$tradition}{$composer}{$parts}{$graphicsdir/$name} \showtune{$name}{$title}{$subtitle}{$fulltitle}{$tradition}{$composer}{$parts}{$tuneimagefile}
$notes $notes
$history $history

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -17,7 +17,7 @@ graphicsdir=$dir/graphics/$1
mkdir -p $graphicsdir mkdir -p $graphicsdir
# Now, for each tune, make the tune graphic. # Now, for each tune, make the tune graphic.
find $booke -name "*.abc" | sort | find $booke -depth 1 -name "*.abc" | sort |
while read filename while read filename
do do
name=`basename $filename .abc` name=`basename $filename .abc`
@ -42,3 +42,24 @@ find $booke -name "*.abc" | sort |
pdfcrop $graphicsdir/firstline-$name-tocrop.pdf $graphicsdir/firstline-$name.pdf pdfcrop $graphicsdir/firstline-$name-tocrop.pdf $graphicsdir/firstline-$name.pdf
rm $graphicsdir/firstline-$name-tocrop.pdf rm $graphicsdir/firstline-$name-tocrop.pdf
done 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 echo "Horn in F" > $outdir/instrument.txt
find $booke -name "*.abc" | sort | find $booke -depth 1 -name "*.abc" | sort |
while read filename while read filename
do do
name=`basename $filename .abc` name=`basename $filename .abc`

View File

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

View File

@ -66,7 +66,7 @@ makeaudiofortempo()
} }
# Generate audio files and slow speed (currently half speed) audio files. # 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 while read filename
do do
makeaudiofiles $filename makeaudiofiles $filename

View File

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