To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Revision:

root / process-all.sh

History | View | Annotate | Download (779 Bytes)

1 0:4182672fd6f8 Chris
#!/bin/bash
2
3
base=/import/c4dm-music-a/C4DM\ Music\ Collection
4
5
echo "base: $base"
6
7
find "$base" -type d | while read source; do
8
9
    ls "$source" | fgrep -q .wav || continue
10
11
    echo "source: $source"
12
    dirname=${source#$base}
13
    dirname=${dirname#/}
14
    echo "dirname: $dirname"
15
    [ -n "$dirname" ] || continue
16
17
    for type in ChordID ChordID-simple Segmentation; do
18
19
	target="output/$dirname/$type"
20
	mkdir -p "$target"
21
22
	(
23
	    flock -en 200 || exit
24
25
	    echo "Have lock on $target"
26
27
	    for f in "$source"/*.wav ; do
28
		[ -f "$f" ] || continue
29
		filebase=`basename "$f"`
30
		if [ ! -s "$target/$filebase.txt" ]; then
31
		    echo "$f"
32
		fi
33
	    done > "$target/source.txt"
34
35
	    bash ./do$type.sh "$target/source.txt" "$target"
36
37
	)200>"$target/.lock"
38
39
    done
40
41
done