forked from CryHavoc/dottes
Automated merge with ssh://hg.cryhavoc.org.uk/dottes
This commit is contained in:
commit
efa21c08f2
|
@ -1,6 +1,7 @@
|
||||||
X:1
|
X:1
|
||||||
T:Astley's Ride
|
T:Astley's Ride
|
||||||
M:4/4
|
M:4/4
|
||||||
|
Q:180
|
||||||
K:G
|
K:G
|
||||||
dB|"G"G2G2 G2FG|"D"A2A2 A2BA|"C"GFED E2F2|"G"GABc dcBA|
|
dB|"G"G2G2 G2FG|"D"A2A2 A2BA|"C"GFED E2F2|"G"GABc dcBA|
|
||||||
G2G2 G2FG|"D"A2A2 A2BA|"C"GFED "D7"E2F2|G4G2::GA|B2B2 B2AB|"Am"c2c2 cdcB|
|
G2G2 G2FG|"D"A2A2 A2BA|"C"GFED "D7"E2F2|G4G2::GA|B2B2 B2AB|"Am"c2c2 cdcB|
|
||||||
|
|
|
@ -3,6 +3,7 @@ T:Enrico
|
||||||
R:Reel
|
R:Reel
|
||||||
M:C|
|
M:C|
|
||||||
L:1/8
|
L:1/8
|
||||||
|
Q:150
|
||||||
K:D
|
K:D
|
||||||
|: A2 | "D" d2 fe "G" dc dB | "D" ABAG F2 A2 | "D" d2 ef "G" gfgf |\
|
|: A2 | "D" d2 fe "G" dc dB | "D" ABAG F2 A2 | "D" d2 ef "G" gfgf |\
|
||||||
"A" e2 a2 a2 f2 |
|
"A" e2 a2 a2 f2 |
|
||||||
|
|
|
@ -16,25 +16,52 @@ builddir=$dir/web/$1
|
||||||
|
|
||||||
mkdir -p $builddir
|
mkdir -p $builddir
|
||||||
|
|
||||||
# Now, for each tune, make the tune bitmap and sound. Do this to temp
|
# Make MP3 and OGG files for the input .abc. In case we're generating
|
||||||
# files and rename into place to make updates as atomic as possible.
|
# 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.
|
||||||
|
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
|
||||||
|
# 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
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
# Generate audio files and slow speed (currently half speed) audio files.
|
||||||
find $booke -name "*.abc" | sort |
|
find $booke -name "*.abc" | sort |
|
||||||
while read filename
|
while read filename
|
||||||
do
|
do
|
||||||
|
makeaudiofiles $filename
|
||||||
|
|
||||||
name=`basename $filename .abc`
|
name=`basename $filename .abc`
|
||||||
tmpname=${name}.tmp
|
slowspeedfilename="slowspeed-${name}.abc"
|
||||||
|
|
||||||
abc2midi $filename -o $builddir/${tmpname}.mid
|
# Prepare slow speed audio files.
|
||||||
timidity -Ow -o $builddir/${tmpname}.wav $builddir/${tmpname}.mid
|
# The tempo is either a plain number, or <notelen>=<number>.
|
||||||
lame --quiet $builddir/${tmpname}.wav $builddir/${tmpname}.mp3
|
tempo=`$dir/abcfield.py --field Q $filename`
|
||||||
# Timidity can generate OGG directly. But we need to generate WAV
|
if [ -z $tempo ]; then
|
||||||
# for lame, and oggenc produces smaller output. OGG is needed for
|
echo "Warning: $filename has no tempo. Using 120."
|
||||||
# Firefox's audio tag. FF doesn't support MP3, some others support
|
tempo="120"
|
||||||
# MP3 but not OGG.
|
fi
|
||||||
oggenc -Q -o $builddir/${tmpname}.ogg $builddir/${tmpname}.wav
|
pos=`expr index $tempo '='`
|
||||||
|
numtempo=${tempo:pos}
|
||||||
mv $builddir/${tmpname}.mid $builddir/${name}.mid
|
notelenprefix=${tempo:0:pos}
|
||||||
mv $builddir/${tmpname}.mp3 $builddir/${name}.mp3
|
# Make new tempo half original speed.
|
||||||
mv $builddir/${tmpname}.ogg $builddir/${name}.ogg
|
newtempo=$(( $numtempo / 2 ))
|
||||||
rm $builddir/${tmpname}.wav
|
# Insert new tempo and delete old. Old may not exist,
|
||||||
|
# so do this rather than overwrite.
|
||||||
|
sed -e "/^Q:/d" -e "/^K:/aQ: ${notelenprefix}${newtempo}" $filename > $builddir/$slowspeedfilename
|
||||||
|
makeaudiofiles $builddir/$slowspeedfilename
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue