Mercurial > dottes
comparison makeHornInF.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-HornInF | 19 outdir=$dir/$1-HornInF |
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 "Horn in F" > $outdir/instrument.txt | 26 echo "Horn in F" > $outdir/instrument.txt |
27 | 27 |
28 find $booke -depth 1 -name "*.abc" | sort | | 28 find $booke -name "*.abc" | sort | |
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 up a fifth. | 42 # Transpose concert pitch up a fifth. |
35 # If there are any notes above 'd' (Horn 'g'), transpose | 43 # If there are any notes above 'd' (Horn 'g'), transpose |
36 # down a seventh instead. | 44 # down a seventh instead. |
48 # but this messes up output formatting so stop it. Also force all | 56 # but this messes up output formatting so stop it. Also force all |
49 # output to be in treble clef; some lower tunes with the odd high | 57 # output to be in treble clef; some lower tunes with the odd high |
50 # note will otherwise appear in bass clef, which is not what this | 58 # note will otherwise appear in bass clef, which is not what this |
51 # crap horn player wants. | 59 # crap horn player wants. |
52 abc2abc $outdir/$name.abc.tmp -e -t $transpose | \ | 60 abc2abc $outdir/$name.abc.tmp -e -t $transpose | \ |
53 sed -e "/^ *K:/s/$/ clef=treble/" > $outdir/$name.abc | 61 sed -e "/^ *K:/s/$/ clef=treble/" > $outdir/$compact$name.abc |
54 rm $outdir/$name.abc.tmp | 62 rm $outdir/$name.abc.tmp |
55 done | 63 done |