[PD] jack connect after startup

Peter P. peterparker at fastmail.com
Mon Aug 21 15:59:53 CEST 2017


* IOhannes m zmoelnig <zmoelnig at iem.at> [2017-08-21 15:35]:
> On 2017-08-21 14:03, Peter P. wrote:
> > Hi,
> > 
> > I am trying to make Pd connect to certain jack ports after startup.
> > While on Linux I could use the jack_connect command line program to do
> > so I am trying to make do from a bash script after having started Pd.
> > Stupid me I am thinking of starting and detaching pd with -nogui in the
> > script and, upon successful startup, call jack_connect. So far I have 
> > 
> >  pd -nogui -rt -jack -jackname blah -nojackconnect -open superpatch.pd -send "goto 10" &
> >  pidpd=$!
> > 
> >  if [ $pidpd -eq 0 ]; then echo "Pd did not start successfully. Exiting script."; exit 1; else
> >  jack_connect pddel:output0 system:playback_1
> >  jack_connect pddel:output1 system:playback_2
> >  fi
> > 
> > But I would like to not detach Pd so that I can kill it and its script
> > conveniently with command-c. Apart from writing a better shell script
> > that eventually listens to the keyboard and then kills $pidpd, I wonder
> > if there is a vanilla way™ to connect to jack ports from within pd after
> > startup. I have not found something in the list archives so far.
> > 
> > Thanks for all hints! Peter
> 
> well, you could just foreground ("fg") the Pd-process after jack_connect
> did its job.
This does not work from within the script nor from the command line that
executed the script. For now I am using

 read -p "Press Enter to quit me."
 kill -KILL $pidpd

> however, i think the proper way is to have a separate process running
> that auto-connects Pd, e.g. qjackctl with it's patchbay feature.
> there are others around as well (google for jack session management).
Thanks for this hint.

By the way, it takes Pd some time to startup and create its jack output
ports. I have to wait for about 100ms (a nice race condition). What
could be a nice way to have Pd report being ready to the startup
script? Using pdreceive?

P



More information about the Pd-list mailing list