[PD] help on bash script

Roman Haefeli reduzent at gmail.com
Mon Nov 9 13:25:34 CET 2020


On Mon, 2020-11-09 at 12:54 +0100, Jakob Laue wrote:
> Hey friends,
> i have a raspberry pi that executes a bash script on startup. Inside
> this bash script I want two things to happen.
> 1) start my pd patch
> 2) connect my launchpad mini (connected via usb) to pd using the
> aconnect-command
>  
>  
> ..i think i have to use aconnect because in pd itself i only see alsa
> midi as a midi device. 
>  
>  
> At the moment, my bash script only looks like this:
>  
> #!/bin/bash
> 
> sudo /usr/local/bin/pd -nogui -rt -open
> /home/pi/Documents/RSP/RSP/myPatch.pd
> 
> aconnect 'Pure Data':1 'Launchpad Mini':0
> 
> aconnect 'Launchpad Mini':0 'Pure Data':0
> 
>  
> 
> The problem is that the aconnect-commands seem to be not executed or
> executed too early because the virtual midi connections are not made.
> 
> The aconnect-commands have to be done after pd is started, so how
> could I change the script to wait until pd is done loading?


Poor man's solution:

  put a 'sleep 5' after starting Pd.

A slightly more advanced way:

  while ! aconnect --list | grep "Pure Data"; do sleep 0.1;

  Put that after firing up Pd. It continues only after "Pure Data"
  appears in the list of available MIDI ports.

Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20201109/11415b59/attachment.sig>


More information about the Pd-list mailing list