April 18, 2009

touchy feely

Filed under: Uncategorized — aturley @ 12:50 am

A little while back Apple rejected an iPhone app that would have let you use your iPhone as a TUIO controller. There was a big discussion about the whole thing over at CreateDigitalMusic, with some people supporting Apple’s decision and others decrying it. Most of those who supported Apple seemed to feel that it was their store and they could damned well sell whatever they wanted. I tend to agree with this sentiment, but I still think that it would be nice to have a way to get an app onto the iPhone without having to get Apple’s permission.

At about the same time the discussion was taking place over at CDM, I was playing with a program called OSCemote on my brand new iPhone. OSCemote lets you create interfaces for your iPhone that can send and receive OSC messages. Interfaces are created as HTML documents, with snippets of Javascript doing the work of monitoring elements on the page and sending the messages. I began to wonder how hard it would be to use web app running in Safari as a multitouch interface.

I’ve been playing around with these ideas for the last month or so, and tonight I decided to go back to the issue that got me going on this train of thought. I took a look at the TUIO protocol and took a swing at creating a web app that would talk to a web server that would in turn send TUIO messages to other programs. I’m not sure I got all the details of TUIO right, but I think I have a workable first pass at something.

I’ve packaged the system up, and you can download it here. You’ll need Python to run the web server. If you have a Mac then you already have Python. Users of other operating systems may have to install it if it isn’t already there. You will also need some sort of program that can do something with the data. I’ve just been dumping it to a Pure Data patch. And you’ll need an iPhone or an iPhone simulator.

UPDATE (4/20/2009): The link now links to the new version which uses the 2Dcur profile instead of the 2Dobj profile. Thanks to Martin Kaltenbrunner for pointing this out.

13 Comments »

  1. [...] touchy feely [Pillowsopher Blog] [...]

    Pingback by Create Digital Music » TUIO Multitouch for iPhone: Browser App Hack Replaces Rejected App — April 20, 2009 @ 7:37 am

  2. [...] touchy feely [Pillowsopher Blog] [...]

    Pingback by Create Digital Motion » TUIO Multitouch Control on the iPhone: Now Via a Browser Hack, Since the App Was Rejected — April 20, 2009 @ 7:44 am

  3. Hey Andrew, this is really an unusual, but nevertheless exciting TUIO implementation!
    I just downloaded and tested your server implementation, and I think there are a few fixes needed to make it work correctly. First of all, you need to implement the cursor profile instead of the tangible object profile. Just replace the /tuio/2Dobj with /tuio/2Dcur, then everything should work as expected. And the TUIO default port is actually 3333.
    let’s keep in touch,
    martin.k

    Comment by Martin Kaltenbrunner — April 20, 2009 @ 9:35 am

  4. Thanks Martin. I’ll try to get those fixes in today.

    andy

    Comment by aturley — April 20, 2009 @ 10:29 am

  5. I get a error message:

    Traceback (most recent call last):
    File “server-tuiosh.py”, line 21, in
    import json
    ImportError: No module named json

    My tuiotouch-Folder is in my home directory …

    Comment by shell3000 — April 22, 2009 @ 1:06 am

  6. Hey,
    when i try to start the server in terminal it says, “ImportError: No module named json” please help i am really interested!

    michael

    Comment by Michael — April 22, 2009 @ 7:20 pm

  7. Michael, you’re right. I realize that I’m using a library that is only available in Python 2.6. You might be able to use this library, but I haven’t tried it. Sorry about the trouble there.

    Comment by aturley — April 22, 2009 @ 8:19 pm

  8. Hi Andy,

    I’m attempting at setting up the server side right now and running into a snag.

    C:\Documents and Settings\Administrator\Desktop\tuiotouch>c:\Python26\python.exe server-tuiosh.py 80
    80 127.0.0.1 3333 400 200
    Running server at (192.168.0.115:8080)
    ROMAN – - [23/Apr/2009 12:44:53] code 404, message File Not Found: /favicon.ico
    ROMAN – - [23/Apr/2009 12:44:56] code 404, message File Not Found: /favicon.ico

    As you see Im getting an error, it’s looking for the icon as I understand but there isn’t one. (Or is this iPhone client side?)

    I’m running the server on a XP machine with Python 2.6. Any ideas?

    Tried this loading the interface with Firefox 3.0.9 and Safari buid 528.16

    Comment by Roman D — April 23, 2009 @ 8:50 am

  9. By default most modern browsers will try to grab a favicon when they first visit a site. If they don’t find one they usually just skip that step without complaining. So on the server side you’re just seeing a message since there is no /favicon.ico file. Things should still work on the browser side.

    Now when I say “should work on the browser side” I mean “you should see a grid in your browser”. Because the Javascript in this system uses some events that are only available on the iPhone, you won’t actually be able to do anything with it from Firefox or Safari running on your desktop. You’ll actually need an iPhone (or an iPhone simulator) to use it.

    In order to use this system with a browser other than Safari running on the iPhone there would need to be event listeners for mouse events. Maybe at some point I will add those in, but I haven’t done that yet.

    Comment by aturley — April 23, 2009 @ 9:37 am

  10. Hello
    Im guessing this is more a POC (Proof Of Concept) but it is too slow too be able to use. I tried OSCemote and it’s respsonses at once. But I know your server not works in the same way… Are you going to release a faster version?

    Comment by Jelly — April 30, 2009 @ 4:09 am

  11. And a tip, add this:

    Then save the page to your homescreen, open new icon, whoola, no navigationbar or urlbar….

    Comment by Jelly — April 30, 2009 @ 4:35 am

  12. thanks for doing this.
    tried it and got it working, but have a delay of about 30sec. is there a way to get this faster?
    do you know where the delay is coming from?

    Comment by babu — May 24, 2009 @ 9:39 am

  13. [...] wrote a little iPhone game based on some of the same principles that I used in the TUIO system I blogged about earlier. In this system, users go to a URL to download a controller, which they then use to control [...]

    Pingback by pillow blog » iphone game goodness — June 1, 2009 @ 7:42 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress

On this site: