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

View File

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

View File

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