-
Notifications
You must be signed in to change notification settings - Fork 5
/
run.sh
executable file
·69 lines (64 loc) · 1.31 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
usage="opciones:
\n\t -u|--usb: midi input por cable midi (default: midi input por vkeybd)
\n\t -r|--rate <value>: setear valor de frecuencia de muestreo (default: 44100) valores posibles: {44100, 48000, 96000...}
\n\t -p|--period <value>: setear buffer size (default: 256) usar potencias de 2"
mode=virtual
rate=44100
buf=256
while [[ $# > 0 ]]
do
key="$1"
case $key in
-u|--usb)
mode=usb
;;
-r|--rate)
rate="$2"
shift
;;
-p|--period)
buf="$2"
shift
;;
-h|--help)
echo -e $usage
exit
;;
*)
;;
esac
shift
done
killall jackd
jackd -R -d alsa -r $rate -p $buf &
sleep 1
jalv.gtk http://example.org/raffo &
plugin="$(echo $!)"
sleep 1
a2jmidid -e &
sleep 1
case $mode in
virtual)
vkeybd &
sleep 1
aconnect "Virtual Keyboard":0 "Midi Through":0
;;
usb)
aconnect "USB Midi":0 "Midi Through":0
;;
esac
jack_connect "Raffo Synth":output system:playback_1
jack_connect "Raffo Synth":output system:playback_2
jack_connect "a2j:Midi Through [14] (capture): Midi Through Port-0" "Raffo Synth":midi
echo "Press <q> to quit"
while :
do
read -n 1 esc
if [[ $esc = q ]]
then
break
fi
done
kill -9 $plugin
killall jackd
killall vkeybd