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?
_________________________________________________________________
We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now
http://clk.atdmt.com/UKM/go/195013117/direct/01/
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@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@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
they are probably just not in your PATH. try and copy both files into /usr/local/bin/
ciao, ub
Andrew Faraday schrieb:
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
http://clk.atdmt.com/UKM/go/197222280/direct/01/
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Mar 25, 2010, at 6:55 PM, Andrew Faraday 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?
I had the same issue when trying to use some scripts I made in Linux with pd. I solved it by adding some function wrappers to my ~/.bash_profile:
# pd commandline function pd { /Applications/Pd-extended.app/Contents/Resources/bin/pd $@; } export -f pd
function pdsend { /Applications/Pd-extended.app/Contents/Resources/bin/pdsend $@; } export -f pdsend
Make sure to restart the terminal session for it to take effect.
Dan Wilcox danomatika.com robotcowboy.com
Dan, i am sorry but your function { } business is teribly misleading! it's gust alias pd="/path/to/app/bin/pd" that anyone would ever need ..
well, do you wanna go like:
PD=//Applications/Pd-extended.app/Contents/Resources/bin/pd THIS_COULD_BE_THE_ONLY_REASON_WHY_WE_NEED_IT=$MY_ERRORNO_CMD_NOT_FOUND
function pd {
if [ -x $PD ] then
dirname $PD
/basename pd
else
echo "COMMAND NOT FOUND, this is a redundant msg!"
exit $THIS_COULD_BE_THE_ONLY_REASON_WHY_WE_NEED_IT
}
On Thu, Mar 25, 2010 at 07:57:26PM +0100, Dan Wilcox wrote:
On Mar 25, 2010, at 6:55 PM, Andrew Faraday 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?
I had the same issue when trying to use some scripts I made in Linux with pd. I solved it by adding some function wrappers to my ~/.bash_profile:
# pd commandline function pd { /Applications/Pd-extended.app/Contents/Resources/bin/pd $@; } export -f pd
function pdsend { /Applications/Pd-extended.app/Contents/Resources/bin/pdsend $@; } export -f pdsend
Make sure to restart the terminal session for it to take effect.
Dan Wilcox danomatika.com robotcowboy.com
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Mar 26, 2010, at 10:09 PM, errordeveloper@gmail.com wrote:
Dan, i am sorry but your function { } business is teribly misleading! it's gust alias pd="/path/to/app/bin/pd" that anyone would ever need ..
Yeah, I hadn't tried an alias. I think it's a better option.
well, do you wanna go like:
PD=//Applications/Pd-extended.app/Contents/Resources/bin/pd THIS_COULD_BE_THE_ONLY_REASON_WHY_WE_NEED_IT=$MY_ERRORNO_CMD_NOT_FOUND
function pd { if [ -x $PD ] then
dirname $PD
/basename pd
else echo "COMMAND NOT FOUND, this is a redundant msg!" exit $THIS_COULD_BE_THE_ONLY_REASON_WHY_WE_NEED_IT }
I'm sorry but your example is terribly redundant. Obviously if you adding a function to your .bash_profile you would know that the binary should be there. I only supplied an approach that worked for me, sorry to post an inferior option. *sheesh*
I had the same issue when trying to use some scripts I made in Linux with pd. I solved it by adding some function wrappers to my ~/.bash_profile:
# pd commandline function pd { /Applications/Pd-extended.app/Contents/Resources/bin/pd $@; } export -f pd
function pdsend { /Applications/Pd-extended.app/Contents/Resources/bin/pdsend $@; } export -f pdsend
Make sure to restart the terminal session for it to take effect.
Dan Wilcox danomatika.com robotcowboy.com
Dan Wilcox danomatika.com robotcowboy.com
On Mar 27, 2010, at 1:46 PM, Dan Wilcox wrote:
On Mar 26, 2010, at 10:09 PM, errordeveloper@gmail.com wrote:
Dan, i am sorry but your function { } business is teribly misleading! it's gust alias pd="/path/to/app/bin/pd" that anyone would ever need ..
Yeah, I hadn't tried an alias. I think it's a better option.
Ok, I added the above information to the puredata.info docs. I was going to do it earlier, but the function definitions I was using originally were throwing annoying errors in places that call .bash_profile (Xcode). Now everything is peachy using aliases.
I know it seems redundant to repost info thats now archive on the list ... but isn't the webpage wiki where most of these tips and tricks out to go anyway?
Dan Wilcox danomatika.com robotcowboy.com
IIRC you need the command 'open' to run some commands on MacOSX (if they are not in the usual /usr/bin directory, or similar).
for using pdsend on MacOS I had to this: echo "YOUR_DATA";|/Applications/Pd-extended.app/Contents/Resources/bin/pdsend PORT
I'd open the Pd application by open /Applications/Pd-extended.app
(just make sure to replace Pd-extended.app by whatever Pd you use)
So, if you are creating scripts that are to be portable between linux and MacOS you should check for OS first and then construct your commands accordingly.
Another note, somewhat unrelated, is that the [shell] external does not behave in the same way on Linux and MacOS. pwd command, for example, in linux reports the directory from which I started Pd (which is what I expect), in MacOS, however, it always reports the root of the system. Ok, that's the only example that I stumbled upon but I only used it once for one thing (that was meant to run on both Mac and linux) :)
best
./MiS
On Sat, Mar 27, 2010 at 10:40 AM, Dan Wilcox danomatika@gmail.com wrote:
On Mar 27, 2010, at 1:46 PM, Dan Wilcox wrote:
On Mar 26, 2010, at 10:09 PM, errordeveloper@gmail.com wrote:
Dan, i am sorry but your function { } business is teribly misleading! it's gust alias pd="/path/to/app/bin/pd" that anyone would ever need ..
Yeah, I hadn't tried an alias. I think it's a better option.
Ok, I added the above information to the puredata.info docs. I was going to do it earlier, but the function definitions I was using originally were throwing annoying errors in places that call .bash_profile (Xcode). Now everything is peachy using aliases. I know it seems redundant to repost info thats now archive on the list ... but isn't the webpage wiki where most of these tips and tricks out to go anyway?
Dan Wilcox danomatika.com robotcowboy.com
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Mar 27, 2010, at 4:22 PM, Michal Seta wrote:
IIRC you need the command 'open' to run some commands on MacOSX (if they are not in the usual /usr/bin directory, or similar).
.. but, no I don't have to use open. I simply call the binary from inside the app bundle. I have been using this for a while now and it works fine.
pdsend, for example, is distributed in Pd-extended.app. How do I run it using open? "open -a Pd-Extended .... "?
for using pdsend on MacOS I had to this: echo "YOUR_DATA";|/Applications/Pd-extended.app/Contents/Resources/bin/pdsend PORT
I'd open the Pd application by open /Applications/Pd-extended.app
or
open -a Pd-extended
(just make sure to replace Pd-extended.app by whatever Pd you use)
So, if you are creating scripts that are to be portable between linux and MacOS you should check for OS first and then construct your commands accordingly.
No, I don't have to. Why not just add 4 lines to .bash_profile ... isn't that what it's there for?
On Sat, Mar 27, 2010 at 10:40 AM, Dan Wilcox danomatika@gmail.com wrote:
On Mar 27, 2010, at 1:46 PM, Dan Wilcox wrote:
On Mar 26, 2010, at 10:09 PM, errordeveloper@gmail.com wrote:
Dan, i am sorry but your function { } business is teribly misleading! it's gust alias pd="/path/to/app/bin/pd" that anyone would ever need ..
Yeah, I hadn't tried an alias. I think it's a better option.
Ok, I added the above information to the puredata.info docs. I was going to do it earlier, but the function definitions I was using originally were throwing annoying errors in places that call .bash_profile (Xcode). Now everything is peachy using aliases. I know it seems redundant to repost info thats now archive on the list ... but isn't the webpage wiki where most of these tips and tricks out to go anyway?
Dan Wilcox danomatika.com robotcowboy.com
On Mar 27, 2010, at 4:22 PM, Michal Seta wrote:
IIRC you need the command 'open' to run some commands on MacOSX (if they are not in the usual /usr/bin directory, or similar).
for using pdsend on MacOS I had to this: echo "YOUR_DATA";|/Applications/Pd-extended.app/Contents/Resources/bin/pdsend PORT
With an alias set, you can simply use:
echo "unit /pd/unitd/startup" | pdsend 3333 localhost udp
... which works in Linux as well.
Dan Wilcox danomatika.com robotcowboy.com
On Sat, 27 Mar 2010 11:22:20 -0400 Michal Seta mis@artengine.ca wrote:
in MacOS, however, it always reports the root of the system.
If ever there was a nasty accident waiting to happen this takes the cake :)
Andy Farnell wrote:
On Sat, 27 Mar 2010 11:22:20 -0400 Michal Seta mis@artengine.ca wrote:
in MacOS, however, it always reports the root of the system.
If ever there was a nasty accident waiting to happen this takes the cake :)
Except it isn't true, at least as far as I can tell from a quick check of the shell. pwd reports the current directory, at least interactively.
Phil Stone
Strike that; I see you were talking about the [shell] external, not bash. That'll teach me to post before getting coffee in.
Phil
Phil Stone wrote:
Andy Farnell wrote:
On Sat, 27 Mar 2010 11:22:20 -0400 Michal Seta mis@artengine.ca wrote:
in MacOS, however, it always reports the root of the system.
If ever there was a nasty accident waiting to happen this takes the cake :)
Except it isn't true, at least as far as I can tell from a quick check of the shell. pwd reports the current directory, at least interactively.
Phil Stone