Add Alto Sax transposition.
authorJim Hague <jim.hague@acm.org>
Mon, 03 Feb 2020 10:49:27 +0000
changeset 1019 ce13e23259b1
parent 1017 c5a8d5d81eb9
child 1020 af4722b813a5
Add Alto Sax transposition.
makeAll.sh
makeAltoSax.sh
web/index.html
--- a/makeAll.sh	Fri Jan 17 20:01:27 2020 +0000
+++ b/makeAll.sh	Mon Feb 03 10:49:27 2020 +0000
@@ -66,6 +66,9 @@
 
     ./makeAltoRecorderCFingering.sh $1
     makeATransposedBooke $1-AltoRecorderCFingering $1 "alto recorder, C fingering"
+
+    ./makeAltoSax.sh $1
+    makeATransposedBooke $1-AltoSax $1 "alto saxophone"
 }
 
 makeABumperBooke()
@@ -98,12 +101,14 @@
     local cellobumper
     local hornbumber
     local recorderbumper
+    local saxbumper
 
     for booke in "$@"
     do
         cellobumper+=("${booke}-Cello")
         hornbumper+=("${booke}-HornInF")
         recorderbumper+=("${booke}-AltoRecorderCFingering")
+        saxbumper+=("${booke}-AltoSax")
     done
     makeABumperBooke "${cellobumper[@]}"
     for f in Bumper*.pdf
@@ -123,6 +128,12 @@
         t=$(echo $f | sed -e "s/.pdf/-AltoRecorderCFingering.pdf/")
         mv $f ./web/$t
     done
+    makeABumperBooke "${saxbumper[@]}"
+    for f in Bumper*.pdf
+    do
+        t=$(echo $f | sed -e "s/.pdf/-AltoSax.pdf/")
+        mv $f ./web/$t
+    done
 }
 
 declare buildBookes
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/makeAltoSax.sh	Mon Feb 03 10:49:27 2020 +0000
@@ -0,0 +1,48 @@
+#!/bin/bash
+#
+# Transpose a book for alto saxophone
+
+if [ $# != 1 ]; then
+    echo "Usage: makeAltoSax.sh <book dir name>"
+    exit 1
+fi
+
+dir=`pwd`
+
+booke=$dir/$1
+outdir=$dir/$1-AltoSax
+
+mkdir -p $outdir/Compact
+
+# Copy book component items.
+cp $booke/*.txt $booke/*.md $booke/image.jpg $outdir
+
+echo "Alto Saxophone" > $outdir/instrument.txt
+
+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 minor third.
+        transpose=-3
+
+        # There's no point in having transposed chords. Remove from the
+        # abc before transposing. Some badly formed chord items can give
+        # erroneous output from abc2abc (like, strings of binary gibberish).
+        sed -e "s/\"[^\"]*\"//g" $filename > $outdir/$name.abc.tmp
+
+        # 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/$compact$name.abc
+        rm $outdir/$name.abc.tmp
+    done
--- a/web/index.html	Fri Jan 17 20:01:27 2020 +0000
+++ b/web/index.html	Mon Feb 03 10:49:27 2020 +0000
@@ -134,6 +134,24 @@
           </div>
         </div>
       </div>
+      <div class="dottes-transpose-container">
+        <div class="dottes-transpose-instrument">
+          <div class="dottes-transpose-instrument-item dottes-transpose-instrument-name">
+            <h1>Alto saxophone</h1>
+          </div>
+          <div class="dottes-transpose-instrument-item dottes-transpose-how">
+            <p>Transpose down a third. As with horns, good sax players
+              can do this in their heads anyway.</p>
+          </div>
+          <div class="dottes-transpose-instrument-item dottes-transpose-tune-types">
+            <ul class="tune-type-list">
+              <li><a href="Morris-AltoSax">Morris</a></li>
+              <li><a href="Session-AltoSax">Session</a></li>
+              <li><a href="Library-AltoSax">Library</a></li>
+            </ul>
+          </div>
+        </div>
+      </div>
     </div>
 
     <div class="dottes-body">