Revise transposition scripts to make Compact.

This commit is contained in:
Jim Hague 2017-10-13 15:56:23 +01:00
parent a5b76de484
commit 06f4e5ea57
3 changed files with 33 additions and 9 deletions

View File

@ -18,17 +18,25 @@ dir=`pwd`
booke=$dir/$1
outdir=$dir/$1-AltoRecorderCFingering
mkdir -p $outdir
mkdir -p $outdir/Compact
# Copy book component items.
cp $booke/*.txt $outdir
echo "Alto Recorder (C Fingering)" > $outdir/instrument.txt
find $booke -depth 1 -name "*.abc" | sort |
find $booke -name "*.abc" |
while read filename
do
name=`basename $filename .abc`
dir=`dirname $filename`
basedir=`basename $dir`
compact=""
if [ "$basedir" = "Compact" ]; then
compact="Compact/"
fi
range=`./abcrange.py $filename`
# Transpose concert pitch down a fifth.
@ -46,6 +54,6 @@ find $booke -depth 1 -name "*.abc" | sort |
# Transpose. By default abc2abc will report errors in the output,
# but this messes up output formatting so stop it.
abc2abc $outdir/$name.abc.tmp -e -t $transpose > $outdir/$name.abc
abc2abc $outdir/$name.abc.tmp -e -t $transpose > $outdir/$compact$name.abc
rm $outdir/$name.abc.tmp
done

View File

@ -46,17 +46,25 @@ dir=`pwd`
booke=$dir/$1
outdir=$dir/$1-Cello
mkdir -p $outdir
mkdir -p $outdir/Compact
# Copy book component items.
cp $booke/*.txt $outdir
echo "Cello" > $outdir/instrument.txt
find $booke -depth 1 -name "*.abc" | sort |
find $booke -name "*.abc" | sort |
while read filename
do
name=`basename $filename .abc`
dir=`dirname $filename`
basedir=`basename $dir`
compact=""
if [ "$basedir" = "Compact" ]; then
compact="Compact/"
fi
range=`./abcrange.py $filename`
# Move down either one octave or two, depending on the range
@ -66,5 +74,5 @@ find $booke -depth 1 -name "*.abc" | sort |
middle="d"
fi
sed -e "/^ *K:/s/$/ clef=bass middle=$middle/" $filename > $outdir/$name.abc
sed -e "/^ *K:/s/$/ clef=bass middle=$middle/" $filename > $outdir/$compact$name.abc
done

View File

@ -18,17 +18,25 @@ dir=`pwd`
booke=$dir/$1
outdir=$dir/$1-HornInF
mkdir -p $outdir
mkdir -p $outdir/Compact
# Copy book component items.
cp $booke/*.txt $outdir
echo "Horn in F" > $outdir/instrument.txt
find $booke -depth 1 -name "*.abc" | sort |
find $booke -name "*.abc" | sort |
while read filename
do
name=`basename $filename .abc`
dir=`dirname $filename`
basedir=`basename $dir`
compact=""
if [ "$basedir" = "Compact" ]; then
compact="Compact/"
fi
range=`./abcrange.py $filename`
# Transpose concert pitch up a fifth.
@ -50,6 +58,6 @@ find $booke -depth 1 -name "*.abc" | sort |
# note will otherwise appear in bass clef, which is not what this
# crap horn player wants.
abc2abc $outdir/$name.abc.tmp -e -t $transpose | \
sed -e "/^ *K:/s/$/ clef=treble/" > $outdir/$name.abc
sed -e "/^ *K:/s/$/ clef=treble/" > $outdir/$compact$name.abc
rm $outdir/$name.abc.tmp
done