Mercurial > dottes
view makeWebItems.sh @ 50:e666306c5ab1
Add list of tune first lines.
Add a list of tune first lines to the Booke. First, a small Python script to
filter a .abc file and spit out just enough to give a graphic of the first line
without the title. Then generate these graphics and generate a new section in the Booke
with a longtable of tune name and the first line graphic.
author | Jim Hague <jim.hague@laicatc.com> |
---|---|
date | Sun, 04 Mar 2012 20:16:48 +0000 |
parents | 6f4667d1372d |
children | 3464d5154f49 |
line wrap: on
line source
#!/bin/bash # # Make items required for the website but not for the book. # They go into web/<book>. # if [ $# != 1 ]; then echo "Usage: makeWebItems.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 tune JPG and sound. 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` convert $graphicsdir/${name}.eps $builddir/${name}.jpg.tmp abc2midi $filename -o $builddir/${name}.mid.tmp timidity -Ow -o $builddir/${name}.wav.tmp $builddir/${name}.mid.tmp lame --quiet $builddir/${name}.wav.tmp $builddir/${name}.mp3.tmp mv $builddir/${name}.jpg.tmp $builddir/${name}.jpg mv $builddir/${name}.mid.tmp $builddir/${name}.mid mv $builddir/${name}.mp3.tmp $builddir/${name}.mp3 rm $builddir/${name}.wav.tmp done