changeset 188:76f18e0a80bd

Have a go at being slightly more intelligent in the cello transposition.
author Jim Hague <jim.hague@acm.org>
date Mon, 04 Feb 2013 13:50:20 +0000 (2013-02-04)
parents 5c8510d14a00
children 9836536b67cc
files makeCello.sh
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/makeCello.sh	Mon Feb 04 13:49:45 2013 +0000
+++ b/makeCello.sh	Mon Feb 04 13:50:20 2013 +0000
@@ -22,6 +22,13 @@
 find $booke -name "*.abc" | sort |
     while read filename
     do
+        # Move down either one octave or two, depending on the range
+        # of the tune. If there are any notes below middle C, transpose
+        # down one octave. The default is to transpose down two octaves.
+        middle="d"
+        if grep -v "^[A-Z]:" $filename | sed -e 's/"[^"]*"//g' | grep -q "[A-Z],"; then
+            middle="D"
+        fi
         name=`basename $filename .abc`
-        sed -e "/^ *K:/s/$/ octave=-2/" $filename > $outdir/$name.abc
+        sed -e "/^ *K:/s/$/ middle=$middle/" $filename > $outdir/$name.abc
     done