diff --git a/makeCello.sh b/makeCello.sh index 6bfa670..5969d07 100755 --- a/makeCello.sh +++ b/makeCello.sh @@ -22,6 +22,13 @@ mkdir -p $outdir 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