Way to call system commands?

Apr 23, 2009 at 1:29am

Way to call system commands?

Anyone know how to call system commands (DOS, OS X)? My limitations are: must be cross-platform, cannot use mxj, must be available in standalone application.

This is essentially a hack to do file conversion (ogg, mp3, or aac) by calling an external command (ffmpeg, or other).

Thanks
Noah

#43490
Apr 23, 2009 at 9:51am

Have you try with shell command ? What’is your plattform ? Mac ?
Ad

#156035
Apr 23, 2009 at 12:05pm

There are shell objects but AFAIK they only work on OS X. Using mxj seems to be the standard way to exec system commands on Windows, so I wonder why you can’t use that? If you can get rid of the no mxj limitation, this should be fairly straightforward…

#156036
Apr 23, 2009 at 2:04pm

There’s still no crossplateform solution for this. How could it be, anyway ? We don’t have the same shell on Windows.

Java is the only workaround for now on Win to get system commands working. Check my DOSHack object :

http://personal.computer.free.fr/new/software.html

By the way i still need more feedback about it to improve the existing code.

Last but bot least, i’ll _finally_ come up with a C version pretty soon (around June).

Cheers

f.e

#156037
Apr 23, 2009 at 6:18pm

Thanks for the responses.

@adam
Is the MXJ object entirely self contained in a standalone max/msp app? In other words, is a standalone app dependent on a separate Java installation?

If the JVM is entirely bundled in the standalone app, I can skip accessing the command line and do the file conversion in java. Basically I am writing a (hopefully) very quick recording and file conversion app and would rather not issue shell commands if I don’t have to.

@f.e.
I was planning on detecting the platform and issuing appropriate commands. The issue would just be can I get to the command line on Mac and Windows not whether the commands issued would be the same once I got there. Thanks for posting your DOSHack object. Cool! And it brings us back to the mxj external JVM dependency question.

#156038
Apr 23, 2009 at 6:53pm

If you want to access the terminal on a mac you can use [shell] or [aka.shell] both of which you should be able to find at the link below.

lh

http://www.maxobjects.com/

#156039
Apr 25, 2009 at 6:27pm
Noah_Thorp wrote on Thu, 23 April 2009 11:18
Thanks for the responses.

@adam
Is the MXJ object entirely self contained in a standalone max/msp app? In other words, is a standalone app dependent on a separate Java installation?

If the JVM is entirely bundled in the standalone app, I can skip accessing the command line and do the file conversion in java. Basically I am writing a (hopefully) very quick recording and file conversion app and would rather not issue shell commands if I don’t have to.

I haven’t worked with standalones but I know Max uses the OS’s java. I guess it’s whatever Java is on the path but maybe it can be influenced by environment variables or the Max java config file. In any case, I don’t think you can include a jvm in a standalone.

It sounds like the best solution would be a version of the shell object for windows but it hasn’t been written yet…

In the meantime, maybe you can make java a prereq for your app? Most systems should have java 1.4 installed these days.

#156040

You must be logged in to reply to this topic.