<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Thanks a bunch for this, it is, effectively, what I wanted to do with pdsend and pdreceive. The only problem now is sending a variable I've defined via this method, as opposed to the variable name, and I'm sure that's just 'cause I'm new to ruby. <br><br>> Date: Thu, 25 Mar 2010 12:16:07 -0700<br>> Subject: Re: [PD] any mac OS terminal experts?<br>> From: aturley@acm.org<br>> To: jbturgid@hotmail.com; pd-list@iem.at<br>> <br>> So first off, you don't need to call them with 'open' from the command<br>> line. You can just run them directly like any other command, like<br>> this:<br>> echo "a b c 1 2 3;" |<br>> /Applications/Pd-extended.app/Contents/Resources/bin/pdsend 3939<br>> The command reads the standard input and sends the data to PD.<br>> <br>> Assuming you have a PD patch running with a netrecieve object<br>> listening to port 3939, you can send the same message as above with<br>> this Ruby code:<br>> <br>> require 'socket'<br>> hostname = "localhost"<br>> port = 3939<br>> s = TCPSocket.open(hostname, port)<br>> # don't forget the semicolon!<br>> s.puts("a b c 1 2 3;")<br>> s.close()<br>> <br>> andy<br>> <br>> On Thu, Mar 25, 2010 at 11:28 AM, Andrew Faraday <jbturgid@hotmail.com> wrote:<br>> > I mean both opening them in finder and using 'open pdsend' in the terminal,<br>> > same result. I'm not up to socket programming in Ruby. But knowing that it's<br>> > possible to communicate directly is a good start. Now, how do it do it?<br>> ><br>> >> Date: Thu, 25 Mar 2010 11:13:12 -0700<br>> >> Subject: Re: [PD] any mac OS terminal experts?<br>> >> From: aturley@acm.org<br>> >> To: jbturgid@hotmail.com<br>> >> CC: pd-list@iem.at<br>> >><br>> >> You should be able to run them from the command line. When you say<br>> >> that you are "opening the files", do you mean you're clicking on them<br>> >> in the Finder? As you've said, that will just open up a terminal<br>> >> window.<br>> >><br>> >> Also, these commands just communicate with strings over a TCP socket.<br>> >> If you're comfortable with socket programming in Ruby then you don't<br>> >> even have to use pdsend and pdreceive.<br>> >><br>> >> andy<br>> >><br>> >> On Thu, Mar 25, 2010 at 10:55 AM, Andrew Faraday <jbturgid@hotmail.com><br>> >> wrote:<br>> >> > Hey All<br>> >> > I've recently started learning Ruby (on Ubuntu 9.04), part of what I'm<br>> >> > trying to do is control PD through ruby, using the terminal.<br>> >> > The main trouble I'm having now is that I'm mostly using a Mac OS X<br>> >> > machine<br>> >> > which doesn't recognize the 'pdsend' and 'pdreceive' commands (as the<br>> >> > linux<br>> >> > shell does). I've tried opening the files with these names in<br>> >> > /resources/bin<br>> >> > which open a new terminal window and display what looks like the<br>> >> > relevant<br>> >> > -help text. But I can't seem to use these to send messages to and from<br>> >> > pd<br>> >> > from the Mac OS terminal. (in theory I could then automate this with<br>> >> > Ruby).<br>> >> > Any ideas, at all?<br>> >> > ________________________________<br>> >> > Not got a Hotmail account? Sign-up now - Free<br>> >> > _______________________________________________<br>> >> > Pd-list@iem.at mailing list<br>> >> > UNSUBSCRIBE and account-management -><br>> >> > http://lists.puredata.info/listinfo/pd-list<br>> >> ><br>> >> ><br>> ><br>> > ________________________________<br>> > Not got a Hotmail account? Sign-up now - Free<br>                                            <br /><hr />Do you want a Hotmail account? <a href='http://clk.atdmt.com/UKM/go/197222280/direct/01/' target='_new'>Sign-up now - Free</a></body>
</html>