comparison makeWeb.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 a8a46fd79d5c
children 1e4443d58177
comparison
equal deleted inserted replaced
222:f2c8ca48b8a4 223:0ef955669a9a
2 # 2 #
3 # Build the website. The common items and the web items are assumed 3 # Build the website. The common items and the web items are assumed
4 # to be already built. 4 # to be already built.
5 # 5 #
6 6
7 if [ $# -lt 1 -o $# -gt 2 ]; then 7 if [ $# -lt 2 -o $# -gt 3 ]; then
8 echo "Usage: makeWeb.sh <book dir name> [<instrument name>]" 8 echo "Usage: makeWeb.sh <book dir name> <master book dir name> [<instrument name>]"
9 exit 1 9 exit 1
10 fi 10 fi
11 11
12 dir=`pwd` 12 dir=`pwd`
13 13
14 bookedir=$dir/$1 14 bookedir=$dir/$1
15 webdir=$dir/web/$1 15 webdir=$dir/web/$1
16 graphicsdir=$dir/graphics/$1 16 graphicsdir=$dir/graphics/$1
17 output=index.html 17 output=index.html
18 title=$1
19 booke=$1 18 booke=$1
19 masterbooke=$2
20 title=$booke
21 instrument=$3
20 22
21 buildno=`cat buildno.txt` 23 buildno=`cat buildno.txt`
22 subtitle= 24 subtitle=
23 intro= 25 intro=
24 if [ -r $bookedir/subtitle.txt ]; then 26 if [ -r $bookedir/subtitle.txt ]; then
26 fi 28 fi
27 if [ -r $bookedir/intro.txt ]; then 29 if [ -r $bookedir/intro.txt ]; then
28 intro=`cat $bookedir/intro.txt` 30 intro=`cat $bookedir/intro.txt`
29 fi 31 fi
30 32
31 if [ -n "$2" ]; then 33 if [ -n "$instrument" ]; then
32 # Remove any transposition tag from title. 34 # Remove any transposition tag from title.
33 title="${title/-*/} ($2)" 35 title="${title} ($instrument)"
34 subtitle="${subtitle} ($2)" 36 subtitle="${subtitle} ($instrument)"
35 fi 37 fi
36 38
37 mkdir -p $webdir 39 mkdir -p $webdir
38 40
39 sed -e "s/@BUILD@/$buildno/" -e "s/@SUBTITLE@/$subtitle/" \ 41 sed -e "s/@BUILD@/$buildno/" -e "s/@SUBTITLE@/$subtitle/" \
62 cp $filename $webdir 64 cp $filename $webdir
63 65
64 # Generate the tune web page. 66 # Generate the tune web page.
65 tunepage=${name}.html 67 tunepage=${name}.html
66 68
69 # If the title contains HTML character entities, escape
70 # initial '&' in the title - it means things to sed.
67 sed -e "s/@TITLE@/${title//&/\&}/" \ 71 sed -e "s/@TITLE@/${title//&/\&}/" \
72 -e "s/@MASTERBOOKE@/${masterbooke}/" \
68 -e "s/@TUNE@/${name}/" dottes.html.tune > $webdir/$tunepage 73 -e "s/@TUNE@/${name}/" dottes.html.tune > $webdir/$tunepage
69 74
70 sed -e "s/@TITLE@/${title//&/\&}/" \ 75 sed -e "s/@TITLE@/${title//&/\&}/" \
71 -e "s/@TUNE@/${name}/" dottes.html.tuneindex >> $webdir/$output 76 -e "s/@TUNE@/${name}/" dottes.html.tuneindex >> $webdir/$output
72 done 77 done