To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Revision:

root / doChordID-osx.sh @ 6:1e4233d4b3bb

History | View | Annotate | Download (931 Bytes)

1
#!/bin/bash
2

    
3
listfile="$1"
4
if [ $# -gt 2 ]; then
5
	outputdir="$3"
6
else
7
	outputdir="$2"
8
fi
9

    
10
while read infile; do
11
	if [ "$infile" -a -f "$infile" ]; then
12
		before="$(date +%s)"
13
		echo "_____________________________________________________"
14
		echo " "
15
		echo Processing file "$infile"
16
		echo " "
17
		outfile="$outputdir"/"`basename "$infile"`".txt
18
		logfile=_logfiles/"`basename "$infile"`".log
19
		chromafile=_chromadata/"`basename "$infile"`".csv
20
		echo "[sonic annotator] ..."
21
		VAMP_PATH=. ./sonic-annotator -d vamp:matthiasm:nnls_chroma:bothchroma -w csv --csv-stdout "$infile" 2> "$logfile" | cut -d ',' -f 2-  > "$chromafile" 
22
		matlab -nodisplay -nojvm -r run_mirex\(\'"$infile"\',\'"$outfile"\'\,\'"$chromafile"\'\) >> $logfile
23
		after="$(date +%s)"
24
		elapsed_seconds="$(expr $after - $before)"
25
		echo "  -->" time elapsed: $elapsed_seconds seconds
26
		echo " "
27
	else if [ ! "$infile" ]; then echo ...; fi
28
	fi		
29
done < "$listfile"