BBTouch,code,multitouch,openSoundControl

Multi-boxing BBTouch21 Aug

I have given a great deal of thought to the idea of adding a nice distributed object system to BBTouch. that way you could have cocoa-based clients easily hook into the blob events to do their own thing. I have used DO in a bunch of my other projects and it works well and is simple to use.

However, I also spent a bunch of time getting TUIO to work with BBTouch. And there are already a whole bunch of applications that can utilize BBTouch as a tracker because of the TUIO stuff. So it occurred to me that since BBOSC is basically done (it could use a nice dispatch system, which i will add someday, not to mention lots of error checking and lots of general spiffying up, but i digress) it makes far more sense just to build any new BBTouch client apps using TUIO as the base protocol. I dont think the performance gains I would get by going with DO would be all that staggering (if there we any at all). Also, if i write my cocoa client apps to be all tuio-friendly then people can use them with whatever tracker they want to (like a PC-based tracker or a yet to be designed all-hardware tracker.. whatever.)

And, the most important thing, as i mentioned earlier: it is already done.

So, I have hacked up a quick TUIO cocoa client app that plays nice with BBTouch (and theoretically should play nice with any TUIO tracker).

isn't it cute?

Clever viewers will recognize many of the elements (since i basically just dragged them all from BBTouch into a new project and bolted on a TUIO dispatcher).

Anyhow it is super-duper simple. Anyone who wants to write a client app in cocoa for BBTouch (or for any tuio tracker) can use it as a starting point. It runs on nicely on really old hardware too. (at least it runs perfectly nicely on my 866MHz g4 laptop, which was collecting dust on my shelf, now it is my projection server :-)

I should admit that the real reason i did this was because due to the craptacular firewaire destruction fest of two weeks ago, my second best machine is now without firewire support. (it was the main machine I was using to test all this stuff on). That left my main macBookPro as the only machine that could run everything. This is fine except that I really really have my workspace all dialed in. Big cinema display, keyboard at the right height yadda yadda.. hooking the MBP up to the table meant unhooking it from the big monitor :-( and that was a pain. So I wrote this remote TUIO app mostly so I could still use the MBP as the 'camera' machine, and still have the benefits of the big monitor for developing and whatnot, and my really old machine gets to be the 'projector' machine, and my not that old but not that new machine gets to go back to being my entertainment center. everyone wins.

In any case, if anyone wants it: here is the TUIO Test app.

BBTUIOTest.zip

As I mentioned before, if you want to write your own Multi-Touch client in Cocoa, this is a good seed to start off with. It is the absolute bare bones TUIO + View implementation (with a tiny bit of gratuitous core animation). Have fun!

Cheers!
-b

BBTouch,code,iPhone,multitouch,openSoundControl

Testing distortion meshes for the touch calibration11 Aug

So, in an attempt to keep this week from being a total loss, i thought i would do some iPhone development. I have been wanting to do a 'real' port of the BBOSC stuff to iPhone (i did test the code on the simulator, but didnt make a real app) I thought it would be cool to make a quick little TUIO remote touchpad app for iPhone.

Except... you cant use the iPhone SDK on non-intel machines.. d'oh! sigh...

Instead, I decided to write some quick test apps to at least try to get a jump on BBTouch stuff when i get my machine back. I started today with a silly little app that tests my distortion mesh code. (or i should say my distortion mesh theories, as the only code i had written was the method that converts the points, but without any structure around it)

So here is a single view class that allows the user to create arbitrary distortion meshes, and posts it's information to any other mesh views who take the point, and convert it into their local mesh coordinates. Above is what a mesh might look like if you had a very wide angle lens.

The views convert both ways, so you can click in one and see the result in the other mesh.

As i said, you can do arbitrary meshes. it doesn't need to represent anything in particular.

Anyway, it is a silly little app, and it feels like it should really be some sort of late 80s arcade game or something..
The code also shows some simple use of Core Animation (to do the initial animation as well as using CALayers to draw all the vertex points, saving lots of time).
The mesh code is some fairly straightforward barycentric math. Very standard 3d polygon kinda stuff.

Here is the code if anyone is interested: (it is a single NSView subclass, you will need to add your own project)
BBMeshView.m.tar

here is a pre-compiled app if you want to play with the useless program, but don't want to compile your own:
BBMeshTest.app

enjoy!
-b

BBTouch,code,multitouch,openSoundControl

BBTouch -> Quartz Composer make nice tutorial30 Jul

For anyone who is interested, the esteemed ScreamingDrills has put together a nice tutorial on how to get QC and BBTouch to play well together. (thanks Drills! and thanks Sandor for the other QC links)

if you are looking to do that here are some links:
QC vs BBTouch tutorial: (thanks Drills!)
http://nuigroup.com/wiki/Quartz_Composer_with_BBTouch/

a working example of the TUIO plugin: (thanks Sandor!)
http://workflow.cd-cologne.de/download/QC_surface.zip

have fun!

edit: i always forget to set the catagories! i suxx0r!

code,multitouch,openSoundControl

BBOSC now as a framework28 Jul

Hey All,

Pawel Solyga has done a great thing, and converted the BBOSC project from the half-assed state that I had committed it, into a nice framework. So now it is easy to integrate into all your Cocoa-based OSC apps.

Just grab the code from the repository and compile with the framework project. Works great!

obligatory code link:
http://code.google.com/p/bbosc/

thanks again Pawel!

BBTouch,code,multitouch,openSoundControl

TUIO support is Here!22 Jul

And it even seems to work!

It is gratifying as a developer and code architect (not to toot my own horn, but, tooting my own horn :^) to be able to effectively use a chunk of my own code to add a fairly complex feature in just a few hours. I started fresh on TUIO about 4 hours ago, and because the BBOSC stuff is really easy to deploy and BBTouch is designed to be easily extended, I was done with the main bit of code about 2 hours ago! (spent the next 2 hours fiddling with processing, taking screengrabs, and committing the code to the google repository, and now writing this, which is bringing em up to the 5 hours mark oh well..) (it helps that the TUIO spec is fairly straightforward, and that it closely parallels how the BBTouch internals are structured)

Anyhow, BBTouch now supports the generation of TUIO style events via OSC and UDP. w00t!

OK, here are the details:

First up, since BBOSC is all ObjC 2.0 i went ahead and updated the objects I was stuck into on the BBtouch side as well (mostly just @properties and that sort of thing) the upside is that I saved lots of time implementing, the downside is that it is all OSX 10.5 only. So if you are still on OSX 10.4, and you really really want to run this, it should be fine, but it will take you a bit of elbow grease to replace all the @properties and @synthesize with actual methods. If i am totally screwing you with this change, then let me know and I will try to find time to downgrade all the code. but really, if you are into this stuff, then you are a geek like me and you should be running the bleeding edge OS :-)
Also, i included all the BBOSC files in the BBTouch project, so you wont need to deal with downloading the BBOSC stuff separately. (you really only need to do that if you want to build your own app on top of BBOSC)

