Hello forum! I'm looking for a way to create an human computer interface (using any software or code) which would allow the user to enter simple datas and then pd would execute a patch using these datas, in the background, without the user viewing it. Do you think it's possible?? (ps: I use pd since a week)
sorry for my English
-
human computer interface possible with pd???
-
You can use scripts that launch Pd with a specific patch without the GUI. In a Unix system, from the terminal you'd do this like this:
/usr/bin/pd -nogui -open /home/username/pd_patches/patch_you_want_to_open.pd
this is an example of a Linux system. when you use patches like this, you have to make sure that the DSP will be turned on on load. You do this like this
[loadbang] | [dsp 1( | [s pd]
[loadbang] is an object, and [dsp 1( is a message. This is the way to write a patch in ASCII in forums...
If you want to terminate the patch and Pd, you can use a script with the following
killall pd
which would quit Pd. -
@alexandros said:
h a specific patch without the GUI. In a Unix system, from the terminal you'd do this like this:
Ok thks. Can i send parameters that would be used in the patch? like for example, with C code (ex: createProfil("name"; age); ) ?
-
@edouardshadow said:
Ok thks. Can i send parameters that would be used in the patch? like for example, with C code (ex: createProfil("name"; age); ) ?
You mean pass arguments to the patch? Not that I know of, but you can use pdsend to do that. Write a .txt file with values you want to send to Pd, each value occupying one line of text, followed by a semi-colon, and send that this way
/usr/bin/pdsend 3001 < /path/to/your/text.txt
Then in Pd, use this
[netreceive 3001] | [some_way_to_split_the_values]
This way you'll send data to Pd...
-
Ok thanks. I've tried it but no way to figure it out. I just want to send a simple data (like a 1-digit number) so making a .txt file seems to be a bit complex. Moreover, I tried putting only a number and a semi-colon in a txt file and then do your method but nothing appears in pd... Helpppp is it a problem of OS? (i'm using windows)
-
Hi edouardshadow and welcome to this forum,
If you want to send a single value to pd without using .txt files, you can do it using
pdsend
in the following way:First create a patch such as the one proposed by @alexandros:
[netreceive 3001] | [nbx]
Then, via the terminal, send execute something like this:
echo 1234\; | pdsend 9001
(I am on Linux, and I am not sure the
\
has to be included if you are using Windows or OS X)Now the number box in pd should show the value
1234
.I hope this helps. Take care,
Gilberto -
@gsagostinho nice thechnique, I wasn't aware of that. Minor and obvious correction, you typed
echo 1234\; | pdsend 9001
where it should beecho 1234\; | pdsend 3001
BTW, the\
works on OS X too..
Cheers -
It workssss!!! Thank you @gsagostinho ! It worked using "echo 1234; | pdsend 3001" (whithout the backslash) . Now i have to figure out how to make a C-coded program using these sends to control pd in background mode thanks again !
-
Hi
Using udp instead of tcp I was able to send numbers, lists or text
from a windows cmd boxC:\Program Files\Pd-0.43.4-extended\bin>echo 12 3 4 hello; | pdsend 9001 localhost udp
add a space and 1 after 9001 to change to udp
[netreceive 9001 1]
|
[unpack f f f s]
| | | |
[nbx][nbx][nbx][symbol] -
@alexandros oh, sorry for the typo, you are correct about it. So as for the
\
, it should be used on Linux and OS X while not on Windows then, correct?Take care,
Gilberto -
Correct! I finally figured out how to create a 'kind of' GUI for pure data. I wrote a java program that send values to pd via pdsend command. So I'm able to control a pd running patch directly from my java program. Interesting so thanks guys for your help! Still have some questions, but that's another topic