annotate makeCello.sh @ 166:7e5c8115a3b7

Merge local changes.
author Jim Hague <jim.hague@laicatc.com>
date Wed, 28 Nov 2012 22:47:07 +0000
parents cc2d4925f280
children 76f18e0a80bd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
155
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
1 #!/bin/bash
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
2 #
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
3 # Copy a booke to cello-friendly form. Bass clef, transposed down 2 octaves.
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
4 #
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
5 # It would be easier to do with transpose in dottes.fmt, but I can't get
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
6 # that to work properly for a 2 octave downward transpose.
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
7 #
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
8 # This relies on abcm2ps >= 6.0 but does not check for it.
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
9
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
10 if [ $# != 1 ]; then
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
11 echo "Usage: makeCello.sh <book dir name>"
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
12 exit 1
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
13 fi
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
14
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
15 dir=`pwd`
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
16
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
17 booke=$dir/$1
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
18 outdir=$dir/$1-Cello
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
19
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
20 mkdir -p $outdir
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
21
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
22 find $booke -name "*.abc" | sort |
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
23 while read filename
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
24 do
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
25 name=`basename $filename .abc`
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
26 sed -e "/^ *K:/s/$/ octave=-2/" $filename > $outdir/$name.abc
cc2d4925f280 Produce a cello-friendly Booke.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
27 done