Revision 6:1e4233d4b3bb doChordID-osx.sh
| doChordID-osx.sh | ||
|---|---|---|
| 1 | 1 |
#!/bin/bash |
| 2 | 2 |
|
| 3 |
if [ $# -lt 2 ] ; then |
|
| 4 |
echo "Usage: $0 [-s] LISTFILENAME OUTPUTDIR" |
|
| 5 |
exit 1 |
|
| 3 |
listfile="$1" |
|
| 4 |
if [ $# -gt 2 ]; then |
|
| 5 |
outputdir="$3" |
|
| 6 |
else |
|
| 7 |
outputdir="$2" |
|
| 6 | 8 |
fi |
| 7 | 9 |
|
| 8 |
retainstructure=0 |
|
| 9 |
|
|
| 10 |
while [ $# -gt 2 ] ; do |
|
| 11 |
case $1 in |
|
| 12 |
-d) retainstructure=1 ; shift 1 ; echo here;; |
|
| 13 |
*) shift 1 ;; |
|
| 14 |
esac |
|
| 15 |
done |
|
| 16 |
|
|
| 17 |
listfile="$1" |
|
| 18 |
echo listfile "$listfile" |
|
| 19 |
outputdir="$2" |
|
| 20 |
|
|
| 21 |
|
|
| 22 | 10 |
while read infile; do |
| 23 | 11 |
if [ "$infile" -a -f "$infile" ]; then |
| 24 | 12 |
before="$(date +%s)" |
| ... | ... | |
| 26 | 14 |
echo " " |
| 27 | 15 |
echo Processing file "$infile" |
| 28 | 16 |
echo " " |
| 29 |
if [ $retainstructure -eq 0 ]; then |
|
| 30 |
pathandfile=`basename "$infile"` |
|
| 31 |
else |
|
| 32 |
pathandfile="`echo "$infile" | egrep -o '[^/]*/[^/]*/[^/]*$'`" |
|
| 33 |
echo pathandfile "$pathandfile" |
|
| 34 |
fi |
|
| 35 |
outfile="$outputdir"/"$pathandfile".txt |
|
| 36 |
|
|
| 37 |
logfile=_logfiles/"$pathandfile".log |
|
| 38 |
chromafile=_chromadata/"$pathandfile".csv |
|
| 39 |
|
|
| 40 |
mkdir -p "`dirname "$outfile"`" |
|
| 41 |
|
|
| 17 |
outfile="$outputdir"/"`basename "$infile"`".txt |
|
| 18 |
logfile=_logfiles/"`basename "$infile"`".log |
|
| 19 |
chromafile=_chromadata/"`basename "$infile"`".csv |
|
| 42 | 20 |
echo "[sonic annotator] ..." |
| 43 | 21 |
VAMP_PATH=. ./sonic-annotator -d vamp:matthiasm:nnls_chroma:bothchroma -w csv --csv-stdout "$infile" 2> "$logfile" | cut -d ',' -f 2- > "$chromafile" |
| 44 | 22 |
matlab -nodisplay -nojvm -r run_mirex\(\'"$infile"\',\'"$outfile"\'\,\'"$chromafile"\'\) >> $logfile |
Also available in: Unified diff