Mercurial > dottes
annotate makeWebItems.sh @ 218:1a9d937b7765
Force Horn in F output to be in treble clef.
Some lower tunes with the odd high note ended up in bass clef. This crap horn
player doesn't do bass clef.
author | Jim Hague <jim.hague@laicatc.com> |
---|---|
date | Thu, 21 Feb 2013 07:23:49 +0000 |
parents | 8f352063f277 |
children |
rev | line source |
---|---|
43
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
1 #!/bin/bash |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
2 # |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
3 # Make items required for the website but not for the book. |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
4 # They go into web/<book>. |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
5 # |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
6 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
7 if [ $# != 1 ]; then |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
8 echo "Usage: makeWebItems.sh <book dir name>" |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
9 exit 1 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
10 fi |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
11 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
12 dir=`pwd` |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
13 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
14 booke=$dir/$1 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
15 builddir=$dir/web/$1 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
16 graphicsdir=$dir/graphics/$1 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
17 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
18 mkdir -p $builddir |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
19 |
48
6f4667d1372d
Try to make web item updates atomic-ish.
Jim Hague <jim.hague@laicatc.com>
parents:
43
diff
changeset
|
20 # Now, for each tune, make the tune JPG and sound. Do this to temp |
6f4667d1372d
Try to make web item updates atomic-ish.
Jim Hague <jim.hague@laicatc.com>
parents:
43
diff
changeset
|
21 # files and rename into place to make updates as atomic as possible. |
43
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
22 find $booke -name "*.abc" | sort | |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
23 while read filename |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
24 do |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
25 name=`basename $filename .abc` |
61
3464d5154f49
Fix temp file name to convert.
Jim Hague <jim.hague@acm.org>
parents:
48
diff
changeset
|
26 tmpname=${name}.tmp |
191
2fa3c89a0a8a
Change web to use PNG rather than JPG.
Jim Hague <jim.hague@acm.org>
parents:
62
diff
changeset
|
27 convert -density 96 $graphicsdir/${name}.eps $builddir/${tmpname}.png |
197
8f352063f277
Finish first version of newly tarted up website.
Jim Hague <jim.hague@acm.org>
parents:
191
diff
changeset
|
28 convert -density 96 $graphicsdir/firstline-${name}.eps $builddir/firstline-${tmpname}.png |
43
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
29 |
61
3464d5154f49
Fix temp file name to convert.
Jim Hague <jim.hague@acm.org>
parents:
48
diff
changeset
|
30 abc2midi $filename -o $builddir/${tmpname}.mid |
3464d5154f49
Fix temp file name to convert.
Jim Hague <jim.hague@acm.org>
parents:
48
diff
changeset
|
31 timidity -Ow -o $builddir/${tmpname}.wav $builddir/${tmpname}.mid |
3464d5154f49
Fix temp file name to convert.
Jim Hague <jim.hague@acm.org>
parents:
48
diff
changeset
|
32 lame --quiet $builddir/${tmpname}.wav $builddir/${tmpname}.mp3 |
48
6f4667d1372d
Try to make web item updates atomic-ish.
Jim Hague <jim.hague@laicatc.com>
parents:
43
diff
changeset
|
33 |
191
2fa3c89a0a8a
Change web to use PNG rather than JPG.
Jim Hague <jim.hague@acm.org>
parents:
62
diff
changeset
|
34 mv $builddir/${tmpname}.png $builddir/${name}.png |
197
8f352063f277
Finish first version of newly tarted up website.
Jim Hague <jim.hague@acm.org>
parents:
191
diff
changeset
|
35 mv $builddir/firstline-${tmpname}.png $builddir/firstline-${name}.png |
61
3464d5154f49
Fix temp file name to convert.
Jim Hague <jim.hague@acm.org>
parents:
48
diff
changeset
|
36 mv $builddir/${tmpname}.mid $builddir/${name}.mid |
3464d5154f49
Fix temp file name to convert.
Jim Hague <jim.hague@acm.org>
parents:
48
diff
changeset
|
37 mv $builddir/${tmpname}.mp3 $builddir/${name}.mp3 |
3464d5154f49
Fix temp file name to convert.
Jim Hague <jim.hague@acm.org>
parents:
48
diff
changeset
|
38 rm $builddir/${tmpname}.wav |
43
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
39 done |