Have a go at being slightly more intelligent in the cello transposition.

This commit is contained in:
Jim Hague 2013-02-04 13:50:20 +00:00
parent aa03da7583
commit dd0f097fe0
1 changed files with 8 additions and 1 deletions

View File

@ -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