From dd0f097fe07a6e2f06892ce2c81a9b576252b737 Mon Sep 17 00:00:00 2001 From: Jim Hague Date: Mon, 4 Feb 2013 13:50:20 +0000 Subject: [PATCH] Have a go at being slightly more intelligent in the cello transposition. --- makeCello.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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