touchlib and processing
Posted: 25 June 2007 01:04 PM   [ Ignore ]
New Member
Rank
Total Posts:  12
Joined  2007-06-25

hi,

on the touchlib page (http://www.whitenoiseaudio.com/touchlib/) it says that you can use processing to receive data from touchlib via the tuio protocol, but it doesn’t say how. does anyone of you guys use touchlib in combination with processing? can somebody give me a hint?

cheers

Profile
 
 
Posted: 25 June 2007 01:14 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  1353
Joined  2007-04-08

Processing should receive the messages through OSC (open sound control) which I believe is a downloadable library off the processing website (called oscP5). I think there one or two patches on the forum that have examples. I haven’t really used processing so I can’t be much more help.

 Signature 

My Multitouch Blog
My Youtube
Multitouch FAQ - Need Help? Click here!

Profile
 
 
Posted: 27 June 2007 09:09 AM   [ Ignore ]   [ # 2 ]
New Member
Rank
Total Posts:  2
Joined  2007-01-22

You need to install oscP5 first. Really easy, just copy it in the libraries folder. Once you’ve done it, here’s an example code of how to get OSC messages:

import oscP5.*;
import netP5.*;
OscP5 oscP5;
void setup() {
  size
(400,400);
  
oscP5 = new OscP5(this,12000); //port
}
void draw
(){}
void oscEvent
(OscMessage theOscMessage{
  println
("message:"+theOscMessage.get(0));
}

Thats all! :)
There’s more info about getting messages (integers, floats, tags and so) in the website.

Profile
 
 
Posted: 27 June 2007 10:43 AM   [ Ignore ]   [ # 3 ]
Jr. Member
RankRank
Total Posts:  219
Joined  2007-03-23

hi: the problem with plugging straight to osc is that you will recieve a truck-load of numbers that you will need to parse.

google reactivision, and then download their TUIO client for processing.  Since touchlib is using the tuio protocal, you can use this client to parse the incoming data.  The example sketch will work instantly with touchlib and you can use it as a basis for building your own sketch

-n

Profile
 
 
Posted: 27 June 2007 10:44 AM   [ Ignore ]   [ # 4 ]
New Member
Rank
Total Posts:  12
Joined  2007-06-25

thanks to both of you! i’ll try it tomorrow!

Profile
 
 
Posted: 27 June 2007 01:37 PM   [ Ignore ]   [ # 5 ]
Jr. Member
RankRank
Total Posts:  219
Joined  2007-03-23

you should have no problems with the TUIO client from reactivision......... i’ve just tested it

Profile
 
 
Posted: 27 June 2007 01:55 PM   [ Ignore ]   [ # 6 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  1353
Joined  2007-04-08

---

 Signature 

My Multitouch Blog
My Youtube
Multitouch FAQ - Need Help? Click here!

Profile
 
 
Posted: 29 June 2007 12:18 PM   [ Ignore ]   [ # 7 ]
New Member
Rank
Total Posts:  12
Joined  2007-06-25

first of all thank you guys for your help!

I tried the TUIO Demo (comes with the TUIO library for processing) which worked fine. But there is a lot of code in there which you don`t need to receive dada from touchlib. so i threw all the stuff you don`t need for receiving data from touchlib away, changed some code and also added some comments for better understanding.

i also added methods for detecting if a cusor is over a visual object. but i didn`t include it in this example because it makes the code more complicated.

I hope the code can serve as an easy starting point for others.
if you guys have any suggestions for improvement or just think what i`ve done is stupid, please let me know!

File Attachments
tuio_touchlib.zip  (File Size: 3KB - Downloads: 397)
Profile
 
 
Posted: 07 January 2008 02:30 PM   [ Ignore ]   [ # 8 ]
New Member
Rank
Total Posts:  12
Joined  2008-01-07

the processing example provide by Reactvision works with touchLib too (I just tested yesterday ^^)

http://mtg.upf.edu/reactable/?software (check the Client example)

Profile
 
 
Posted: 14 February 2008 06:37 PM   [ Ignore ]   [ # 9 ]
Sr. Member
Avatar
RankRankRank
Total Posts:  359
Joined  2007-09-18

both demos works properly,
have you done more sketches ?

 Signature 

http://sassexperience.org

Profile
 
 
Posted: 06 March 2008 02:21 PM   [ Ignore ]   [ # 10 ]
New Member
Rank
Total Posts:  9
Joined  2007-09-11

Picturetunes,

Thanks a lot for your code, I really think you did a good work. It cleaned up a little the TuioDemo, which by the way, was far to complicated to me!

Profile
 
 
Posted: 15 July 2008 06:20 PM   [ Ignore ]   [ # 11 ]
Sr. Member
Avatar
RankRankRank
Total Posts:  359
Joined  2007-09-18

Here it ‘s a quick sketch (with Touchlib & P5). with the updated TUIO by Picturetunes

A moving target is displayed at the touch point(s), and a small circle is flying around .

Hope it will be useful ,

(in order to try it, no need of P5, just launch the Osc.exe then the TuioTouchDepartCircles.exeincluded in the folder .)

@PictureTunes
How did you write the resizable bar shown on your website ?
Would you post it ?

Image Attachments
bom-touch2.jpg
File Attachments
target_circle.rar  (File Size: 780KB - Downloads: 75)
 Signature 

http://sassexperience.org

Profile
 
 
Posted: 15 July 2008 07:56 PM   [ Ignore ]   [ # 12 ]
New Member
Avatar
Rank
Total Posts:  16
Joined  2008-04-30

Hm I tried your .exe file and just got a black window. Dunno where the problem is. I tried it on my notebook with same result.
Btw, Ive been working on a processing MT framework, for some time now, too. Currently it supports several gestures like drag/rotate/scale/click/pan/zoom, hit testing for shapes, and a hierarchical component structure with an event system etc. But its always interesting to see other implementations for inspiration smile

Profile
 
 
Posted: 16 July 2008 02:13 AM   [ Ignore ]   [ # 13 ]
Sr. Member
Avatar
RankRankRank
Total Posts:  359
Joined  2007-09-18

the black window is ok .
Did u use it with the osc.exe from Touchlib ?

 Signature 

http://sassexperience.org

Profile
 
 
Posted: 16 July 2008 05:04 AM   [ Ignore ]   [ # 14 ]
New Member
Avatar
Rank
Total Posts:  16
Joined  2008-04-30

Ok, works now, the firewall was blocking the input =)

Profile