[PD] Send Key Commands to PD w/ -nogui without X (from console)

Jonathan Wilkes jancsika at yahoo.com
Thu Mar 14 20:05:30 CET 2013


----- Original Message -----

> From: me.grimm <megrimm at gmail.com>
> To: James Dunn <james at 4thharmonic.com>
> Cc: pd_list Listserve <pd-list at 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...
1) 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~]

2) In a terminal type:
pdsend 4321

3) the 'pdsend' program waits for FUDI input (<selector> <args> <semicolon>) so type something like:
Hello World;

4) 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 at 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/HowToReadHIDDevicesInLinuxWithoutBeingRoot
> 
> 
> 
> -- 
> ____________________
> m.e.grimm | m.f.a | ed.m.
> megrimm at gmail.com
> _________________________________
> 
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> 
> http://lists.puredata.info/listinfo/pd-list
> 



More information about the Pd-list mailing list