changeset 22:8f1a16a22325

Fixes to Chordino run scripts
author Chris Cannam
date Thu, 05 Sep 2013 14:18:44 +0100
parents 591a38eb70eb
children 644b35ca6909
files audio_chord_estimation/chordino/chordino.sh audio_chord_estimation/chordino/doChordID.sh
diffstat 2 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/audio_chord_estimation/chordino/chordino.sh	Thu Sep 05 14:08:54 2013 +0100
+++ b/audio_chord_estimation/chordino/chordino.sh	Thu Sep 05 14:18:44 2013 +0100
@@ -1,3 +1,4 @@
+#!/bin/bash
 
 mydir=`dirname "$0"`
 infile="$1"
@@ -28,6 +29,6 @@
     -t "$mydir"/chordino.ttl \
     -w csv --csv-stdout --csv-separator ";" \
     "$infile" \
-    | perl -e 'while (<>) { chomp; @a = split /;/; if (defined $p) { print "$p\t$a[1]\t$pl\n"; }; $p = $a[1]; $pl = $a[2]; $pl =~ s/"//g; }' \
+    | perl -e 'while (<>) { chomp; @a = split /;/; if (defined $p) { print "$p\t$a[1]\t$pl\n"; }; $p = $a[1]; $pl = $a[2]; $pl =~ s/"//g; }; $pp = $p + 1; print "$p\t$pp\t$pl\n";' \
     > "$outfile"
 
--- a/audio_chord_estimation/chordino/doChordID.sh	Thu Sep 05 14:08:54 2013 +0100
+++ b/audio_chord_estimation/chordino/doChordID.sh	Thu Sep 05 14:18:44 2013 +0100
@@ -1,6 +1,7 @@
+#!/bin/bash
+
 # Usage: 
-# doChordID.sh "/path/to/testFileList.txt"  "/path/to/scratch/dir" "/path/to/results/dir"  
-# 
+# doChordID.sh /path/to/testFileList.txt /path/to/scratch/dir /path/to/results/dir  
 
 mydir=`dirname "$0"`
 filelist="$1"
@@ -8,14 +9,14 @@
 resultsdir="$3"
 
 if [ t"$filelist" = "t" ] || [ t"$resultsdir" = "t" ]; then
-    echo "Usage: $0 \"/path/to/testFileList.txt\"  \"/path/to/scratch/dir\" \"/path/to/results/dir\""
+    echo "Usage: $0 /path/to/testFileList.txt /path/to/scratch/dir /path/to/results/dir" 1>&2
+    echo "(Note: the scratch directory is not used and may be arbitrary)" 1>&2
     exit 2
 fi
 
-for i in `cat $filelist`; do 
+cat "$filelist" | while read i; do
     echo "Processing $i"
-    ofile="$resultsdir/`basename $i`.txt"
-    
-    ./chordino.sh $i $ofile
+    ofile="$resultsdir/`basename \"$i\"`.txt"
+    "$mydir"/chordino.sh "$i" "$ofile"
 done