diff doChordID-osx.sh @ 6:1e4233d4b3bb

added stuff so it should actually run now
author matthiasm
date Fri, 11 Apr 2014 15:49:53 +0100
parents 4182672fd6f8
children
line wrap: on
line diff
--- a/doChordID-osx.sh	Tue Apr 24 12:03:50 2012 +0100
+++ b/doChordID-osx.sh	Fri Apr 11 15:49:53 2014 +0100
@@ -1,24 +1,12 @@
 #!/bin/bash
 
-if [ $# -lt 2 ] ; then
-echo "Usage: $0 [-s] LISTFILENAME OUTPUTDIR"
-exit 1
+listfile="$1"
+if [ $# -gt 2 ]; then
+	outputdir="$3"
+else
+	outputdir="$2"
 fi
 
-retainstructure=0
-
-while [ $# -gt 2 ] ; do
-case $1 in
--d) retainstructure=1 ; shift 1 ; echo here;;
-*) shift 1 ;;
-esac
-done
-
-listfile="$1"
-echo listfile "$listfile"
-outputdir="$2"
-
-
 while read infile; do
 	if [ "$infile" -a -f "$infile" ]; then
 		before="$(date +%s)"
@@ -26,19 +14,9 @@
 		echo " "
 		echo Processing file "$infile"
 		echo " "
-		if [ $retainstructure -eq 0 ]; then
-			pathandfile=`basename "$infile"`
-		else
-			pathandfile="`echo "$infile" | egrep -o '[^/]*/[^/]*/[^/]*$'`"
-			echo pathandfile "$pathandfile"
-		fi
-		outfile="$outputdir"/"$pathandfile".txt
-		
-		logfile=_logfiles/"$pathandfile".log
-		chromafile=_chromadata/"$pathandfile".csv
-		
-		mkdir -p "`dirname "$outfile"`"
-		
+		outfile="$outputdir"/"`basename "$infile"`".txt
+		logfile=_logfiles/"`basename "$infile"`".log
+		chromafile=_chromadata/"`basename "$infile"`".csv
 		echo "[sonic annotator] ..."
 		VAMP_PATH=. ./sonic-annotator -d vamp:matthiasm:nnls_chroma:bothchroma -w csv --csv-stdout "$infile" 2> "$logfile" | cut -d ',' -f 2-  > "$chromafile" 
 		matlab -nodisplay -nojvm -r run_mirex\(\'"$infile"\',\'"$outfile"\'\,\'"$chromafile"\'\) >> $logfile