# HG changeset patch # User Jim Hague # Date 1378118896 -3600 # Node ID f1c4abe4fc75cb9cc9cae3b596be558cc7406142 # Parent aeef7b1ca0adb5175695652903272d66906e35c6 First go at adding the tune learner page. diff -r aeef7b1ca0ad -r f1c4abe4fc75 dottes.html --- a/dottes.html Mon Sep 02 10:15:56 2013 +0100 +++ b/dottes.html Mon Sep 02 11:48:16 2013 +0100 @@ -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 -r aeef7b1ca0ad -r f1c4abe4fc75 dottes.html.learnertune --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dottes.html.learnertune Mon Sep 02 11:48:16 2013 +0100 @@ -0,0 +1,163 @@ + + + + + Cry Havoc tunes - learning @TITLE@ + + + + + + + + +
+ + + + +
+
+
+
+
+
+

@TITLE@

+

@SUBTITLE@

+
+
+ @COMPOSER@ +
+
+
+

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

+
+
+
+ + diff -r aeef7b1ca0ad -r f1c4abe4fc75 dottes.html.tuneindex --- a/dottes.html.tuneindex Mon Sep 02 10:15:56 2013 +0100 +++ b/dottes.html.tuneindex Mon Sep 02 11:48:16 2013 +0100 @@ -3,7 +3,12 @@ @TITLE@
- @TITLE@ first line + + @TITLE@ first line + + + Learner +
diff -r aeef7b1ca0ad -r f1c4abe4fc75 makeWeb.sh --- a/makeWeb.sh Mon Sep 02 10:15:56 2013 +0100 +++ b/makeWeb.sh Mon Sep 02 11:48:16 2013 +0100 @@ -13,6 +13,37 @@ 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 @@ 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 @@ 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}/" \ @@ -122,5 +159,18 @@ -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 -r aeef7b1ca0ad -r f1c4abe4fc75 makeWebAudio.sh --- a/makeWebAudio.sh Mon Sep 02 10:15:56 2013 +0100 +++ b/makeWebAudio.sh Mon Sep 02 11:48:16 2013 +0100 @@ -16,27 +16,23 @@ 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 -r aeef7b1ca0ad -r f1c4abe4fc75 web/img/learner.png Binary file web/img/learner.png has changed diff -r aeef7b1ca0ad -r f1c4abe4fc75 web/index.html --- a/web/index.html Mon Sep 02 10:15:56 2013 +0100 +++ b/web/index.html Mon Sep 02 11:48:16 2013 +0100 @@ -26,8 +26,7 @@ dance-out, there is a music-playing session.

Havoc 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