comparison makeAltoRecorderCFingering.sh @ 671:2f6e05d0aba0

Add experimental Alto Recorder (C Fingering) instrument. This should produce the bookes and website, but the website is not linked into the main page yet.
author Jim Hague <jim.hague@acm.org>
date Thu, 14 Sep 2017 10:41:46 +0100
parents makeHornInF.sh@ecc62b487e57
children ce5c7214f9aa
comparison
equal deleted inserted replaced
669:df13ed652209 671:2f6e05d0aba0
1 #!/bin/bash
2 #
3 # Transpose a book for alto recorder with C fingering.
4
5 if [ $# != 1 ]; then
6 echo "Usage: makeAltoRecorderCFingering.sh <book dir name>"
7 exit 1
8 fi
9
10 # Transpose up (return 0) if bottom note was < F (< C for recorder).
11 transposeup()
12 {
13 (($3 < 103))
14 }
15
16 dir=`pwd`
17
18 booke=$dir/$1
19 outdir=$dir/$1-AltoRecorderCFingering
20
21 mkdir -p $outdir
22
23 # Copy book component items.
24 cp $booke/*.txt $outdir
25
26 echo "Alto Recorder (C Fingering)" > $outdir/instrument.txt
27
28 find $booke -name "*.abc" | sort |
29 while read filename
30 do
31 name=`basename $filename .abc`
32 range=`./abcrange.py $filename`
33
34 # Transpose concert pitch down a fifth.
35 # If there are any notes below 'F' (recorder 'C'), transpose
36 # up a seventh instead.
37 transpose=-5
38 if transposeup $range; then
39 transpose=7
40 fi
41
42 # There's no point in having transposed chords. Remove from the
43 # abc before transposing. Some badly formed chord items can give
44 # erroneous output from abc2abc (like, strings of binary gibberish).
45 sed -e "s/\"[^\"]*\"//g" $filename > $outdir/$name.abc.tmp
46
47 # Transpose. By default abc2abc will report errors in the output,
48 # but this messes up output formatting so stop it.
49 abc2abc $outdir/$name.abc.tmp -e -t $transpose > $outdir/$name.abc
50 rm $outdir/$name.abc.tmp
51 done