How can I best send key commands to pd when i do -nogui from console (no x windows) to be received with [key], for example? im on raspbian/linux....
my google searches have not ended so well on this subject
m
Quoth me.grimm, on 14/03/2013 16:57:
How can I best send key commands to pd when i do -nogui from console (no x windows) to be received with [key], for example? im on raspbian/linux....
my google searches have not ended so well on this subject
m
use [hid] and read this:
http://puredata.info/docs/tutorials/HowToReadHIDDevicesInLinuxWithoutBeingRo...
hmmm... i forgot about that. I will try it...
no way in vanilla i take it?
m
On Thu, Mar 14, 2013 at 1:17 PM, James Dunn james@4thharmonic.com wrote:
Quoth me.grimm, on 14/03/2013 16:57:
How can I best send key commands to pd when i do -nogui from console (no x windows) to be received with [key], for example? im on raspbian/linux....
my google searches have not ended so well on this subject
m
use [hid] and read this:
http://puredata.info/docs/tutorials/HowToReadHIDDevicesInLinuxWithoutBeingRo...
----- Original Message -----
From: me.grimm megrimm@gmail.com To: James Dunn james@4thharmonic.com Cc: pd_list Listserve pd-list@iem.at Sent: Thursday, March 14, 2013 1:21 PM Subject: Re: [PD] Send Key Commands to PD w/ -nogui without X (from console)
hmmm... i forgot about that. I will try it...
no way in vanilla i take it?
Sure...
[netreceive 4321] | [220 250, 330 300 2500, 440 300 3800, 550 75 6000, 525 20 6250, 0 300 9000; pd dsp 1( | [vline~] | [osc~] | [dac~]
pdsend 4321
Hello World;
So if you're ok typing "FUDI" messages like this example to trigger commands, all you need is to type a command like "play;" or "stop;" or whatever and [route] it when it comes out netreceive's outlet.
If you want to trigger events more efficiently you probably need a shell script that catches your input and converts it to ascii numbers and then hands it over to pdsend, one character at a time (not sure how to do that). That way you'd just be sending sequences of numbers like "113;", "104;", etc. and [routing] them when they come out of netreceive.
You can also use the "old" behavior of netreceive which interprets the selector of your message as the receive symbol. You could then generate genuine key events (i.e., "key 1 114 0 1" that will be received by [key] objects. But then if someone happens to get inside your network and find that port open, they can start building arbitrary Pd patches on your machine. :)
-Jonathan
m
On Thu, Mar 14, 2013 at 1:17 PM, James Dunn james@4thharmonic.com wrote:
Quoth me.grimm, on 14/03/2013 16:57:
How can I best send key commands to pd when i do -nogui from console (no x windows) to be received with [key], for example? im on raspbian/linux....
my google searches have not ended so well on this subject
m
use [hid] and read this:
http://puredata.info/docs/tutorials/HowToReadHIDDevicesInLinuxWithoutBeingRo...
-- ____________________ m.e.grimm | m.f.a | ed.m. megrimm@gmail.com _________________________________
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
- the 'pdsend' program waits for FUDI input
this might be the best solution for now until i take a look into the shell scripting you suggested. although, how to make it all on one line (one command). Variations in this:
megrimm-mbp:~ megrimm$ (pd -open netreceive-help.pd &) ; (pdsend 3000)
fail or me.
m
On Thu, Mar 14, 2013 at 3:05 PM, Jonathan Wilkes jancsika@yahoo.com wrote:
----- Original Message -----
From: me.grimm megrimm@gmail.com To: James Dunn james@4thharmonic.com Cc: pd_list Listserve pd-list@iem.at Sent: Thursday, March 14, 2013 1:21 PM Subject: Re: [PD] Send Key Commands to PD w/ -nogui without X (from console)
hmmm... i forgot about that. I will try it...
no way in vanilla i take it?
Sure...
- Put a [netreceive 4321] in a patch like so:
[netreceive 4321] | [220 250, 330 300 2500, 440 300 3800, 550 75 6000, 525 20 6250, 0 300 9000; pd dsp 1( | [vline~] | [osc~] | [dac~]
- In a terminal type:
pdsend 4321
- the 'pdsend' program waits for FUDI input (<selector> <args> <semicolon>) so type something like:
Hello World;
- The message "Hello World" will come out the left outlet of [netreceive] and trigger the sound
So if you're ok typing "FUDI" messages like this example to trigger commands, all you need is to type a command like "play;" or "stop;" or whatever and [route] it when it comes out netreceive's outlet.
If you want to trigger events more efficiently you probably need a shell script that catches your input and converts it to ascii numbers and then hands it over to pdsend, one character at a time (not sure how to do that). That way you'd just be sending sequences of numbers like "113;", "104;", etc. and [routing] them when they come out of netreceive.
You can also use the "old" behavior of netreceive which interprets the selector of your message as the receive symbol. You could then generate genuine key events (i.e., "key 1 114 0 1" that will be received by [key] objects. But then if someone happens to get inside your network and find that port open, they can start building arbitrary Pd patches on your machine. :)
-Jonathan
m
On Thu, Mar 14, 2013 at 1:17 PM, James Dunn james@4thharmonic.com wrote:
Quoth me.grimm, on 14/03/2013 16:57:
How can I best send key commands to pd when i do -nogui from console (no x windows) to be received with [key], for example? im on raspbian/linux....
my google searches have not ended so well on this subject
m
use [hid] and read this:
http://puredata.info/docs/tutorials/HowToReadHIDDevicesInLinuxWithoutBeingRo...
-- ____________________ m.e.grimm | m.f.a | ed.m. megrimm@gmail.com _________________________________
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
----- Original Message -----
From: me.grimm megrimm@gmail.com To: Jonathan Wilkes jancsika@yahoo.com Cc: James Dunn james@4thharmonic.com; pd_list Listserve pd-list@iem.at Sent: Thursday, March 14, 2013 3:47 PM Subject: Re: [PD] Send Key Commands to PD w/ -nogui without X (from console)
- the 'pdsend' program waits for FUDI input
this might be the best solution for now until i take a look into the shell scripting you suggested. although, how to make it all on one line (one command). Variations in this:
megrimm-mbp:~ megrimm$ (pd -open netreceive-help.pd &) ; (pdsend 3000)
fail or me.
I don't understand networking very well, but it looks like the netreceive has to bind to the port first, and I think your script only waits until pd process sucessfully starts (i.e., doesn't wait for it to load the patch) before doing 'pdsend'.
Quick and dirty: (pd -open netreceive-help.pd &); sleep 5 && pdsend 3000
That way pdsend waits five seconds before executing, and the patch should be loaded by then.
Maybe there's a shell guru here who can tell you how to wrap it up in a script that automatically sends messages on each keydown event. :)
-Jonathan
hey! that was pretty brilliant!
now w/ -stderr also prints to terminal:
(pd -nogui -stderr -open netreceive-help.pd &); sleep 5 && pdsend 3000
Maybe there's a shell guru here who can tell you how to wrap it up in a script that automatically sends messages on each keydown event. :)
yes!
m
On Thu, Mar 14, 2013 at 4:27 PM, Jonathan Wilkes jancsika@yahoo.com wrote:
----- Original Message -----
From: me.grimm megrimm@gmail.com To: Jonathan Wilkes jancsika@yahoo.com Cc: James Dunn james@4thharmonic.com; pd_list Listserve pd-list@iem.at Sent: Thursday, March 14, 2013 3:47 PM Subject: Re: [PD] Send Key Commands to PD w/ -nogui without X (from console)
- the 'pdsend' program waits for FUDI input
this might be the best solution for now until i take a look into the shell scripting you suggested. although, how to make it all on one line (one command). Variations in this:
megrimm-mbp:~ megrimm$ (pd -open netreceive-help.pd &) ; (pdsend 3000)
fail or me.
I don't understand networking very well, but it looks like the netreceive has to bind to the port first, and I think your script only waits until pd process sucessfully starts (i.e., doesn't wait for it to load the patch) before doing 'pdsend'.
Quick and dirty: (pd -open netreceive-help.pd &); sleep 5 && pdsend 3000
That way pdsend waits five seconds before executing, and the patch should be loaded by then.
Maybe there's a shell guru here who can tell you how to wrap it up in a script that automatically sends messages on each keydown event. :)
-Jonathan
Le 14/03/2013 21:38, me.grimm a écrit :
hey! that was pretty brilliant!
now w/ -stderr also prints to terminal:
(pd -nogui -stderr -open netreceive-help.pd &); sleep 5 && pdsend 3000
Maybe there's a shell guru here who can tell you how to wrap it up in a script that automatically sends messages on each keydown event. :)
yes!
m
On Thu, Mar 14, 2013 at 4:27 PM, Jonathan Wilkes jancsika@yahoo.com wrote:
----- Original Message -----
From: me.grimm megrimm@gmail.com To: Jonathan Wilkes jancsika@yahoo.com Cc: James Dunn james@4thharmonic.com; pd_list Listserve pd-list@iem.at Sent: Thursday, March 14, 2013 3:47 PM Subject: Re: [PD] Send Key Commands to PD w/ -nogui without X (from console)
- the 'pdsend' program waits for FUDI input
this might be the best solution for now until i take a look into the shell scripting you suggested. although, how to make it all on one line (one command). Variations in this:
megrimm-mbp:~ megrimm$ (pd -open netreceive-help.pd &) ; (pdsend 3000)
fail or me.
I don't understand networking very well, but it looks like the netreceive has to bind to the port first, and I think your script only waits until pd process sucessfully starts (i.e., doesn't wait for it to load the patch) before doing 'pdsend'.
Quick and dirty: (pd -open netreceive-help.pd &); sleep 5 && pdsend 3000
That way pdsend waits five seconds before executing, and the patch should be loaded by then.
Maybe there's a shell guru here who can tell you how to wrap it up in a script that automatically sends messages on each keydown event. :)
-Jonathan
Hello,
Something like : $ pd send "startup A B C" /path/to/your/patch.pd should work if you have somewhere in your patch.pd a [r startup]. ++
Jack