From deba133b3b32e0e7458afc74442dfd214631a22a Mon Sep 17 00:00:00 2001 From: Jim Hague Date: Mon, 2 Sep 2013 11:48:16 +0100 Subject: [PATCH] First go at adding the tune learner page. --- dottes.html | 32 +++++--- dottes.html.learnertune | 163 ++++++++++++++++++++++++++++++++++++++++ dottes.html.tuneindex | 9 ++- makeWeb.sh | 54 ++++++++++++- makeWebAudio.sh | 20 ++--- web/img/learner.png | Bin 0 -> 2236 bytes web/index.html | 3 +- 7 files changed, 254 insertions(+), 27 deletions(-) create mode 100644 dottes.html.learnertune create mode 100644 web/img/learner.png diff --git a/dottes.html b/dottes.html index 5da2b45..6061513 100644 --- a/dottes.html +++ b/dottes.html @@ -22,6 +22,29 @@

@SUBTITLE@

+

See below if you'd like to print a book + of these tunes. +

Click on the tune title or first line music for a page showing + the dots for the tune and giving links for downloading the tune + in various formats. If you don't read music, or you'd like to work + on practicing learning tunes by ear, or just playing along with + the tune, click on the learner icon + + for a page where you can listen to the tune repeatedly, either + at the full playing speed or several slower speeds. +

When changes to this site are made, the issue number is incremented. + This is issue @BUILD@. +

+ +
+

The tunes

+
+ +
+
+ +
+

Printing

You can download a PDF with a booklet of these tunes. There is an A5 landscape book with one tune per page, a 4x5in portrait book @@ -33,15 +56,6 @@ A5 booklet. Print this onto A4 paper using both sides of the paper, and fold in half to make an A5 booklet. -

When changes to this site are made, the issue number is incremented. - This is issue @BUILD@. -

- -
-

The tunes

-
- -
diff --git a/dottes.html.learnertune b/dottes.html.learnertune new file mode 100644 index 0000000..806aa5a --- /dev/null +++ b/dottes.html.learnertune @@ -0,0 +1,163 @@ + + + + + Cry Havoc tunes - learning @TITLE@ + + + + + + + + +
+ + + + +
+
+
+
+
+
+

@TITLE@

+

@SUBTITLE@

+
+
+ @COMPOSER@ +
+
+
+

@TITLE@ is in the key of @KEY@. +

