Turn the iPad into a Drawing Pad!

Quick, immediate success! I am so excited about this mini project I had to share it with the world. Here's the background story in one paragraph:

About a week ago, I visited a friend, who does web development and graphic design. He pulled out a stylus pad for his computer, and gave me his little talk about the whole thing. Basically it is an easier alternative for graphic software. I was immediately needing to have this for my computer, go figure. Fast forward a few days, and I discovered the existence of Inkscape as mentioned in my last post. If you haven't heard of Inkscape, you may also want to check out GIMP as well.

Anyway, that leads me up to now. I did some playing around with using the track pad and adjusting the settings to create a new logo for my website, but I still wasn't feeling the drawing the way I wanted to. I needed this track pad. If you're still unclear what I'm talking about, check out this or this. However, I really don't want to spend any money, and considering that I own an iPad, MacBook, and several developer tools, I should be able to make this work somehow without buying anything else.

Fortunately, this entity Pink Twins has created an app for the iPad/iPhone called Fantastick. The app simply takes user interaction (touching the screen) and sends it directly to a host computer. It also allows the host computer to send messages to the iPad allowing a program to draw on the iPad's screen. It works entirely through network communication, and is intended to allow control of interactive music systems using the iPad. Pink Twins created a set of Max/MSP patches that setup a connection between your computer and the iPad.

So getting touches from the iPad to the computer is no problem. Next problem, how do we have those touches control the mouse cursor? There is a Max/MSP Java object that takes care of this. I don't know who wrote it, but it can be downloaded here. If you helped make this, let me know so I can give you credit. The object is called autobot, and apparently it uses the Robot class of the Java engine to allow control of the keyboard and mouse directly. I glanced in the code and this autobot object simply routes messages like "mouseto" and tells Robot to put the mouse cursor at the coordinates sent to it. Very very simple.

The final step was to modify the Pink Twin's Fantastick patcher to send x-y coordinates from the ipad to the auto bot. If you want this patcher, you can download it here. Once you get Fantastick and the patcher communicating, you can use your finger on the iPad to control where the mouse is on the screen. In order to click, you need to use the button on your track pad, but that would be easy to do with your left hand. The video below gives a quick raw demonstration of it all in action.