Mercurial > hg > mauch-mirex-2010
diff process-all.sh @ 0:4182672fd6f8
Initial commit of files from the mauch-MIREX directory on octave
author | Chris Cannam |
---|---|
date | Tue, 24 Apr 2012 11:52:05 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/process-all.sh Tue Apr 24 11:52:05 2012 +0100 @@ -0,0 +1,41 @@ +#!/bin/bash + +base=/import/c4dm-music-a/C4DM\ Music\ Collection + +echo "base: $base" + +find "$base" -type d | while read source; do + + ls "$source" | fgrep -q .wav || continue + + echo "source: $source" + dirname=${source#$base} + dirname=${dirname#/} + echo "dirname: $dirname" + [ -n "$dirname" ] || continue + + for type in ChordID ChordID-simple Segmentation; do + + target="output/$dirname/$type" + mkdir -p "$target" + + ( + flock -en 200 || exit + + echo "Have lock on $target" + + for f in "$source"/*.wav ; do + [ -f "$f" ] || continue + filebase=`basename "$f"` + if [ ! -s "$target/$filebase.txt" ]; then + echo "$f" + fi + done > "$target/source.txt" + + bash ./do$type.sh "$target/source.txt" "$target" + + )200>"$target/.lock" + + done + +done