comparison makeCello.sh @ 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
parents cc2d4925f280
children 8f352063f277
comparison
equal deleted inserted replaced
187:5c8510d14a00 188:76f18e0a80bd
20 mkdir -p $outdir 20 mkdir -p $outdir
21 21
22 find $booke -name "*.abc" | sort | 22 find $booke -name "*.abc" | sort |
23 while read filename 23 while read filename
24 do 24 do
25 # Move down either one octave or two, depending on the range
26 # of the tune. If there are any notes below middle C, transpose
27 # down one octave. The default is to transpose down two octaves.
28 middle="d"
29 if grep -v "^[A-Z]:" $filename | sed -e 's/"[^"]*"//g' | grep -q "[A-Z],"; then
30 middle="D"
31 fi
25 name=`basename $filename .abc` 32 name=`basename $filename .abc`
26 sed -e "/^ *K:/s/$/ octave=-2/" $filename > $outdir/$name.abc 33 sed -e "/^ *K:/s/$/ middle=$middle/" $filename > $outdir/$name.abc
27 done 34 done