forked from CryHavoc/dottes
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.
This commit is contained in:
parent
9c19ccc96d
commit
36bd2926b5
|
@ -25,9 +25,9 @@
|
||||||
<li><a class="dottes-link-tune dottes-pdf"
|
<li><a class="dottes-link-tune dottes-pdf"
|
||||||
href="@TUNE@.pdf">PDF</a></li>
|
href="@TUNE@.pdf">PDF</a></li>
|
||||||
<li><a class="dottes-link-tune dottes-midi"
|
<li><a class="dottes-link-tune dottes-midi"
|
||||||
href="@TUNE@.mid">MIDI</a></li>
|
href="../@MASTERBOOKE@/@TUNE@.mid">MIDI</a></li>
|
||||||
<li><a class="dottes-link-tune dottes-mp3"
|
<li><a class="dottes-link-tune dottes-mp3"
|
||||||
href="@TUNE@.mp3">MP3</a></li>
|
href="../@MASTERBOOKE@/@TUNE@.mp3">MP3</a></li>
|
||||||
<li><a class="dottes-link-tune dottes-abc"
|
<li><a class="dottes-link-tune dottes-abc"
|
||||||
href="@TUNE@.abc">ABC</a></li>
|
href="@TUNE@.abc">ABC</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
18
makeAll.sh
18
makeAll.sh
|
@ -12,14 +12,24 @@ makeABooke()
|
||||||
./makeGraphics.sh "$1"
|
./makeGraphics.sh "$1"
|
||||||
./makeBookeA5.sh "$1"
|
./makeBookeA5.sh "$1"
|
||||||
./makeBookeA4.sh "$1"
|
./makeBookeA4.sh "$1"
|
||||||
./makeWebItems.sh "$1"
|
./makeWebGraphics.sh "$1"
|
||||||
./makeWeb.sh "$1" "$2"
|
./makeWebAudio.sh "$1"
|
||||||
|
./makeWeb.sh "$1" "$1" "$2"
|
||||||
|
}
|
||||||
|
|
||||||
|
makeATransposedBooke()
|
||||||
|
{
|
||||||
|
./makeGraphics.sh "$1"
|
||||||
|
./makeBookeA5.sh "$1"
|
||||||
|
./makeBookeA4.sh "$1"
|
||||||
|
./makeWebGraphics.sh "$1"
|
||||||
|
./makeWeb.sh "$1" "$2" "$3"
|
||||||
}
|
}
|
||||||
|
|
||||||
makeABooke $1
|
makeABooke $1
|
||||||
|
|
||||||
./makeCello.sh $1
|
./makeCello.sh $1
|
||||||
makeABooke $1-Cello cello
|
makeATransposedBooke $1-Cello $1 cello
|
||||||
|
|
||||||
./makeHornInF.sh $1
|
./makeHornInF.sh $1
|
||||||
makeABooke $1-HornInF "horn in F"
|
makeATransposedBooke $1-HornInF $1 "horn in F"
|
||||||
|
|
17
makeWeb.sh
17
makeWeb.sh
|
@ -4,8 +4,8 @@
|
||||||
# to be already built.
|
# to be already built.
|
||||||
#
|
#
|
||||||
|
|
||||||
if [ $# -lt 1 -o $# -gt 2 ]; then
|
if [ $# -lt 2 -o $# -gt 3 ]; then
|
||||||
echo "Usage: makeWeb.sh <book dir name> [<instrument name>]"
|
echo "Usage: makeWeb.sh <book dir name> <master book dir name> [<instrument name>]"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -15,8 +15,10 @@ bookedir=$dir/$1
|
||||||
webdir=$dir/web/$1
|
webdir=$dir/web/$1
|
||||||
graphicsdir=$dir/graphics/$1
|
graphicsdir=$dir/graphics/$1
|
||||||
output=index.html
|
output=index.html
|
||||||
title=$1
|
|
||||||
booke=$1
|
booke=$1
|
||||||
|
masterbooke=$2
|
||||||
|
title=$booke
|
||||||
|
instrument=$3
|
||||||
|
|
||||||
buildno=`cat buildno.txt`
|
buildno=`cat buildno.txt`
|
||||||
subtitle=
|
subtitle=
|
||||||
|
@ -28,10 +30,10 @@ if [ -r $bookedir/intro.txt ]; then
|
||||||
intro=`cat $bookedir/intro.txt`
|
intro=`cat $bookedir/intro.txt`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$2" ]; then
|
if [ -n "$instrument" ]; then
|
||||||
# Remove any transposition tag from title.
|
# Remove any transposition tag from title.
|
||||||
title="${title/-*/} ($2)"
|
title="${title} ($instrument)"
|
||||||
subtitle="${subtitle} ($2)"
|
subtitle="${subtitle} ($instrument)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p $webdir
|
mkdir -p $webdir
|
||||||
|
@ -64,7 +66,10 @@ find $bookedir -name "*.abc" | sort |
|
||||||
# Generate the tune web page.
|
# Generate the tune web page.
|
||||||
tunepage=${name}.html
|
tunepage=${name}.html
|
||||||
|
|
||||||
|
# If the title contains HTML character entities, escape
|
||||||
|
# initial '&' in the title - it means things to sed.
|
||||||
sed -e "s/@TITLE@/${title//&/\&}/" \
|
sed -e "s/@TITLE@/${title//&/\&}/" \
|
||||||
|
-e "s/@MASTERBOOKE@/${masterbooke}/" \
|
||||||
-e "s/@TUNE@/${name}/" dottes.html.tune > $webdir/$tunepage
|
-e "s/@TUNE@/${name}/" dottes.html.tune > $webdir/$tunepage
|
||||||
|
|
||||||
sed -e "s/@TITLE@/${title//&/\&}/" \
|
sed -e "s/@TITLE@/${title//&/\&}/" \
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Make items required for the website but not for the book.
|
# Make audio required for the website but not for the book.
|
||||||
# They go into web/<book>.
|
# They go into web/<book>.
|
||||||
#
|
#
|
||||||
|
|
||||||
if [ $# != 1 ]; then
|
if [ $# != 1 ]; then
|
||||||
echo "Usage: makeWebItems.sh <book dir name>"
|
echo "Usage: makeWebAudio.sh <book dir name>"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -13,26 +13,21 @@ dir=`pwd`
|
||||||
|
|
||||||
booke=$dir/$1
|
booke=$dir/$1
|
||||||
builddir=$dir/web/$1
|
builddir=$dir/web/$1
|
||||||
graphicsdir=$dir/graphics/$1
|
|
||||||
|
|
||||||
mkdir -p $builddir
|
mkdir -p $builddir
|
||||||
|
|
||||||
# Now, for each tune, make the tune JPG and sound. Do this to temp
|
# Now, for each tune, make the tune bitmap and sound. Do this to temp
|
||||||
# files and rename into place to make updates as atomic as possible.
|
# files and rename into place to make updates as atomic as possible.
|
||||||
find $booke -name "*.abc" | sort |
|
find $booke -name "*.abc" | sort |
|
||||||
while read filename
|
while read filename
|
||||||
do
|
do
|
||||||
name=`basename $filename .abc`
|
name=`basename $filename .abc`
|
||||||
tmpname=${name}.tmp
|
tmpname=${name}.tmp
|
||||||
convert -density 96 $graphicsdir/${name}.eps $builddir/${tmpname}.png
|
|
||||||
convert -density 96 $graphicsdir/firstline-${name}.eps $builddir/firstline-${tmpname}.png
|
|
||||||
|
|
||||||
abc2midi $filename -o $builddir/${tmpname}.mid
|
abc2midi $filename -o $builddir/${tmpname}.mid
|
||||||
timidity -Ow -o $builddir/${tmpname}.wav $builddir/${tmpname}.mid
|
timidity -Ow -o $builddir/${tmpname}.wav $builddir/${tmpname}.mid
|
||||||
lame --quiet $builddir/${tmpname}.wav $builddir/${tmpname}.mp3
|
lame --quiet $builddir/${tmpname}.wav $builddir/${tmpname}.mp3
|
||||||
|
|
||||||
mv $builddir/${tmpname}.png $builddir/${name}.png
|
|
||||||
mv $builddir/firstline-${tmpname}.png $builddir/firstline-${name}.png
|
|
||||||
mv $builddir/${tmpname}.mid $builddir/${name}.mid
|
mv $builddir/${tmpname}.mid $builddir/${name}.mid
|
||||||
mv $builddir/${tmpname}.mp3 $builddir/${name}.mp3
|
mv $builddir/${tmpname}.mp3 $builddir/${name}.mp3
|
||||||
rm $builddir/${tmpname}.wav
|
rm $builddir/${tmpname}.wav
|
|
@ -0,0 +1,33 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Make graphics required for the website but not for the book.
|
||||||
|
# They go into web/<book>.
|
||||||
|
#
|
||||||
|
|
||||||
|
if [ $# != 1 ]; then
|
||||||
|
echo "Usage: makeWebGraphics.sh <book dir name>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
dir=`pwd`
|
||||||
|
|
||||||
|
booke=$dir/$1
|
||||||
|
builddir=$dir/web/$1
|
||||||
|
graphicsdir=$dir/graphics/$1
|
||||||
|
|
||||||
|
mkdir -p $builddir
|
||||||
|
|
||||||
|
# Now, for each tune, make the main tune and tune first line bitmaps.
|
||||||
|
# Do this to temp files and rename into place to make updates as
|
||||||
|
# atomic as possible.
|
||||||
|
find $booke -name "*.abc" | sort |
|
||||||
|
while read filename
|
||||||
|
do
|
||||||
|
name=`basename $filename .abc`
|
||||||
|
tmpname=${name}.tmp
|
||||||
|
convert -density 96 $graphicsdir/${name}.eps $builddir/${tmpname}.png
|
||||||
|
convert -density 96 $graphicsdir/firstline-${name}.eps $builddir/firstline-${tmpname}.png
|
||||||
|
|
||||||
|
mv $builddir/${tmpname}.png $builddir/${name}.png
|
||||||
|
mv $builddir/firstline-${tmpname}.png $builddir/firstline-${name}.png
|
||||||
|
done
|
Loading…
Reference in New Issue