changeset 749:06fec6764661

Revise transposition scripts to make Compact.
author Jim Hague <jim.hague@acm.org>
date Fri, 13 Oct 2017 15:56:23 +0100
parents ce5c7214f9aa
children c2460aa9b4eb
files makeAltoRecorderCFingering.sh makeCello.sh makeHornInF.sh
diffstat 3 files changed, 33 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/makeAltoRecorderCFingering.sh	Fri Oct 13 15:44:15 2017 +0100
+++ b/makeAltoRecorderCFingering.sh	Fri Oct 13 15:56:23 2017 +0100
@@ -18,17 +18,25 @@
 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 @@
 
         # 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
--- a/makeCello.sh	Fri Oct 13 15:44:15 2017 +0100
+++ b/makeCello.sh	Fri Oct 13 15:56:23 2017 +0100
@@ -46,17 +46,25 @@
 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 @@
             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
--- a/makeHornInF.sh	Fri Oct 13 15:44:15 2017 +0100
+++ b/makeHornInF.sh	Fri Oct 13 15:56:23 2017 +0100
@@ -18,17 +18,25 @@
 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 @@
         # 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