comparison makeCello.sh @ 749:06fec6764661

Revise transposition scripts to make Compact.
author Jim Hague <jim.hague@acm.org>
date Fri, 13 Oct 2017 15:56:23 +0100
parents ce5c7214f9aa
children 1a838d8dca2a
comparison
equal deleted inserted replaced
748:ce5c7214f9aa 749:06fec6764661
44 dir=`pwd` 44 dir=`pwd`
45 45
46 booke=$dir/$1 46 booke=$dir/$1
47 outdir=$dir/$1-Cello 47 outdir=$dir/$1-Cello
48 48
49 mkdir -p $outdir 49 mkdir -p $outdir/Compact
50 50
51 # Copy book component items. 51 # Copy book component items.
52 cp $booke/*.txt $outdir 52 cp $booke/*.txt $outdir
53 53
54 echo "Cello" > $outdir/instrument.txt 54 echo "Cello" > $outdir/instrument.txt
55 55
56 find $booke -depth 1 -name "*.abc" | sort | 56 find $booke -name "*.abc" | sort |
57 while read filename 57 while read filename
58 do 58 do
59 name=`basename $filename .abc` 59 name=`basename $filename .abc`
60
61 dir=`dirname $filename`
62 basedir=`basename $dir`
63 compact=""
64 if [ "$basedir" = "Compact" ]; then
65 compact="Compact/"
66 fi
67
60 range=`./abcrange.py $filename` 68 range=`./abcrange.py $filename`
61 69
62 # Move down either one octave or two, depending on the range 70 # Move down either one octave or two, depending on the range
63 # of the tune. 71 # of the tune.
64 middle="D" 72 middle="D"
65 if transposedowntwo $range; then 73 if transposedowntwo $range; then
66 middle="d" 74 middle="d"
67 fi 75 fi
68 76
69 sed -e "/^ *K:/s/$/ clef=bass middle=$middle/" $filename > $outdir/$name.abc 77 sed -e "/^ *K:/s/$/ clef=bass middle=$middle/" $filename > $outdir/$compact$name.abc
70 done 78 done