Git Product home page Git Product logo

trackpadosc's Introduction

TrackpadOSC

Send mac's multitouch trackpad read-out through OSC, so apps you make can be controlled with custom gestures.

It's a really simple gluing together of this Objective-C code and the tiny OSC library.

A Processing and an OpenFrameworks receiver examples are included in /demos folder.

Installation & Usage

A pre-built binary TrackpadOSC is included and can be run by double-clicking on it. However it may or may be compatible with your system. Read below for some straightforward steps to re-compile it:

First load the dependencies:

git submodule update --init

Then, compile using:

sh build.sh

You should get a binary named TrackpadOSC. That's it! Run it by typing

./TrackpadOSC

If you want to specify the host and port, simply do

./TrackpadOSC 127.0.0.1:9527

Parsing Received Data

All trackpad info are sent to the OSC Address /trackpad, as a string encoded in XML format. Here is an example:

<multitouch timestamp='608048.937'>

	<finger 
		id='3'
		frame='1791' 
		angle='90.000' 
		ellipse='10.190,8.930'
		position='0.124643661,0.827576339' 
		velocity='0.038,-0.055'
		state='4'
		size='1.074'
	/>
		
	<finger
		id='8'
		frame='1791' 
		angle='80.000' 
		ellipse='12.190,9.930'
		position='0.324643661,0.927576339' 
		velocity='0.039,-0.025'
		state='4'
		size='1.035'
	/>
	
	...

</multitouch>

(Newlines are added here for readability, but are not sent by the actual software)

Checkout the demos in /demos folder on more receiving and parsing details.

Notes & References

  • Finger positions are normalized, with left edge being x=0, right edge being x=1, top edge being y=1, and bottom edge being y=0. In other words, if you're sitting in front of your laptop, (0,0) points toward your left chest. Notice the anti-intuitive flipping of y-axis.

  • Much of the code is adapted from https://web.archive.org/web/20151012175118/http://steike.com/code/multitouch/. Check out their comments for more info.

  • tinyosc is used to send OSC data. If you want to modify OSC related things (e.g. you don't like the XML string and would like to send floats to different OSC addresses), check out that repo for the OSC functions.

  • Remember to turn off mac's system gestures so that they don't interfere, by going to System Preferences β†’ Trackpad β†’ More Gestures, and unchecking everything.


Made possible with support from The Frank-Ratchye STUDIO For Creative Inquiry at Carnegie Mellon University.

trackpadosc's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

zorrock

trackpadosc's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.