Hey all
I'd like to know whether it is possible to modify Pd.app in a way that it starts an included patch automatically with included preference settings? In other words, I'd like to make a stand-alone app from a patch.
From what I was able to figure out, double-clicking the Pd.app starts Contents/MacOS/Pd which in turn seems to launch Contents/Resources/bin/pd. I tried to replace the Pd executable by a shell script that would start Contents/Resources/bin/pd with the desired flags, but that seemed to go into an endless loop of starting pd processes.
Any hints appreciated.
Roman
you could just add "-open {your_path}" into prefs?
Antoine Rousseau http://www.metalu.net http://metalu.net __ http://www.metaluachahuter.com/ http://www.metaluachahuter.com/compagnies/al1-ant1/
2017-12-13 12:46 GMT+01:00 Roman Haefeli reduzent@gmail.com:
Hey all
I'd like to know whether it is possible to modify Pd.app in a way that it starts an included patch automatically with included preference settings? In other words, I'd like to make a stand-alone app from a patch.
From what I was able to figure out, double-clicking the Pd.app starts Contents/MacOS/Pd which in turn seems to launch Contents/Resources/bin/pd. I tried to replace the Pd executable by a shell script that would start Contents/Resources/bin/pd with the desired flags, but that seemed to go into an endless loop of starting pd processes.
Any hints appreciated.
Roman
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
I've done it for egregore source. I don't remember exactly how, but the code is here: https://sourceforge.net/p/chdh-egregore/code/ci/master/tree/ here you have an empty app that's launch a script automatically: https://sourceforge.net/p/chdh-egregore/code/ci/master/tree/template/ see generate_release.sh to see ho the final app is done. best
Nicolas
Le 13/12/2017 à 13:41, Roman Haefeli a écrit :
On Mit, 2017-12-13 at 13:39 +0100, Antoine Rousseau wrote:
you could just add "-open {your_path}" into prefs?
I actually would prefer such a simple approach, but how can I include the prefs file into the app?
Roman
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
how can I include the prefs file into the app?
sorry I can't see a way to do this... certainly a macos expert (Dan?) will have a better idea.
Antoine Rousseau http://www.metalu.net http://metalu.net __ http://www.metaluachahuter.com/ http://www.metaluachahuter.com/compagnies/al1-ant1/
2017-12-13 13:41 GMT+01:00 Roman Haefeli reduzent@gmail.com:
On Mit, 2017-12-13 at 13:39 +0100, Antoine Rousseau wrote:
you could just add "-open {your_path}" into prefs?
I actually would prefer such a simple approach, but how can I include the prefs file into the app?
Roman
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
I guess I figured it out.
From the scripts in <pd>/mac/ I found that <app>/Contents/MacOS/Pd is actually a wish binary, which starts <app>/Contents/Resources/tcl/pd- gui.tcl, which in turn starts the pd binary in <app>/Contents/Resources/bin/pd.
So what I do now is to edit the appropriate line in pd-gui.tcl (currently 781) and specify the desired start options there:
exec -- $pd_exec -guiport $::port -open ../patches/mypatch.pd &
Seems to work.
BTW, I'm amazed how easy it is to build a Pd.app on macOS. Nice work, Dan!
Roman
On Mit, 2017-12-13 at 13:41 +0100, Roman Haefeli wrote:
On Mit, 2017-12-13 at 13:39 +0100, Antoine Rousseau wrote:
you could just add "-open {your_path}" into prefs?
I actually would prefer such a simple approach, but how can I include the prefs file into the app?
Roman
On 2017-12-13 14:56, Roman Haefeli wrote:
I guess I figured it out.
From the scripts in <pd>/mac/ I found that <app>/Contents/MacOS/Pd is actually a wish binary, which starts <app>/Contents/Resources/tcl/pd- gui.tcl, which in turn starts the pd binary in <app>/Contents/Resources/bin/pd.
actually, you can put a plist file named "org.puredata.pd" (without the ".plist" suffix) into the app-bundle, and Pd will read it. afaict, the location of the file should be "Pd.app/Contents/" (but might be "Pd.app/Contents/Resources/"). this file (if present) will get read before any user preferences. however, user preferences can still override any settings therein, and thus modify the expected preferences).
So what I do now is to edit the appropriate line in pd-gui.tcl (currently 781) and specify the desired start options there:
exec -- $pd_exec -guiport $::port -open ../patches/mypatch.pd &
here at least you could also do a "-noprefs" (but then, the user might want to store their soundcard setups).
it might be *quit* nice to be able to use a different namespace for your applications settings, without having to recompile. probably using a cmdline flag.
fgadmr IOhannes
You can set the audio settings from within a patch by sending a message to pd.
The message would look like this:
[; pd audio-dialog 0 0 0 0 1 0 0 0 0 0 0 0 2 0 0 0 44100 25 -1 128]
The values are:
[; pd audio-dialog indev1 indev2 indev3 indev4 inchan1 inchan2 inchan3 inchan4 outdev1 outdev2 outdev3 outdev4 outchan1 outchan2 outchan3 outchan4 samplerate delay callback blocksize(
The arguments correspond to the fields of the audio setting window (in different order).
Maybe it is necessary to send the following message afterwards:
[; pd save-preferences(
At least it seems to be necessary to somehow close the invisible window, or pd gives an error "too many windows" after too many settings.
You can open the dialog by sending:
[; pd audio-properties 1(
Sorry i don't have the knowledge on how to do this correctly, i just figured that out from looking at the source code (tcl/dialog_audio.tcl) and this one post i found about it. [1]
best, ingo
[1] http://forum.critterandguitari.com/t/audio-settings-set-pure-datas-delay-mse...
On 13/12/17 12:46, Roman Haefeli wrote:
Hey all
I'd like to know whether it is possible to modify Pd.app in a way that it starts an included patch automatically with included preference settings? In other words, I'd like to make a stand-alone app from a patch.
From what I was able to figure out, double-clicking the Pd.app starts Contents/MacOS/Pd which in turn seems to launch Contents/Resources/bin/pd. I tried to replace the Pd executable by a shell script that would start Contents/Resources/bin/pd with the desired flags, but that seemed to go into an endless loop of starting pd processes.
Any hints appreciated.
Roman
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
I currently see no need to be able to change these settings from within the patch, so I am happy to be able to set up the environment _before_ launching the path. But anyway, good to know how this works.
Roman
On Mit, 2017-12-13 at 22:28 +0100, Ingo Stock wrote:
You can set the audio settings from within a patch by sending a message to pd.
The message would look like this:
[; pd audio-dialog 0 0 0 0 1 0 0 0 0 0 0 0 2 0 0 0 44100 25 -1 128]
The values are:
[; pd audio-dialog indev1 indev2 indev3 indev4 inchan1 inchan2 inchan3 inchan4 outdev1 outdev2 outdev3 outdev4 outchan1 outchan2 outchan3 outchan4 samplerate delay callback blocksize(
The arguments correspond to the fields of the audio setting window (in different order).
Maybe it is necessary to send the following message afterwards:
[; pd save-preferences(
At least it seems to be necessary to somehow close the invisible window, or pd gives an error "too many windows" after too many settings.
You can open the dialog by sending:
[; pd audio-properties 1(
Sorry i don't have the knowledge on how to do this correctly, i just figured that out from looking at the source code (tcl/dialog_audio.tcl) and this one post i found about it. [1]
best, ingo
[1] http://forum.critterandguitari.com/t/audio-settings-set-pure-datas-de lay-msec-for-one-single-patch/1337/8
On 13/12/17 12:46, Roman Haefeli wrote:
Hey all
I'd like to know whether it is possible to modify Pd.app in a way that it starts an included patch automatically with included preference settings? In other words, I'd like to make a stand-alone app from a patch.
From what I was able to figure out, double-clicking the Pd.app starts Contents/MacOS/Pd which in turn seems to launch Contents/Resources/bin/pd. I tried to replace the Pd executable by a shell script that would start Contents/Resources/bin/pd with the desired flags, but that seemed to go into an endless loop of starting pd processes.
Any hints appreciated.
Roman
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
On 2017-12-13 22:28, Ingo Stock wrote:
You can set the audio settings from within a patch by sending a message to pd.
The message would look like this:
[; pd audio-dialog 0 0 0 0 1 0 0 0 0 0 0 0 2 0 0 0 44100 25 -1 128]
two things:
#1 while not being vanilla, i think the "mediasettings" library is a better approach to that problem (but then of course, i'm the author). it kind of guarantees a stable API on the patch level (the messages you are using are an implementation detail without any guarantees). it also makes it possible to only set the thing you want to (e.g. you can set the latency without resetting the audio device to the built-in speakers). it also allows you to query all the names (and current state) so you can actually build an audio settings dialog within Pd (does not breaking the aesthetics of your application).
#2 more important i'm not sure how your suggestion helps. i mean: if you hand out an application two 5 people (or the whole world), which values would you *actually* put in there? is "0" a good choice, just because it routes to the built-in microphone and speakers on your system? on my PC it might be the unconnected hdmi audio. what if the user wants to play back via the nice PA connected through their USB interface? would they have to re-set the audio settings whenever the patch crashes?
gfamsdr IOhannes