comparison data/osc/demoscript.sh @ 1527:710e6250a401 zoom

Merge from default branch
author Chris Cannam
date Mon, 17 Sep 2018 13:51:14 +0100
parents 246876022b35
children
comparison
equal deleted inserted replaced
1324:d4a28d1479a8 1527:710e6250a401
1 #!/bin/bash 1 #!/bin/bash
2 2
3 audio=/share/music 3 audio=/data/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
9 #df=vamp:qm-vamp-plugins:qm-tempotracker:detection_fn 9 df=vamp:qm-vamp-plugins:qm-tempotracker:detection_fn
10 onsets=vamp:vamp-aubio:aubioonset:onsets 10 #onsets=vamp:vamp-aubio:aubioonset:onsets
11 #onsets=vamp:qm-vamp-plugins:qm-tempotracker:beats 11 onsets=vamp:vamp-example-plugins:percussiononsets:onsets
12 beats=vamp:vamp-aubio:aubiotempo:beats 12 beats=vamp:qm-vamp-plugins:qm-tempotracker:beats
13 #beats=vamp:vamp-aubio:aubiotempo:beats
13 #beats=$onsets 14 #beats=$onsets
14 #onsets=$beats 15 #onsets=$beats
15 chromagram=vamp:qm-vamp-plugins:qm-chromagram:chromagram 16 chromagram=vamp:qm-vamp-plugins:qm-chromagram:chromagram
16 notes=vamp:vamp-aubio:aubionotes:notes 17 notes=vamp:vamp-aubio:aubionotes:notes
17 18
47 done 48 done
48 fgrep -v "$file" "$list" > "$list"_ && mv "$list"_ "$list" 49 fgrep -v "$file" "$list" > "$list"_ && mv "$list"_ "$list"
49 echo "$file" 50 echo "$file"
50 } 51 }
51 52
53 resize_normal() {
54 # sv-command resize 1000 500
55 sv-command resize 2000 1000
56 }
57
58 resize_big() {
59 # sv-command resize 1000 700
60 sv-command resize 2000 1400
61 }
62
52 load_a_file() 63 load_a_file()
53 { 64 {
54 file=`pick_file` 65 file=`pick_file`
55 if ! sv-command open "$file"; then 66 if ! sv-command open "$file"; then
56 pid="`pidof sonic-visualiser`" 67 pid="`pidof sonic-visualiser`"
57 if [ -z "$pid" ]; then 68 if [ -z "$pid" ]; then
58 ( setsid sonic-visualiser -geometry 1000x500+10+100 & ) 69 ( setsid sonic-visualiser -geometry +10+100 & )
59 sleep 2 70 sleep 2
60 #sudo renice +19 `pidof sonic-visualiser` 71 #sudo renice +19 `pidof sonic-visualiser`
61 #sudo renice +18 `pidof Xorg` 72 #sudo renice +18 `pidof Xorg`
62 sv-command resize 1000 500 73 resize_normal
63 load_a_file 74 load_a_file
64 else 75 else
65 echo "ERROR: Unable to contact sonic-visualiser pid $pid" 1>&2 76 echo "ERROR: Unable to contact sonic-visualiser pid $pid" 1>&2
66 exit 1 77 exit 1
67 fi 78 fi
120 } 131 }
121 132
122 fade_in() 133 fade_in()
123 { 134 {
124 sv-command set gain 0 135 sv-command set gain 0
125 sleep 0.5 136 sleep 1
126 play "$@" 137 play "$@"
127 for gain in 0.001 0.01 0.05 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1; do 138 for gain in 0.001 0.01 0.05 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1; do
128 sv-command set gain $gain 139 sv-command set gain $gain
129 sleep 0.1 140 sleep 0.1
130 done 141 done
144 { 155 {
145 # for speed in -1 -10 -20 -30 -40 -50 -60 -70 -80 -100 -140 -200 -250 -300 -400 -500 -700 -800 -900 -1000; do 156 # for speed in -1 -10 -20 -30 -40 -50 -60 -70 -80 -100 -140 -200 -250 -300 -400 -500 -700 -800 -900 -1000; do
146 # sv-command set speedup "$speed" 157 # sv-command set speedup "$speed"
147 # sleep 1 158 # sleep 1
148 # done 159 # done
149 for speed in -20 -100 -1000; do 160 for speed in 80 50 10; do
150 sv-command set speedup "$speed" 161 sv-command set speed "$speed"
151 sleep 10 162 sleep 10
152 done 163 done
153 } 164 }
154 165
155 stop() 166 stop()
156 { 167 {
157 sv-command stop "$@" 168 sv-command stop "$@"
158 sv-command set speedup 0 169 sv-command set speed 100
159 } 170 }
160 171
161 quit() 172 quit()
162 { 173 {
163 sv-command quit 174 sv-command quit
283 sleep 20 294 sleep 20
284 295
285 sv-command select 7.5 11 296 sv-command select 7.5 11
286 fade_in selection 297 fade_in selection
287 sleep 10 298 sleep 10
288 sv-command set speedup -200 299 sv-command set speed 40
289 sleep 10 300 sleep 10
290 sv-command setcurrent 1 301 sv-command setcurrent 1
291 sv-command delete pane 302 sv-command delete pane
292 sv-command zoom in 303 sv-command zoom in
293 sv-command setcurrent 1 2 304 sv-command setcurrent 1 2
294 sv-command set layer Normalize-Columns off 305 sv-command set layer Normalize-Columns off
295 sv-command set layer Normalize-Visible-Area on 306 sv-command set layer Normalize-Visible-Area on
296 sleep 20 307 sleep 20
297 sv-command set speedup 0 308 sv-command set speed 100
298 sleep 10 309 sleep 10
299 sv-command select none 310 sv-command select none
300 # fade_out 311 # fade_out
301 312
302 # if [ -n "$done_playback_bits" ]; then 313 # if [ -n "$done_playback_bits" ]; then
418 selection_bits() 429 selection_bits()
419 { 430 {
420 # reset 431 # reset
421 sv-command set overlays 1 432 sv-command set overlays 1
422 sv-command set zoomwheels 0 433 sv-command set zoomwheels 0
423 sv-command resize 1000 500 434 resize_normal
424 sv-command zoom default 435 sv-command zoom default
425 sv-command setcurrent 2 436 sv-command setcurrent 2
426 sv-command delete pane 437 sv-command delete pane
427 # if [ -n "$done_playback_bits" ]; then 438 # if [ -n "$done_playback_bits" ]; then
428 sv-command setcurrent 1 2 439 sv-command setcurrent 1 2
464 base=$((base + 2)) 475 base=$((base + 2))
465 sv-command addselect $base $base.3 476 sv-command addselect $base $base.3
466 sleep 4 477 sleep 4
467 sv-command delete layer 478 sv-command delete layer
468 sleep 16 479 sleep 16
469 sv-command set speedup -50 480 sv-command set speed 66
470 sleep 14 481 sleep 14
471 sv-command set speedup 50 482 sv-command set speed 150
472 sleep 8 483 sleep 8
473 sv-command set speedup 100 484 sv-command set speed 200
474 sleep 5 485 sleep 5
475 sv-command set speedup 200 486 sv-command set speed 400
476 fade_out 487 fade_out
477 # sleep 10 488 # sleep 10
478 sv-command select none 489 sv-command select none
479 sv-command set overlays 2 490 sv-command set overlays 2
480 sv-command set propertyboxes 1 491 sv-command set propertyboxes 1
505 516
506 sleep 2 517 sleep 2
507 load_a_file 518 load_a_file
508 sv-command loop on 519 sv-command loop on
509 520
510 sv-command resize 1000 500 521 resize_normal
511 show_stuff 522 show_stuff
512 sleep 5 523 sleep 5
513 sleep 20 524 sleep 20
514 playback_bits 525 playback_bits
515 526
516 #sleep 10 527 #sleep 10
517 sv-command resize 1000 700 528 resize_big
518 sv-command zoom default 529 sv-command zoom default
519 show_stuff 530 show_stuff
520 onset_bits 531 onset_bits
521 532
522 selection_bits 533 selection_bits
523 534
524 #sv-command resize 1000 700 535 #sv-command resize 1000 700
525 536
526 #sleep 10 537 #sleep 10
527 sv-command resize 1000 700 538 resize_big
528 #show_stuff 539 #show_stuff
529 spectrogram_bits 540 spectrogram_bits
530 541
531 #sleep 10 542 #sleep 10
532 #sv-command jump 0 543 #sv-command jump 0