echo "rc_starts_pd: strating pd"
pd -rt -nogui -alsa -audiodev 4 -audiobuf 10 -alsamidi $PATCH &
# renice pd for much higher priority
renice -10 $(pidof pd)
# wait for pd to initialize
KA=$(aconnect -i -o | grep "Pure Data")
while [ "$KA" = "" ]
do
sleep 1
echo "rc_starts_pd: pd alsamidi not ready"
KA=$(aconnect -i -o | grep "Pure Data")
done
echo "rc_starts_pd: pd alsmidi is ready"
# connect the UA-25 midi to Pure Data
echo "rc_starts_pd: alsa midi connect 'UA-25' <-> 'Pure Data'"
aconnect 'UA-25' 'Pure Data'
aconnect 'Pure Data':1 'UA-25':0
# connect the VIEWCON dongle midi to Pure Data
echo "rc_starts_pd: alsa midi connect 'VIEWCON..' <-> 'Pure Data'"
aconnect 'VIEWCON..' 'Pure Data'
aconnect 'Pure Data':1 'VIEWCON..':0
----------------------
It starts Pd, then waits until the PD midi device is registered with ALSA before trying to connect two Midi devices: UA-25 & VIEWCON..
You could run the script from you ~/.bash_profile which would call it as soon as the user is logged in. I use this:
---------------------
# do nothing if this is a ssh session
if [ "$SSH_CLIENT" != "" ] ; then
exit
fi
rc_starts_pd
---------------------
It's important to ignore ssh sessions since, if you're like me, and you want to login to your (wearable) computer via SSH to check something, you don't want to launch a new instance of pd.
Subject: Re: [PD] ALSA MIDI problem
Date: January 21, 2014 at 8:20:27 AM EST
Ok, I find a solution :
$ aconnect -i
client 0: 'System' [type=noyau]
0 'Timer '
1 'Announce '
client 14: 'Midi Through' [type=noyau]
0 'Midi Through Port-0'
client 20: 'USB Uno MIDI Interface' [type=noyau]
0 'USB Uno MIDI Interface MIDI 1'
client 128: 'Pure Data' [type=utilisateur]
1 'Pure Data Midi-Out 1'
$ aconnect -o
client 14: 'Midi Through' [type=noyau]
0 'Midi Through Port-0'
client 20: 'USB Uno MIDI Interface' [type=noyau]
0 'USB Uno MIDI Interface MIDI 1'
client 128: 'Pure Data' [type=utilisateur]
0 'Pure Data Midi-In 1'
then :
$ aconnect 128:1 20:0
Now, how can i keep this configuration each time i reboot my laptop ?
++
Jack
--------
Dan Wilcox
@danomatika