+
+
+
+ + diff --git a/dottes.html.tuneindex b/dottes.html.tuneindex index 0cbd262..fe09a78 100644 --- a/dottes.html.tuneindex +++ b/dottes.html.tuneindex @@ -3,7 +3,12 @@ @TITLE@
- @TITLE@ first line + + @TITLE@ first line + + + Learner +
diff --git a/makeWeb.sh b/makeWeb.sh index 07d70a7..a456f10 100755 --- a/makeWeb.sh +++ b/makeWeb.sh @@ -13,6 +13,37 @@ fixtitle() retval=`echo "$1" | sed -e "s/\(.*\), *\(.*\)/\2 \1/"` } +# Format a key in ABC (G, Gmin, etc.) in standard presentation format. +fixkey() +{ + letter=${1:0:1} + accidental=${1:1:1} + if [ "$accidental" != "#" -a "$accidental" != "b" ]; then + accidental="" + mode=${1:1:3} + else + mode=${1:2:3} + fi + mode=${mode,,} + mode=${mode/ //g} + if [ "$mode" = "m" -o "$mode" = "min" ]; then + mode="Minor" + elif [ "$mode" = "mix" ]; then + mode="Mixolydian" + elif [ "$mode" = "dor" ]; then + mode="Dorian" + elif [ "$mode" = "phr" ]; then + mode="Phrygian" + elif [ "$mode" = "lyd" ]; then + mode="Lydian" + elif [ "$mode" = "loc" ]; then + mode="Locrian" + else + mode="Major" + fi + retval="${letter}${accidental} ${mode}" +} + if [ $# -lt 2 -o $# -gt 3 ]; then echo "Usage: makeWeb.sh []" exit 1 @@ -64,6 +95,7 @@ done cp $1-*.pdf $webdir # Now, for each tune, make the tune page. +rm -f $webdir/$tunelist find $bookedir -name "*.abc" | sort | while read filename do @@ -90,28 +122,33 @@ find $bookedir -name "*.abc" | sort | creditvisibility="yes" fi lastchanged=`hg log --limit 1 --template "{date|shortdate}" $filename` + key=`$dir/abcfield.py --field K $filename` + fixkey $key + key=$retval # Copy the ABC into the web. cp $filename $webdir - # If we are not the master booke, link the mp3 in from the + # If we are not the master booke, link the mp3s in from the # master page in a desperate attempt to make IE8 work. # The Jenkins archive will dereference the soft link, it seems, # but I guess I can live with copies of the MP3 for now. if [ "$booke" != "$masterbooke" ]; then pushd ${webdir} > /dev/null - ln -f -s ../${masterbooke}/${name}.mp3 + ln -f -s ../${masterbooke}/*${name}.mp3 popd > /dev/null fi # Generate the tune web page. tunepage=${name}.html + learnerpage=learner-${name}.html # If the title contains HTML character entities, escape # initial '&' in the title - it means things to sed. sed -e "s/@TITLE@/${title//&/\&}/" \ -e "s/@SUBTITLE@/${subtitle}/" \ -e "s/@COMPOSER@/${composer}/" \ + -e "s/@KEY@/${key}/" \ -e "s/@MASTERBOOKE@/${masterbooke}/" \ -e "s/@CHANGETITLE@/${changetitle//&/\&}/" \ -e "s/@CHANGETUNE@/${changefile/.abc/.html}/" \ @@ -121,6 +158,19 @@ find $bookedir -name "*.abc" | sort | -e "s/@LASTCHANGED@/${lastchanged}/" \ -e "s/@TUNE@/${name}/" dottes.html.tune > $webdir/$tunepage + sed -e "s/@TITLE@/${title//&/\&}/" \ + -e "s/@SUBTITLE@/${subtitle}/" \ + -e "s/@COMPOSER@/${composer}/" \ + -e "s/@KEY@/${key}/" \ + -e "s/@MASTERBOOKE@/${masterbooke}/" \ + -e "s/@CHANGETITLE@/${changetitle//&/\&}/" \ + -e "s/@CHANGETUNE@/${changefile/.abc/.html}/" \ + -e "s/@CHANGEVISIBILITY@/${changevisibility}/" \ + -e "s/@CREDIT@/${credit}/" \ + -e "s/@CREDITVISIBILITY@/${creditvisibility}/" \ + -e "s/@LASTCHANGED@/${lastchanged}/" \ + -e "s/@TUNE@/${name}/" dottes.html.learnertune > $webdir/$learnerpage + sed -e "s/@TITLE@/${title//&/\&}/" \ -e "s/@TUNE@/${name}/" dottes.html.tuneindex >> $webdir/$tunelist done diff --git a/makeWebAudio.sh b/makeWebAudio.sh index 42139e7..f71acdc 100755 --- a/makeWebAudio.sh +++ b/makeWebAudio.sh @@ -16,27 +16,23 @@ builddir=$dir/web/$1 mkdir -p $builddir -# Make MP3 and OGG files for the input .abc. In case we're generating -# to a live site (which we won't be), do this to temp files and rename -# into place to make updates as atomic as possible. +# Make MP3 and OGG files for the input .abc. Since we're listening to +# a doorbell playing the tunes, go for lowest quality (and hence smallest) +# MP3 and OGG. makeaudiofiles() { name=`basename $1 .abc` - tmpname=${name}.tmp - abc2midi $1 -o $builddir/${tmpname}.mid - timidity -OwM -o $builddir/${tmpname}.wav $builddir/${tmpname}.mid - lame -m m -V 9 --quiet $builddir/${tmpname}.wav $builddir/${tmpname}.mp3 + abc2midi $1 -o $builddir/${name}.mid + timidity -OwM -o $builddir/${name}.wav $builddir/${name}.mid + lame -m m -V 9 --quiet $builddir/${name}.wav $builddir/${name}.mp3 # Timidity can generate OGG directly. But we need to generate WAV # for lame, and oggenc produces smaller output. OGG is needed for # Firefox's audio tag. FF doesn't support MP3, some others support # MP3 but not OGG. - oggenc -Q -q 0 -o $builddir/${tmpname}.ogg $builddir/${tmpname}.wav + oggenc -Q -q 0 -o $builddir/${name}.ogg $builddir/${name}.wav - mv $builddir/${tmpname}.mid $builddir/${name}.mid - mv $builddir/${tmpname}.mp3 $builddir/${name}.mp3 - mv $builddir/${tmpname}.ogg $builddir/${name}.ogg - rm $builddir/${tmpname}.wav + rm $builddir/${name}.wav } # Make audio for a new tempo for the abc file $1, giving the output files diff --git a/web/img/learner.png b/web/img/learner.png new file mode 100644 index 0000000000000000000000000000000000000000..a7115ec73f7560fe98692561e596be955431d483 GIT binary patch literal 2236 zcmV;t2t)UYP)CN<>jp3qc5o zVhf~zRZ?+PFc-yP?KL1@@b1p+?2dOXJ9GLl(z4k-yR5y?o~PB!&e?Cj|Np=LJO3a; z2-ID=uFuWQA%u9IXBfuiaxn}8&v~Jz!qPO&vMi6sV;BYiq|@nKF6Z<4T3cKHpRf{% zL}zCwLa6+rVHk6Ba~Na4-;XioIIiLgO)mDS-!M(H`X?O@M_XH)eU}h2Gc#itMr&)U z&*%GJu=V)yV~@w<_xl^!OOm8Qp};T<%d!~bP$=}gU?mcXuCA^X>{~1rr>3R=prfP1 z>2y9zSe9kY&(Bj*d;YPtuz)wNZ{!C=Q7jgV_HG=2!L%-pYS6e1M!h4?qBl00yjT zht2C?@cZbE*HCABBSc7&gb-RCZt_u{S`Z59${`DE! zJ+!PenxCJ~<#M4=C>#!BjP0st>-;CGnv?O%p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aseK3^~xEEbEJrWFc>d_HdzRzcy&$jFf+N4mSaw{6?j*Vot6(-Q~;8o?yXvT2%; zNF)#l(B}!Y2H*_C*l#O1jthswx~{9LYEx(jx&$$s&7MDh{`Be7nx?(*!VAO0!$U(u z^#}CXY!(2@kAy3HU1002Wm$${sH$3`P?DrnDrG~IB*`XK*Y$WjzHZ&R_3PJf*s!6x z&`zB?l}IE82M5=#U0Y|o+YqdZ6Psz8x~|*!^7*_ZN$GStl}g#UD9ds#m&@n#s;X|> zxN-mf{hK#$MhMv~9y)ZWx3_m-V4%Idz1+Mn`z=OgKdLsTeY&VSS+fl zs;X)}pH~#cG)<1<>~TZ=f_;v#%0q0LX0cc_O%r46bUL5Havoc musicians come in all shades of experience and ability. This collection is intended to help those like me who are inexpert with - instrument and folk music generally, but have a little musical - background.

+ instrument and folk music generally.

Being folk tunes, many of the tunes herein have many variations. The music presented here is my attempt at reflecting what is actually played at Havoc sessions. I'm in no way suggesting that they are