comparison data/osc/demoscript.sh @ 525:7419a063878b

* minor changes for current system
author Chris Cannam
date Mon, 05 Jan 2009 21:51:27 +0000
parents 32e50b620a6c
children b061b9f8fca5
comparison
equal deleted inserted replaced
524:12608139f6bc 525:7419a063878b
1 #!/bin/bash 1 #!/bin/bash
2 2
3 audio=/data/music 3 audio=/share/music
4 preferred=$audio/free 4 preferred=$audio/free
5 list=audiofiles.txt 5 list=audiofiles.txt
6 used=audiofiles-used.txt 6 used=audiofiles-used.txt
7 7
8 df=vamp:vamp-aubio:aubioonset:detectionfunction 8 df=vamp:vamp-aubio:aubioonset:detectionfunction
40 find "$preferred" -name \*.wav -print >> "$list" 40 find "$preferred" -name \*.wav -print >> "$list"
41 count=`wc -l "$list" 2>/dev/null | awk '{ print $1 }'` 41 count=`wc -l "$list" 2>/dev/null | awk '{ print $1 }'`
42 fi 42 fi
43 while [ -z "$file" ]; do 43 while [ -z "$file" ]; do
44 index=$((RANDOM % $count)) 44 index=$((RANDOM % $count))
45 file=`tail +"$index" "$list" | head -1` 45 file=`head -"$index" "$list" | tail -1`
46 [ -f "$file" ] || continue 46 [ -f "$file" ] || continue
47 done 47 done
48 fgrep -v "$file" "$list" > "$list"_ && mv "$list"_ "$list" 48 fgrep -v "$file" "$list" > "$list"_ && mv "$list"_ "$list"
49 echo "$file" 49 echo "$file"
50 } 50 }
55 if ! sv-command open "$file"; then 55 if ! sv-command open "$file"; then
56 pid="`pidof sonic-visualiser`" 56 pid="`pidof sonic-visualiser`"
57 if [ -z "$pid" ]; then 57 if [ -z "$pid" ]; then
58 ( setsid sonic-visualiser -geometry 1000x500+10+100 & ) 58 ( setsid sonic-visualiser -geometry 1000x500+10+100 & )
59 sleep 2 59 sleep 2
60 sudo renice +19 `pidof sonic-visualiser` 60 #sudo renice +19 `pidof sonic-visualiser`
61 sudo renice +18 `pidof Xorg` 61 #sudo renice +18 `pidof Xorg`
62 sv-command resize 1000 500 62 sv-command resize 1000 500
63 load_a_file 63 load_a_file
64 else 64 else
65 echo "ERROR: Unable to contact sonic-visualiser pid $pid" 1>&2 65 echo "ERROR: Unable to contact sonic-visualiser pid $pid" 1>&2
66 exit 1 66 exit 1