Second: I updated the UI in BBtouch to add a TUIO config panel. Now you can just add the hostname and port (defaults to localhost/127.0.0.1 and port 3333 which seems to be the 'default' TUIO stuff), and turn on the 'generate TUIO events' button and it will do just that. (as long as you are also detecting blobs)

Note: if you want to change the host and port, you need to shut off the TUIO event stream first.

Oh, and a quick note about BBTouch performance: I dont have any trouble running it on my macbookpro in full size (640x480) but of you find yourself lagging a bit, you can close the config window and that will save a bunch of processing (since it wont need to be drawing all the raw video and whatnot). this leave BBTouch basically just a menu bar, but you can always get the config window back from the View Menu -> Show Config Window. (i noticed about a %20 drop in processor usage when I closed that window, although most of it is the raw video, so you can just shut that off too) Another Note: now that i have had a look at the processor usage %75!! yikes.. i guess the next thing is to do another optimization pass through the code. that is wayyy too high for what it is doing.. next week maybe :-)

I used the Processing/TUIODemo sketch to test with. (found on the reactivision software page) I plan on testing with some of the others as well, but I don't have time today, and I know you guys are chompin at the bit to get this :-)

As always the code is available on google code: http://code.google.com/p/opentouch/ you will need XCode to compile it.
If you already have some older code checked out, you should be able to update your project and get all the changes automatically.

I will leave you with the above image, a lame finger-painting of mine during testing.. :-)

EDIT: here is a zipped binary of the app for anyone who doesn't want to compile it from the source
bbtouchapp.zip (Universal, but 10.5 only)

About

meMy full name is Ben Britten Smith.

I go by Ben Britten because Ben Smith is a bit too common and using my full name is a mouthful.

I live in Melbourne, Australia and service clients all over the globe.

Contact

Have some questions?

Feel free to contact me directly at support@benbritten.com with any questions you might have about any of the applications I support.

Thanks!

PHVsPjxsaT48c3Ryb25nPndvb19hYm91dDwvc3Ryb25nPiAtIGFib3V0LXdpZGdldDwvbGk+PGxpPjxzdHJvbmc+d29vX2FkX2JlbG93X2ltYWdlPC9zdHJvbmc+IC0gaHR0cDovL2JlbmJyaXR0ZW4uY29tL3dwLWNvbnRlbnQvdGhlbWVzL3ZpYnJhbnRjbXMvaW1hZ2VzL2FkNDY4LmpwZzwvbGk+PGxpPjxzdHJvbmc+d29vX2FkX2JlbG93X3VybDwvc3Ryb25nPiAtIGh0dHA6Ly93d3cud29vdGhlbWVzLmNvbTwvbGk+PGxpPjxzdHJvbmc+d29vX2FsdF9zdHlsZXNoZWV0PC9zdHJvbmc+IC0gYmVuYnJpdHRlbi5jc3M8L2xpPjxsaT48c3Ryb25nPndvb19ibG9ja19pbWFnZTwvc3Ryb25nPiAtIGh0dHA6Ly9iZW5icml0dGVuLmNvbS93cC1jb250ZW50L3RoZW1lcy92aWJyYW50Y21zL2ltYWdlcy9hZDMzNi5qcGc8L2xpPjxsaT48c3Ryb25nPndvb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