Mercurial > hg > silvet
comparison testdata/TRIOS-mirex2012-matlab/calculate.sh @ 59:d5f5c91f4afe
Add script to calculate TRIOS dataset results using MIREX submission code
author | Chris Cannam |
---|---|
date | Mon, 28 Apr 2014 11:05:32 +0100 |
parents | |
children | 5472c6bbd936 |
comparison
equal
deleted
inserted
replaced
58:d00a6f6c7fc9 | 59:d5f5c91f4afe |
---|---|
1 #!/bin/bash | |
2 | |
3 # Run this from the directory that contains it | |
4 | |
5 trios_path="/import/c4dm-datasets/TRIOS_dataset" | |
6 | |
7 if [ ! -d "$trios_path" ]; then | |
8 echo "TRIOS dataset directory $trios_path not found, giving up" | |
9 exit 1 | |
10 fi | |
11 | |
12 matlab_path="../../mirex2012-matlab" | |
13 | |
14 if [ ! -d "$matlab_path" ] || [ ! -f "$matlab_path/doMultiF0.m" ]; then | |
15 echo "Required MATLAB code not found in $matlab_path, giving up" | |
16 exit 1 | |
17 fi | |
18 | |
19 outbase="`pwd`" | |
20 echo "Will read TRIOS files from $trios_path" | |
21 echo "Will write output files below $outbase" | |
22 echo "If either of these is incorrect, hit ctrl-C now!" | |
23 sleep 8 | |
24 | |
25 if echo quit | matlab -nojvm ; then echo | |
26 else | |
27 echo "Failed to start MATLAB to check that it works, giving up" | |
28 exit 1 | |
29 fi | |
30 | |
31 for d in brahms lussier mozart schubert take_five; do | |
32 dir="$trios_path/$d" | |
33 outdir="$outbase/$d" | |
34 if [ ! -d "$dir" ]; then | |
35 echo "TRIOS subdir $dir not found, skipping it" | |
36 else | |
37 mkdir -p "$outdir" | |
38 for w in "$dir"/*.wav; do | |
39 wbase=`basename "$w" .wav` | |
40 out="$outdir/$wbase.lab" | |
41 echo "Processing wav file $w, writing to lab file $out" | |
42 ( cd "$matlab_path" ; echo "doMultiF0('$w','$out')" | matlab -nojvm ) | |
43 echo "Done" | |
44 done | |
45 fi | |
46 echo | |
47 done | |
48 | |
49 |