How to control Jitter over a network?

Jun 20, 2009 at 8:25am

How to control Jitter over a network?

I’d like to control Jitter over a network, ideally from another computer running Jitter. Ideally I’d like to make my own application in Python to trigger my Jitter app.

Any tips on doing this?

I’m thinking have the Jitter app poll a text file for messages, but if there are any more efficient methods, I’d love to hear about them. Or even if there are any tips on polling a text file…

I’m brand new to Jitter, and for some reason my install crashes every time I try to open any of the help files, which is leaving me wasting lots of time on Google.

#44463
Jun 20, 2009 at 4:41pm

Look into sending network messages on the fly. There’s the udpsend/receive externals in Max, mxj net.* java extensions in Max, OpenSoundControl (variation on UDP), plus you’ll find a lot of people have rolled their own and shared them on the forum.

HTH some,
David

#159900
Jun 20, 2009 at 4:45pm
wrybread wrote on Sat, 20 June 2009 02:25
I’m brand new to Jitter, and for some reason my install crashes every time I try to open any of the help files, which is leaving me wasting lots of time on Google.

BTW, if you want advice on this, you are going to have to give some more stats re: platform, max version, etc. etc. I’ve noticed that PC users (if you are one) seem to have the most issues with crashing like this by not having the right version (or any version) of quicktime installed. Just a guess being a mac user myself.

Smile

Cheers,
David

#159901
Jun 21, 2009 at 2:57am

As far as remote controlling Max, is there a nice easy way to do it from the same computer as Max is running on? In other words I’d have a Python script running on the same machine, feeding Max a Read statement from time to time. I’m trying to get it to play a different video at certain moments. I have 4 read statements in my patch, so am also interested in knowing how to target a specific one, if anyone’s in a helping mood…

As far as the crash whenever I open the Help file, I should have said I’m on Windows XP, updated, plenty of RAM, modern processor, etc. Let me know if any of that needs more details. I just updated Quicktime, still same issue. I just installed on another computer and it worked fine though, so dunno.

There also appears to be some quirkiness about which computers will render in OpenGL. The first desktop I tested it on (ATI vid card) shows lines with OpenGL. The next has two dual head video cards, both Nvidia, slightly different models, and one of the cards worked great with OpenGL, the other, which is in theory a higher end card, just shows black. Then a laptop I tested it on with a crappy Intel vid card, plays OpenGL just great. All work fine if I disable OpenGL with the noaccel 1 parameter. I’m rendering in a Jit.Window if that’s a factor.

One other minor quirk: I can’t place my Jit.Window on a secondary monitor if that monitor is to the left of my primary monitor. In other words it won’t accept a negative value for the X position.

#159902
Jun 21, 2009 at 4:59am
wrybread wrote on Sat, 20 June 2009 20:57
As far as remote controlling Max, is there a nice easy way to do it from the same computer as Max is running on? In other words I’d have a Python script running on the same machine, feeding Max a Read statement from time to time. I’m trying to get it to play a different video at certain moments. I have 4 read statements in my patch, so am also interested in knowing how to target a specific one, if anyone’s in a helping mood…

I still say UDP or TCP packets are the way to go, but perhaps I don’t fully understand the problem (nor do I know much of anything of python). To send to the same machine, either use the machines actual IP or the reflexive IP of 127.0.0.1. There is also some third party python interpreters written for max. Check maxobjects.com.

David

#159903
Jun 21, 2009 at 6:10am

Phew, got it. For anyone else who comes down this path, here’s one way to send messages to your Max patch from Python using UDP packets:

import socket
host = "localhost" # this could be your IP address
port = 8888        # the port your net.udp.recv object is listening on
addr = (host, port)

UDPSock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

data = "frame 2000" # your message

UDPSock.sendto(data, addr)

UDPSock.close()

In your Max patch, have a net.udp.recv object listening on some port. In the above example its listening on port 8888. Mine looks like this:

mxj net.udp.recv @port 8888

Hook that up to a print object and it’ll print whatever message you send it.

And David, thanks greatly for the help, this seems much more powerful than the JS interface, for me at least.

Now if I could only figure out how to get my qt.movie object to start playing a given file by sending the path to the movie as a message…

#159904
Jun 22, 2009 at 6:37am

That’s cool, you could do a lot with Python in that way. I haven’t actually programmed in it, but I did read “Programming Collective Intelligence” by Toby Segaran, and it was really something… talking about decision trees, neural networks, search engines, and lots of other stats stuff, based around information you can find online or in any database. The code examples were in Python, and it was really amazing what you could do with tiny little snippets. The underlying concepts were really well-explained too, he’s a real expert who can also teach.

With some of this knowledge and a message system to and from Max, you could really do a lot with online media, since you can get all kinds of files with jit.uldl (including text files you can mangle with [regexp] and similar), then use them for whatever part of a project you want. Search terms typed into a Max textarea can readily be sent to Google Images or wherever too, just need to figure out how they create the URL out of the search terms, and use [sprintf]. which by the way is a very handy object for managing difficult messages which have slashes or other pesky characters in them (like filepaths) or making messages with changeable numbers/symbols.

#159905

You must be logged in to reply to this topic.