Mercurial > dottes
comparison makeAltoRecorderCFingering.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 |
---|---|
16 dir=`pwd` | 16 dir=`pwd` |
17 | 17 |
18 booke=$dir/$1 | 18 booke=$dir/$1 |
19 outdir=$dir/$1-AltoRecorderCFingering | 19 outdir=$dir/$1-AltoRecorderCFingering |
20 | 20 |
21 mkdir -p $outdir | 21 mkdir -p $outdir/Compact |
22 | 22 |
23 # Copy book component items. | 23 # Copy book component items. |
24 cp $booke/*.txt $outdir | 24 cp $booke/*.txt $outdir |
25 | 25 |
26 echo "Alto Recorder (C Fingering)" > $outdir/instrument.txt | 26 echo "Alto Recorder (C Fingering)" > $outdir/instrument.txt |
27 | 27 |
28 find $booke -depth 1 -name "*.abc" | sort | | 28 find $booke -name "*.abc" | |
29 while read filename | 29 while read filename |
30 do | 30 do |
31 name=`basename $filename .abc` | 31 name=`basename $filename .abc` |
32 | |
33 dir=`dirname $filename` | |
34 basedir=`basename $dir` | |
35 compact="" | |
36 if [ "$basedir" = "Compact" ]; then | |
37 compact="Compact/" | |
38 fi | |
39 | |
32 range=`./abcrange.py $filename` | 40 range=`./abcrange.py $filename` |
33 | 41 |
34 # Transpose concert pitch down a fifth. | 42 # Transpose concert pitch down a fifth. |
35 # If there are any notes below 'F' (recorder 'C'), transpose | 43 # If there are any notes below 'F' (recorder 'C'), transpose |
36 # up a seventh instead. | 44 # up a seventh instead. |
44 # erroneous output from abc2abc (like, strings of binary gibberish). | 52 # erroneous output from abc2abc (like, strings of binary gibberish). |
45 sed -e "s/\"[^\"]*\"//g" $filename > $outdir/$name.abc.tmp | 53 sed -e "s/\"[^\"]*\"//g" $filename > $outdir/$name.abc.tmp |
46 | 54 |
47 # Transpose. By default abc2abc will report errors in the output, | 55 # Transpose. By default abc2abc will report errors in the output, |
48 # but this messes up output formatting so stop it. | 56 # but this messes up output formatting so stop it. |
49 abc2abc $outdir/$name.abc.tmp -e -t $transpose > $outdir/$name.abc | 57 abc2abc $outdir/$name.abc.tmp -e -t $transpose > $outdir/$compact$name.abc |
50 rm $outdir/$name.abc.tmp | 58 rm $outdir/$name.abc.tmp |
51 done | 59 done |