pure-data / pddp

Pure Data Documentation Project
9 stars 2 forks source link

better document [pd~] messages #182

Closed porres closed 6 months ago

porres commented 9 months ago

we currently say 'other' messages are only sent to 'receive' destinations/names in the patch, but that is misleading and not really true as I realized you can also send messages like "pd dsp 1" and messages to the patch file itself as well...

porres commented 9 months ago

damn, in my example I was using the '-send' flag to turn the dsp on when starting the sub process and I could swear it was working... well... not true! Not happening anymore and this flag doesn't really seem to work with [pd~] or I don't know how to use it

porres commented 9 months ago

ok, further tests confirms me that the '-send' flag doesn't really work with [pd~], I wonder if it is a bug @umlaeute - I will make changes in the help file to fix this.

umlaeute commented 9 months ago
  1. any specific reason to ping me especially? as in: i don't recall any specific involvement in [pd~] from my side (or is it just because i have to add my 2¢ everywhere? :-))

  2. which -send flag are you talking about?


after rethinking the 2nd question, i figure that you are talking about Pd's startup flags.

the "problem" is, that -send takes a single argument that contains the entire message to be sent.

if you us [pd~ start -nogui -send pd dsp 1 pd~-subprocess.pd( to launch the process, then you have the following list of arguments to the Pd process:

  1. -nogui
  2. -send
  3. pd
  4. dsp
  5. 1
  6. pd~subprocess.pd

as you can see, the single-argument that follows -send is just pd (so you are sending an empty message to the pd receiver; unfortunately such empty messages are simply discarded (they probably should be bangs)).

what you really want instead is:

  1. -nogui
  2. -send
  3. pd dsp 1
  4. pd~subprocess.pd

this can of course be done by escaping the spaces in the pd dsp 1 string like so:

[pd~ start -nogui -send pd\ dsp\ 1 pd~-subprocess.pd(

(note that in a unix shell you typically would write pd -nogui -send "pd dsp 1" pd~-subprocess.pd, using (single or double) quotes to pass a string with spaces, rather than backslash escaping; this is more convenient, but the quoting is really handled by the shell (so Pd just gets the correct string as a single argument); within Pd it's too late to introduce such quoting so imho we have to live with the backslashes)

porres commented 9 months ago

any specific reason to ping me especially? as in: i don't recall any specific involvement in [pd~] from my side (or is it just because i have to add my 2¢ everywhere? :-))

Cause you're a wizard who I thought could solve the mystery as you did :) I didn't think backslashes would work, I almost tried, I had tried quotes instead