I assume you know what aka.iPhone is and what it does. If you don’t please see this article over at Create Digital Motion. I’ve got aka.iPhone 2.1 installed on my ipod touch and while I enjoyed playing around with the accompanying MAX/MSP patch — via the free runtime — I wanted to see if I could get it working with Quartz Composer.
Well here are my two (akaRemote, akaRemote-Particle) attempts at QC compositions that work really well with the XY controller of aka.iPhone. The XY Controller surface is the only thing I’ve been able to get working with QC, since Masayuki Akamatsu (the author of aka.iPhone) tends to use the same basic “/event” OSC message with a custom number of arguments. The limitations is actually in QC in that you can only have one OSC receiver on a UDP port at a time. Further a OSC receiver can not receive the same message with different arguments (int, float, float array). The author does mention that his protocol might change without notice, so hopefully he’ll read this post and change the messages to cascading/two level OSC messages to signify which button’s are activated and also to get more diversity in the base message string (ie: /event/Pad/buttonB1 message of type boolean which would signify a toggle button on the Pad screen being fired). I don’t pretend to be an OSC god, but I think it makes the protocol more readable/adaptable, which might not be the authors intent.
I decided that for my own use the XY controller was the most useful to reverse engineer (and also the easiest). The OSC command is “/event a b c“, where “a” is the trigger, “b” is the x-coordinate and “c” is the y-coordinate. X and Y coordinates are between (0,0) at the bottom left of the ipod touch screen and (1,1) at the top right.
Now here is how you get it all going:
- Get Masayuki Akamatsu’s aka.iPhone loaded into your ipod touch and/or iphone (I’m not going to tell you how to do this…..lets just say that if you have jailbroken your device you can just sftp his application to /Application on your device).
- Download akaRemote and akaRemote-Particle files and unzip them somewhere on your mac (I’m assuming you have OSX 10.5 and Quartz Composer 3.0, as they are required).
- Start with akaRemote by double clicking on its icon to load it into Quartz Composer, goto Preferences/Viewer and click the + to add a new Preset for the viewer. Call it 1:1 (or something) and give it width and height of 1 and make sure aspect ratio is selected.
- Now go to the bottom left side of the viewer and select 1:1 from the pull down. This guarantees that the coordinate system translation I use (0 to 1 from device is translated to -1 to 1 on the screen) works. Now resize the window to whatever size you want (not too small).
- The QC OSC listener is configured for aka.Iphone’s default port (5600) so you don’t have to change anything. Load up akaRemote application on your device and change the Host Address to the IP address of the machine running QC.
- Now if you switch to the XY tab on the device you should be able to see a dot move around the screen when you touch the surface (the video cube in the middle also rotates).
- Optionally if you like to see a nicer example I’ve put together akaRemote-Particle, a Particle system viz using one of Apples demos (“table particle.qtz“) as a base.
- The idea here is the same, except that your touch on the XY surface produces particle systems in the viewer (make sure you have the 1:1 thing set at the bottom left of the viewer screen).
10 responses to “aka.iPhone and Quartz Composer Experiments…..”
Thanks for posting this! I’m trying to figure out a way to send data from QC to Max/MSP/Jitter. I’ve been looking into using Network Broadcaster and olaf’s netreceive in Max, but I can’t seem to get QC’s port to change to anything other than 50000.
Maybe using OSC, as in your example, makes the most sense, but I figured UDP would be the most straight forward.
Have you experimented with transferring data from QC to Max?
Happy holidays!
Hi Justin,
Thanks for the comment…..I haven’t tried to connect QC and MAX. I don’t have a license for MAX. I do know that others have done so through OSC and from what I understand it works. I think I read somewhere that UDP objects (sender and receiver) had some weird thing going where they would gladly talk to each other (in QC), but where not cooperative otherwise. I’ll see if I can find the post again and let you know. Meantime, try OSC, it works nice.
Happy holidays….
TTYL
Many
hi Many!
Thanks for the reply, I spent the day playing around with this some more and came up with a temporary solution… sending MIDI from QC to Max seems to be working… I’m sure very similar to your OSC suggestion.
In the meantime, I’m trying to do test runs of this whole setup. Max and Ableton Live (which is receiving information from Max) are taking turns crashing after a couple hours of running. Any suggestions for auto-restarting a program after crash?
Thanks again, I’ve really enjoyed looking back through your blog, lots of great nerdiness!
All the best,
Justin
Hey Justin,
I found the page I was talking about in my last post…..check out:
http://celso.arrifana.org/archives/277-Leopards-Quartz-Composer-and-Network-events.html
The guy talks about (and has some code) UDP sender/receiver and has managed to decode the message format. It might be useful, specially the php code.
Glad to hear you got MIDI working…You forgot to mention if Live and MAX are running in OSX or XP or something…..I think there are a couple of programs under XP that can turn a regular program into a auto-restart program (google might help)…..For OSX I’m not sure…..Maybe Automator patch? or applescript?
Sorry I couldn’t be of more help….
TTYL
Many
Okay I don’t know if the URL got chopped….it did on my screen….It’s below on two lines, so copy and paste it in.
http://celso.arrifana.org/archives/
277-Leopards-Quartz-Composer-and-Network-events.html
Hey Justin,
Guess what….I think I might have found the restarting solution, if you’re using OSX…..have a look at:
http://www.macosxhints.com/
article.php?story=20071220095645567
(again the URL is across two lines….so cut and paste it in)….I have not tried this so I don’t know if it works for sure….let me know what happens…
TTYL
Many
I had the same issue with QC not handling masa’s akaremote UDP messages, but luckily there is another alternative: Mrmr (http://poly.share.dj)
Hey Many-
I have gone about this using the MIDI Controller patch in QC and the i3L midi bridge from artificialeyes.tv
They use aka.iphone 2.1 to communicate with the midi bridge over OSC on the Mac from there you can fire commands to QC using MIDI. It works very well and I have been able to create an entire live performance controller using these tools. Im having a lot of fun with QC and Im always looking for others to keep me inspired.
Have fun!
Jason
Hi Many!
Masayuki Akamatsu took down his iphone stuff for max/msp jitter. can you help me? do you have the patches? please please please
thanks 1 billion
help me obi wan
tony schultz
physicist
sarah lawrence college
dept dance
dancemachines.blogspot.com
tony (dot) schultz (at) gmail (dot) com
Hi Tony,
Sorry about the delayed response…..just came back from a trip to Amsterdam…….It’s too bad that the download file has been removed…..I wish I hadn’t upgraded my itouch…..I had it on there and could have probably downloaded it from the touch, but I’ve upgraded to 2 series firmware a while back which wiped the device…..damn…..
I guess to answer your question…..I don’t have it, and I wish I did now :-) sorry….