Mercurial > dottes
annotate makeWebGraphics.sh @ 223:0ef955669a9a
Make transposed tunes use the original audio.
The aim of MIDI and MP3 is to allow the user to hear what a tune sounds
like. For transposed bookes, I think this should be reused from the main
booke page, because hearing it at the transposed pitch isn't a major help.
And in fact given the way cello transposition is done, the sound won't
be transposed anyway. And Jane hasn't complained.
This will speed up building the bookes by removing audio generation,
the slowest process, from the transposed bookes.
author | Jim Hague <jim.hague@acm.org> |
---|---|
date | Fri, 22 Feb 2013 01:09:37 +0000 |
parents | makeWebItems.sh@8f352063f277 |
children | 77372a0166fe |
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 # |
223
0ef955669a9a
Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents:
197
diff
changeset
|
3 # Make graphics required for the website but not for the book. |
43
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 |
223
0ef955669a9a
Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents:
197
diff
changeset
|
8 echo "Usage: makeWebGraphics.sh <book dir name>" |
43
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 |
223
0ef955669a9a
Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents:
197
diff
changeset
|
20 # Now, for each tune, make the main tune and tune first line bitmaps. |
0ef955669a9a
Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents:
197
diff
changeset
|
21 # Do this to temp files and rename into place to make updates as |
0ef955669a9a
Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents:
197
diff
changeset
|
22 # atomic as possible. |
43
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
23 find $booke -name "*.abc" | sort | |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
24 while read filename |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
25 do |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
26 name=`basename $filename .abc` |
61
3464d5154f49
Fix temp file name to convert.
Jim Hague <jim.hague@acm.org>
parents:
48
diff
changeset
|
27 tmpname=${name}.tmp |
191
2fa3c89a0a8a
Change web to use PNG rather than JPG.
Jim Hague <jim.hague@acm.org>
parents:
62
diff
changeset
|
28 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
|
29 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
|
30 |
191
2fa3c89a0a8a
Change web to use PNG rather than JPG.
Jim Hague <jim.hague@acm.org>
parents:
62
diff
changeset
|
31 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
|
32 mv $builddir/firstline-${tmpname}.png $builddir/firstline-${name}.png |
43
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
33 done |