Mercurial > hg > silvet
diff testdata/evaluation/run.sh @ 194:72a9696f7caa
Fixes to script
author | Chris Cannam |
---|---|
date | Wed, 04 Jun 2014 11:07:34 +0100 |
parents | 1b7b31aab82a |
children | 4259005def86 |
line wrap: on
line diff
--- a/testdata/evaluation/run.sh Wed Jun 04 10:57:54 2014 +0100 +++ b/testdata/evaluation/run.sh Wed Jun 04 11:07:34 2014 +0100 @@ -17,12 +17,14 @@ exit 1 fi -rdffile="../silvet.n3" +rdffile="../../silvet.n3" if [ ! -f "$rdffile" ] ; then - + echo "Failed to find plugin RDF file at $rdffile, giving up" + exit 1 +fi case "$trios_path" in -*\ *) echo "TRIOS dataset path $trios_path has a space in it, this script won't handle that!"; exit 1;; +*\ *) echo "TRIOS dataset path $trios_path has a space in it, this script won't handle that"; exit 1;; esac VAMP_PATH=../.. @@ -43,15 +45,19 @@ grep Piano "$rdffile" | sed 's/^.*( *//' | sed 's/ *).*$//' | sed 's/ "/\n/g' | sed 's/"//g' | tr '[A-Z]' '[a-z]' | tail -n +2 | cat -n > "$instfile" instrument_for() { - filename="$0" + filename="$1" base=`basename "$filename" .wav` instrument_no=`grep "$base" "$instfile" | awk '{ print $1; }'` - if [ -z "$instrument_no" ]; + if [ -z "$instrument_no" ] || [ -z "$base" ]; then echo 0 else echo "$instrument_no" fi } +echo +echo "Input files are:" +echo $infiles | fmt -1 + for infile in $infiles; do echo @@ -62,15 +68,18 @@ [0-9]*) ;; *) echo "Instrument extraction failed for infile $infile -- not even default multi-instrument setting returned?"; exit 1;; esac + + piece=`basename \`dirname "$infile" \`` + arrangement=`basename "$infile" .wav` echo - echo "For file $infile, using instrument setting $instrument..." + echo "For piece $piece, arrangement $arrangement, using instrument $instrument..." sox "$infile" "$tmpwav" gain -n -6.020599913279624 ##!!! todo: actually apply the instrument setting! - time sonic-annotator \ + sonic-annotator \ --writer csv \ --csv-one-file "$outfile" \ --csv-force \ @@ -83,9 +92,6 @@ end=`echo "$start $duration + p" | dc` echo -e "$start\t$end\t$frequency" done > "$outfile.lab" - - piece=`basename \`dirname "$infile" \`` - arrangement=`basename "$infile" .wav` for ms in 50 100; do echo