# HG changeset patch # User Chris Cannam # Date 1378387124 -3600 # Node ID 8f1a16a22325d9e9c7b4308de7885548901039be # Parent 591a38eb70ebe0bebd769ce127f85df491d9337b Fixes to Chordino run scripts diff -r 591a38eb70eb -r 8f1a16a22325 audio_chord_estimation/chordino/chordino.sh --- 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" diff -r 591a38eb70eb -r 8f1a16a22325 audio_chord_estimation/chordino/doChordID.sh --- 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