It is my great pleasure to announce immediate availability of the μ [myu] Max-Unity Interoperability Toolkit version 1.0. μ [myu] is designed to simplify communication between the Max/MSP/Jitter http://www.cycling74.com and Unity3D http://www.unity3d.com rapid prototyping environments. Utilizing the TCP network packets, μ [myu] allows for easy bi-directional control of Unity3D and Max/MSP/Jitter assets, as well as importing of dynamic Jitter textures into Unity3D scene. Apart from the Jitter-specific texture communication protocol, μ [myu] relies upon the netsend/netreceive framework, thus making it also compatible with Pure-Data http://www.pure-data.info.
Max/Msp/Jitter and Unity3D logos are trademarks of their respective owners.
WHY μ?
Max/MSP/Jitter and Pure-Data offer unprecedented flexibility in digital signal processing, particularly audio, as well as easy integration of external controllers and sensors, video, and 3D assets, while Unity3D is an advanced scalable and optimized 3D gaming engine with integrated intuitive scene editor and physics engine. By coupling their strengths μ [myu] aims to expand their rapid prototyping potential with minimal integration overhead.
This program is free software: you can redistribute it and/or modify it under the terms of the version 3 of the GNU General Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
BRAVISSIMO !!! You are opening us wiiiiiiide windows. Your demo is really thrilling. Just when I thought I had finished my working day… now I will think all the evening long about some new apps based on your toolkit !
[edit ] …thanks a lot !
[edit #2] …and it works perfectly ! I have just reproduced your entire demo, including the realtime webcam… added a “drag rigidbody” script to the camera, dimmed the cube’s mass, set it to a bouncy physical material, added 2 extra walls to the room… and now I can move the cube with the realtime webcam texture, throw it everywhere… like we say in French, “c’est énorme” !
You’re my new hero man, this looks absolutely fantastic! Finally, my 2 favorite applications combined. Communication between Max and Unity has been done before, but this is just awesome.
Now I just have to find the time to actually roll up my sleeves and dive in… the weekend can’t get here fast enough
OK, today I made further successful experiments with this great tool : simply by lowering Jitter’s webcam video texture size (down to 160 x 160 or 128 x 128) the live video feed can be sent over a local network (802.11n here) to another machine running the Unity app. This allows the cube’s texture to update in realtime…
So, thanks to this toolkit, with a few clicks I could achieve my very first Unity “videochat” in full 3D !
Of course, real videochat will probably need image and audio compression/decompression + some other refinements to be useable on anything else than local network or ultra-fast Internet connection, but I guess we’re approaching the Grail…
Many thanks to all for your words of encouragement! They are much appreciated.
Regarding networked textures, we tested textures on a Gigabit LAN for up to 1024x1024 without a problem (although at the expense of considerable CPU overhead due to heavy TCP traffic). In that respect the WiFi is your bottleneck due to its limited bandwidth when compared to wired LAN.
There are also other options to explore in this respect, namely compressed video streams and the like. Lots of opportunities as they say
We are currently working on an implementation of shared memory that would circumvent the TCP stack entirely (hence ostensibly lowering the CPU overhead), as well as Unity3D->Jitter texture importing.
I only used Max for a Digital Music Composition course but I can definitely see how useful this interoperability would be to some folks. The tech demo is absolutely mind-blowing. Great job.
Once again, many thanks all for your interest and kind words!
Finally got around to posting another video, this time showcasing [myu] in a real-world setting.
Part of the Revo:oveR collection, “elemental” is an interactive communal soundscape installation that premiered last November (2008) in Roanoke, VA (USA) as part of the grand opening of the Taubman Museum of Art. The exhibit ran non-stop for approximately 5 months and relied upon a bi-directional communication between Max/MSP/Jitter and Unity3d.
It should be doable, although it may require a custom Pd object for texture import/export functionality (should the netsend/netreceive prove to be inadequate).
Thank you thank you thank you for sharing!! The jitter texture plug-in is absolutely lovely! Very easy to use and surprisingly fast. I hope it will attract more people working with live visuals for music to the community.
Not to go off-topic here, however in the light of the recent discussion, particularly Pd-Unity3D interoperability, if I were granted a magical opportunity to request one feature from the Unity3D devs at this point in time, then it would have to be the implementation of the Linux-based Web player. This would indeed make things a lot easier from the Pd/Web side of things, particularly if Unity3D devs have interest in entering the lucrative Flash market (I know, I know–this topic has been touched upon many times before, so I’ll just go ahead and shut up now :-)…
First of all thanl you again for sharing this great kit.
I have e-mailed Ico with the problems I had earlier and he has been amazingly helpful, the kit works like magic
(I am the guy who is doing his graduation project with this;) )
pd woould be great, since my max/msp academic license will be over in 3 months
I have found this thread to be very helpful, among many others as I am also trying to get Max/MSP to work with Unity. After much trial and error, I spent about a week getting everything to finally work and would like to share it so it might help others.
I decided not to go the network route, mainly because I have Max 5 and the net objects seem to crash often. I also need to set this up so it runs easily on any computer with little or no set up. The networking always seems to be picky, or at least I don’t understand how to set it up to be fool-proof. The method I chose is based on the Wii post here http://forum.unity3d.com/viewtopic.php?t=4247
Basically, my Max patch writes a text file every time it detects a change. Unity reads this file constantly and will move the object in Unity that has this script attached. I only need the movement on the x-axis so I got rid of everything else I didn’t need. Here’s the code for Unity (it should be dragged onto the object to be moved):
import System;
import System.IO;
var yPosition = 0;
var zPosition = 0;
var values : Array;
function Update () {
var coordinates = (Application.dataPath + "/Scripts/" + "motiondata.txt");
if (File.Exists(coordinates)){
var sr = new StreamReader(coordinates);
var txt = sr.ReadToEnd();
values = txt.ToString().Split(";"[0]);
}
xPosition = float.Parse(values[0]);
transform.position = Vector3(xPosition, yPosition, zPosition);
//Debug.Log(values);
}
Here is my Max 5 patch. Important: the patch needs to be built into an Application to work, and placed just above the Assets directory so that it writes the text file into Assets/Scripts/ so that Unity finds it in the right place. If you just run it in the Max editor it will write to your Max application folder.
The patch below assumes that you have a built in web camera and will attempt to track motion from left to right.
We actually have a newer version in the works which bypasses third-party netsend/netreceive Max externals that appear to be the culprits for the instabilities (this was something we observed as well). The newer version relies upon the built-in jit.net.send and jit.net.receive and in our tests has proven much better (e.g. the “Elemental” has been using it and running stably for several weeks without a single crash so far).
So, as soon as we get around to the code clean-up we will be releasing the new version.