Dear List,
I've been working a lot with Python and Pd lately, and i would like to have better means of communication between the two. I know next to nothing about inter-process communication, I know nothing about FUDI (except that it's the protocol used by pdsend and pdreceive), and I have no idea what pdreceive was originally designed for. I've only used the subprocess (formerly popen) module in python, but i don't know how to use it with streams of messages coming from the standard output of a running process. I don't want to use libpd for now because i only need to send and receive simple messages between Python and Pd.
Can someone please provide a few hints ?
Cheers!
Pierre.
Hi,
I've succeed in make Pd and Python communicate by OSC (no sure it's the best way) with mrpeach library. I'll try to find the simple version of my patch/script but if not, you know now it's possible.
To be continued...
Cheers
01ivier
Le 21.01.2013 15:42, Pierre Massat a écrit :
Dear List,
I've been working a lot with Python and Pd lately, and i would like to have better means of communication between the two. I know next to nothing about inter-process communication, I know nothing about FUDI (except that it's the protocol used by pdsend and pdreceive), and I have no idea what pdreceive was originally designed for. I've only used the subprocess (formerly popen) module in python, but i don't know how to use it with streams of messages coming from the standard output of a running process. I don't want to use libpd for now because i only need to send and receive simple messages between Python and Pd.
Can someone please provide a few hints ?
Cheers!
Pierre.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
FUDI is not just netsend/netreceive, its all Pd messages, including what pd-gui sends to pd. Its basically space-separated data terminated with a semi-colon and a newline i.e. ;\n
.hc
On 01/21/2013 09:42 AM, Pierre Massat wrote:
Dear List,
I've been working a lot with Python and Pd lately, and i would like to have better means of communication between the two. I know next to nothing about inter-process communication, I know nothing about FUDI (except that it's the protocol used by pdsend and pdreceive), and I have no idea what pdreceive was originally designed for. I've only used the subprocess (formerly popen) module in python, but i don't know how to use it with streams of messages coming from the standard output of a running process. I don't want to use libpd for now because i only need to send and receive simple messages between Python and Pd.
Can someone please provide a few hints ?
Cheers!
Pierre.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
----- Original Message -----
From: Hans-Christoph Steiner hans@at.or.at To: pd-list@iem.at Cc: Sent: Monday, January 21, 2013 11:17 AM Subject: Re: [PD] Pd --> Python, IPC, FUDI, pdreceive, et cetera !
FUDI is not just netsend/netreceive, its all Pd messages, including what pd-gui sends to pd. Its basically space-separated data terminated with a semi-colon and a newline i.e. ;\n
Someone should add the description of the FUDI protocol to the man pages for pdsend/pdreceive, since its not a standard protocol and is slightly different from the messages people are used to sending from within the gui (i.e., without a terminating semicolon). -Jonathan
.hc
On 01/21/2013 09:42 AM, Pierre Massat wrote:
Dear List,
I've been working a lot with Python and Pd lately, and i would like to
have
better means of communication between the two. I know next to nothing about inter-process communication, I know nothing about FUDI (except that it's the protocol used by pdsend and
pdreceive),
and I have no idea what pdreceive was originally designed for. I've
only
used the subprocess (formerly popen) module in python, but i don't know
how
to use it with streams of messages coming from the standard output of a running process. I don't want to use libpd for now because i only need to send and
receive
simple messages between Python and Pd.
Can someone please provide a few hints ?
Cheers!
Pierre.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Assuming that i can find a description of this protocol, how would I use it to communicate between Pd and Python ? I guess this more a question to ask in a Python forum, but still, i'd love to have at least some hints...
Cheers,
Pierre.
2013/1/21 Jonathan Wilkes jancsika@yahoo.com
----- Original Message -----
From: Hans-Christoph Steiner hans@at.or.at To: pd-list@iem.at Cc: Sent: Monday, January 21, 2013 11:17 AM Subject: Re: [PD] Pd --> Python, IPC, FUDI, pdreceive, et cetera !
FUDI is not just netsend/netreceive, its all Pd messages, including what pd-gui sends to pd. Its basically space-separated data terminated with a semi-colon and a newline i.e. ;\n
Someone should add the description of the FUDI protocol to the man pages for pdsend/pdreceive, since its not a standard protocol and is slightly different from the messages people are used to sending from within the gui (i.e., without a terminating semicolon).
-Jonathan
.hc
On 01/21/2013 09:42 AM, Pierre Massat wrote:
Dear List,
I've been working a lot with Python and Pd lately, and i would like to
have
better means of communication between the two. I know next to nothing about inter-process communication, I know nothing about FUDI (except that it's the protocol used by pdsend and
pdreceive),
and I have no idea what pdreceive was originally designed for. I've
only
used the subprocess (formerly popen) module in python, but i don't know
how
to use it with streams of messages coming from the standard output of a running process. I don't want to use libpd for now because i only need to send and
receive
simple messages between Python and Pd.
Can someone please provide a few hints ?
Cheers!
Pierre.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Try: man pdsend man pdreceive There's a thread where I think matju and Tim Blechmann gives examples of how to use them on the command line. -Jonathan
From: Pierre Massat pimassat@gmail.com To: Jonathan Wilkes jancsika@yahoo.com Cc: Hans-Christoph Steiner hans@at.or.at; "pd-list@iem.at" pd-list@iem.at Sent: Monday, January 21, 2013 12:52 PM Subject: Re: [PD] Pd --> Python, IPC, FUDI, pdreceive, et cetera !
Assuming that i can find a description of this protocol, how would I use it to communicate between Pd and Python ? I guess this more a question to ask in a Python forum, but still, i'd love to have at least some hints...
Cheers,
Pierre.
2013/1/21 Jonathan Wilkes jancsika@yahoo.com
----- Original Message -----
From: Hans-Christoph Steiner hans@at.or.at To: pd-list@iem.at Cc: Sent: Monday, January 21, 2013 11:17 AM Subject: Re: [PD] Pd --> Python, IPC, FUDI, pdreceive, et cetera !
FUDI is not just netsend/netreceive, its all Pd messages, including what pd-gui sends to pd. Its basically space-separated data terminated with a semi-colon and a newline i.e. ;\n
Someone should add the description of the FUDI protocol to the man pages for pdsend/pdreceive, since its not a standard protocol and is slightly different from the messages people are used to sending from within the gui (i.e., without a terminating semicolon). -Jonathan
.hc
On 01/21/2013 09:42 AM, Pierre Massat wrote:
Dear List,
I've been working a lot with Python and Pd lately, and i would like to
have
better means of communication between the two. I know next to nothing about inter-process communication, I know nothing about FUDI (except that it's the protocol used by pdsend and
pdreceive),
and I have no idea what pdreceive was originally designed for. I've
only
used the subprocess (formerly popen) module in python, but i don't know
how
to use it with streams of messages coming from the standard output of a running process. I don't want to use libpd for now because i only need to send and
receive
simple messages between Python and Pd.
Can someone please provide a few hints ?
Cheers!
Pierre.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On 21/01/13 18:52, Pierre Massat wrote:
Assuming that i can find a description of this protocol, how would I use it to communicate between Pd and Python ? I guess this more a question to ask in a Python forum, but still, i'd love to have at least some hints...
In python use sockets... in Pd use [netreceive] - I'm sure there's loads of good examples out there and I'm working on some pygtk for a project (but it's still very very early). Menwhile this is a very minimal python -> Pd example
Lorenzo.
Cheers,
Pierre.
2013/1/21 Jonathan Wilkes <jancsika@yahoo.com mailto:jancsika@yahoo.com>
----- Original Message ----- > From: Hans-Christoph Steiner <hans@at.or.at <mailto:hans@at.or.at>> > To: pd-list@iem.at <mailto:pd-list@iem.at> > Cc: > Sent: Monday, January 21, 2013 11:17 AM > Subject: Re: [PD] Pd --> Python, IPC, FUDI, pdreceive, et cetera ! > > > FUDI is not just netsend/netreceive, its all Pd messages, including what > pd-gui sends to pd. Its basically space-separated data terminated with a > semi-colon and a newline i.e. ;\n Someone should add the description of the FUDI protocol to the man pages for pdsend/pdreceive, since its not a standard protocol and is slightly different from the messages people are used to sending from within the gui (i.e., without a terminating semicolon). -Jonathan > > .hc > > On 01/21/2013 09:42 AM, Pierre Massat wrote: >> Dear List, >> >> I've been working a lot with Python and Pd lately, and i would like to > have >> better means of communication between the two. >> I know next to nothing about inter-process communication, I know nothing >> about FUDI (except that it's the protocol used by pdsend and > pdreceive), >> and I have no idea what pdreceive was originally designed for. I've > only >> used the subprocess (formerly popen) module in python, but i don't know > how >> to use it with streams of messages coming from the standard output of a >> running process. >> I don't want to use libpd for now because i only need to send and > receive >> simple messages between Python and Pd. >> >> Can someone please provide a few hints ? >> >> Cheers! >> >> Pierre. >> >> >> >> _______________________________________________ >> Pd-list@iem.at <mailto:Pd-list@iem.at> mailing list >> UNSUBSCRIBE and account-management -> > http://lists.puredata.info/listinfo/pd-list >> > > _______________________________________________ > Pd-list@iem.at <mailto:Pd-list@iem.at> mailing list > UNSUBSCRIBE and account-management -> > http://lists.puredata.info/listinfo/pd-list > _______________________________________________ Pd-list@iem.at <mailto:Pd-list@iem.at> mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi,
Lorenzo Sutton wrote:
In python use sockets... in Pd use [netreceive] - I'm sure there's loads of good examples out there and I'm working on some pygtk for a project (but it's still very very early). Menwhile this is a very minimal python -> Pd example
it seems your example is missing the newline (;\n). iirc I've had a few pd lockups when sending lots of messages from Processing without the newline.
Cheers, Charles
On 22/01/13 17:06, Charles Goyard wrote:
Hi,
Lorenzo Sutton wrote:
In python use sockets... in Pd use [netreceive] - I'm sure there's loads of good examples out there and I'm working on some pygtk for a project (but it's still very very early). Menwhile this is a very minimal python -> Pd example
it seems your example is missing the newline (;\n). iirc I've had a few pd lockups when sending lots of messages from Processing without the newline.
Good to know, and easy to add to the script. And of course you wouldn't really be hard-coding stuff like that. Just for curiosity, how many is 'lots'?.
Lorenzo.
Cheers, Charles
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2013-01-23 10:22, Lorenzo Sutton wrote:
it seems your example is missing the newline (;\n). iirc I've had a few pd lockups when sending lots of messages from Processing without the newline.
Good to know, and easy to add to the script. And of course you wouldn't really be hard-coding stuff like that. Just for curiosity, how many is 'lots'?.
[netsend] will only emit the message once it receives the terminator. so it has to buffer all the data, till it encounters the terminator. and since the term never comes, it will eventually get out of memory. (and long before that it will start to choke, but *when* is really depending on your system)
fgam,sdr IOhannes
On 23/01/13 10:28, IOhannes m zmoelnig wrote:
On 2013-01-23 10:22, Lorenzo Sutton wrote:
it seems your example is missing the newline (;\n). iirc I've had a few pd lockups when sending lots of messages from Processing without the newline.
Good to know, and easy to add to the script. And of course you wouldn't really be hard-coding stuff like that. Just for curiosity, how many is 'lots'?.
Actually... I'm not sure the "\n" is really so relevant for *sending* to Pd, as if I understand correctly the ";" is...
[netsend] will only emit the message once it receives the terminator. so it has to buffer all the data, till it encounters the terminator. and since the term never comes, it will eventually get out of memory. (and long before that it will start to choke, but *when* is really depending on your system)
Ok.. but in the example there is no [netsend]... there is [netreceive] and Python is doing the sending through sockets.
The attached seem to work fine sending the 10000 messages (ready for a [tabwrite]) down until 0.08s (80 ms) interval, even with dsp turned on. As soon as the INTERVAL goes below 0.08s (see python script) Pd starts to choke badly on my system. Again adding an "\n" doesn't seem to be relevant.
Lorenzo.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2013-01-23 12:45, Lorenzo Sutton wrote:
On 23/01/13 10:28, IOhannes m zmoelnig wrote:
On 2013-01-23 10:22, Lorenzo Sutton wrote:
it seems your example is missing the newline (;\n). iirc I've had a few pd lockups when sending lots of messages from Processing without the newline.
Good to know, and easy to add to the script. And of course you wouldn't really be hard-coding stuff like that. Just for curiosity, how many is 'lots'?.
Actually... I'm not sure the "\n" is really so relevant for *sending* to Pd, as if I understand correctly the ";" is...
[netsend] will only emit the message once it receives the terminator. so it has to buffer all the data, till it encounters the terminator. and since the term never comes, it will eventually get out of memory. (and long before that it will start to choke, but *when* is really depending on your system)
Ok.. but in the example there is no [netsend]... there is [netreceive] and Python is doing the sending through sockets.
that was a typo on my side, i meant to write [netreceive].
([netsend] doesn't need to wait for a terminating semicolon/newline, since it gets pre-parsed Pd-messages any how; only [netreceive] has to translate byte-streams into Pd-messages, and it does so by splitting the streams at ";\n")
fgamsdr IOhannes
On 23/01/13 12:50, IOhannes m zmoelnig wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2013-01-23 12:45, Lorenzo Sutton wrote:
On 23/01/13 10:28, IOhannes m zmoelnig wrote:
On 2013-01-23 10:22, Lorenzo Sutton wrote:
it seems your example is missing the newline (;\n). iirc I've had a few pd lockups when sending lots of messages from Processing without the newline.
Good to know, and easy to add to the script. And of course you wouldn't really be hard-coding stuff like that. Just for curiosity, how many is 'lots'?.
Actually... I'm not sure the "\n" is really so relevant for *sending* to Pd, as if I understand correctly the ";" is...
[netsend] will only emit the message once it receives the terminator. so it has to buffer all the data, till it encounters the terminator. and since the term never comes, it will eventually get out of memory. (and long before that it will start to choke, but *when* is really depending on your system)
Ok.. but in the example there is no [netsend]... there is [netreceive] and Python is doing the sending through sockets.
that was a typo on my side, i meant to write [netreceive].
([netsend] doesn't need to wait for a terminating semicolon/newline, since it gets pre-parsed Pd-messages any how; only [netreceive] has to translate byte-streams into Pd-messages, and it does so by splitting the streams at ";\n")
Ok... but sending this from python works as expected (i.e. each message is separated at the ';'):
s.send("hello 1;world 2;foo 3;bas\n4;bat 5;")
Lorenzo.
fgamsdr IOhannes -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAlD/zoAACgkQkX2Xpv6ydvRuyACfQOwzcISnF9p1KDgYZFOms6Dc tlAAn0VziNfZBSJvNztjBWFuCvhVTUNf =DoSy -----END PGP SIGNATURE-----
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Lorenzo Sutton wrote:
Just for curiosity, how many is 'lots'?.
"lots" is a bit more than "many" I think :).
Seriously I don't know, but I was basically hooking a slider in processing/controlP5 (for setting a crossfade length) to a netreceive in pd. I could lock (or crash, don't remember) pd in a few slider moves, so it's not that much of "lots" (much being less than many ?).
Cheers, Charles
Well,
You can look at the attached archive. I repeat that I'm not sure it a good way... But it's a working way... :-p
Cheers
01ivier
Le 21.01.2013 15:42, Pierre Massat a écrit :
Dear List,
I've been working a lot with Python and Pd lately, and i would like to have better means of communication between the two. I know next to nothing about inter-process communication, I know nothing about FUDI (except that it's the protocol used by pdsend and pdreceive), and I have no idea what pdreceive was originally designed for. I've only used the subprocess (formerly popen) module in python, but i don't know how to use it with streams of messages coming from the standard output of a running process. I don't want to use libpd for now because i only need to send and receive simple messages between Python and Pd.
Can someone please provide a few hints ?
Cheers!
Pierre.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list