[PD] any mac OS terminal experts?

Andrew Turley aturley at acm.org
Thu Mar 25 22:19:25 CET 2010


In Ruby you should be able to do this:
  myvar = 42
  s.puts("#{myvar} ;")

andy

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




More information about the Pd-list mailing list