-
Notifications
You must be signed in to change notification settings - Fork 1
/
startup.sh
executable file
·48 lines (37 loc) · 1.43 KB
/
startup.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
#!/bin/bash
# wait for booting to complete
# sleep 1
# necessary to start jack
export DISPLAY=:0
# end previous processes
killall -9 jackd || echo "jackd was not running."
killall -9 sooperlooper || echo "sooperlooper was not running."
sleep 1 # seconds
# trick to boot without dbus maybe?
# export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
# start jack server
# this line should also be in ~/.jackdrc, because if the below line fails, sooperlooper will start its own jackd using the config in ~/.jackdrc
/usr/bin/jackd --no-realtime --verbose -dalsa -r44100 -p512 -n3 -dhw:1 -s > /home/pi/loop-baby/jackd_errors.log 2>&1 &
# wait for jack to start
sleep 7
# start sooperlooper
sooperlooper -p 9951 -l 1 -c 2 -t 20 &
# wait for sooperlooper to start
sleep 1
# confirm port names
jack_lsp -c
jack_connect system:capture_1 sooperlooper:common_in_1 || echo "error connecting audio (1)"
jack_connect sooperlooper:common_out_1 system:playback_1 || echo "error connecting audio (2)"
jack_connect sooperlooper:common_out_2 system:playback_2 || echo "error connecting audio (3)"
# connect USB Midi to Sooperlooper, if it is found
midi_in=`aconnect -i | grep -m1 'USB Midi' | awk '{print $2}'`
midi_out=`aconnect -o | grep -m1 'sooperlooper' | awk '{print $2}'`
echo $midi_in
echo $midi_out
if [ -z "$midi_in" ]
then
echo "No Midi found"
else
echo "Connecting USB Midi to Sooperlooper"
aconnect $midi_in:0 $midi_out:0
fi