Here’s what I’ve come up with so far.
In /usr/lib/systemd/system, there are a number of relevant .service files. One of them is jack.service, which reads (I’m using gedit):
ExecStart=/usr/bin/jackd -v -t 2000 -P 75 -d alsa -d hw:pisound -r 48000 -p 128 -n 2 -X seq -s -S
I want to start pd-l2ork before jack is started, so that the MIDI connection from PD to touchosc is automatically made; in qjackctl that looks like this:
What I’ve tried so far, based on info I found on how things are done with
systemd, is make a file called puredata.service in /usr/lib/systemd/system with this content:
Description=Pure Data service
ExecStart=/usr/bin/pd-l2ork -rt -audiobuf 20 -inchannels 2 -outchannels 2 -alsamidi -mididev 0 %U
Note that I’ve taken over the After=sound.target from jack.service, and in that file changed it to After=puredata.service, so that the Puredata starts before jack does and Puredata’s MIDI output should be available in Jack.
After this, I’ve done:
sudo systemctl start puredata
sudo systemctl enable puredata
sudo systemctl stop puredata
which to my knowledge should make it available at boot.
It’s not working yet though… no PD at boot. Maybe I’m missing something?
Also, in a fresh boot, when I stop the jack service, then manually start puredata, then start the jack service again, the Puredata MIDI output is available in the ALSA MIDI Connection window, but I can’t get it to auto-connect to the touchosc input; even if I make a default patchbay for that connection and tick Activate Patchbay Persistence in qjackctl’s Setup - Options page.
Perhaps there is a different/better method of approaching all of this? Again, what I’m looking for is auto-starting a PD patch and have the PD MIDI output connected to the touchosc MIDI input.