Multi-Touch
1
Jan 10
hex – a (multitouch) game.
I got inspired this year at the 26C3 in Berlin to code a game called hex.
This is my Multi-Touch game prototype, open source and free download coming these days.
You can play it online @ www.31media.de/hexTouch (If you have a Multi-Touch device: hex connects on port 3000 an requires a running flosc server.)
“Hex is a board game played on a hexagonal grid, theoretically of any size and several possible shapes, but traditionally as an 11×11 rhombus.
Each player has an allocated color, Red and Blue being conventional. Players take turns placing a stone of their color on a single cell within the overall playing board.
The goal is to form a connected path of your stones linking the opposing sides of the board marked by your colors, before your opponent connects his or her sides in a similar fashion. The first player to complete his or her connection wins the game.”
Check out HEX ON WIKIPEDIA
1
Dec 09
colorWheel: change the color of RGB LEDs
This is a demo of my colorWheel prototype.
Since I bought the Philips Ambilight I was frustrated because I was not able to change the color with my Mac or the iPhone. I now bought some IR controllable LEDs and integrated them into my HAL9031 API.
The iPhone App simply uses the build in accelerometer to rotate the colorWheel selection.
Tap the screen and the LEDs change their color!
The Flash Multitouch App changes the color of the LEDs and of the animation that loops in the background.
// The sound you can hear is programmed. It was generated by Flash & Midi.
26
Nov 09
Fiducial Tracking
New experiment! I modified my Multi-Touch setup to recognize Objects.
Flash is connected to Reactivision via TCP. The UDP Signals of Reactivision are transformed with a UDP TCP bridge.
28
Oct 09
3D Cube Demo
I have been working with papervision since a long time now but even with a simple cube the performance is not even a bit comparable to the native CS4 3D power of Flash itself. Textures doesn’t have do be cached and transformed as Bitmaps, Flash handles MovieClips in 3D like in 2D; vector graphics are still scalable.
This is how to create a simple Cube in CS4:
function createCube():Sprite {
function createElement(_ausgabe:uint, __x:Number, __y:Number, __z:Number, __rotationX:Number, __rotationY:Number, __rotationZ:Number):void {
var _container:Sprite = new Sprite;
_container.x=__x;
_container.y=__y;
_container.z=__z;
_container.rotationX=__rotationX;
_container.rotationY=__rotationY;
_container.rotationZ=__rotationZ;
}
var _container:Sprite=new Sprite ;
//FRONT:
_cube.addChild(createElement(1, 0, 0, -100, 0, 0, 0));
//BACK:
_cube.addChild(createElement(3, 0, 0, 100, 0, 180, 0));
// RIGHT:
_cube.addChild(createElement(2, 100, 0, 0, 0, 90+180, 0));
// LEFT
_cube.addChild(createElement(4, -100, 0, 0, 0, 90, 0));
// TOP:
_cube.addChild(createElement(5, 0, -100, 0, 90+180, 0, 0));
// BOTTOM:
_cube.addChild(createElement(6, 0, 100, 0, 90, 0, 0));
return _container;
}
1 l mate later:
Why not combining the ability to scale without quality-loss with actual Multi-Touch gestures?
Here is the result:
26
Oct 09
Sending MIDI with Flash: MIDI Matrix
Yes I had fun.
You might remember the soundMatrix I coded back in the summer. Version 2 is ready! Touchable & with MIDI support. In the first version I used to trigger WAV samples; version 2 now sends MIDI!
There is a online version with samples available, have fun!
http://www.31media.de/soundMatrix/
For all those who want to know HOW to send MIDI via Flash:
You basically send OSC packets to a XML Socket Server. The FLOSC socket server has a output port that transforms the XML/OSC messages back to MIDI. I use a app called “Occam” for the MIDI transformation.
Update: people were asking where they can find “occam”: Occam was coded 1998 by C. Ramakrishnan at the University of California.
If someone needs Occan, contact me – occam is not online any more.
Update 2: Occam works with Snow Leopard! Nice.
Update 3: Occam is online again! Here is the url: www.illposed.com/software/
Here is the code:
package com.thirtyOne.core{
import flash.display.*;
import flash.events.*;
import org.fwiidom.osc.*;
import caurina.transitions.Tweener;
public class MIDIGateway {
private var oscConn:OSCConnection;
private static const STR_LOCAL_IP:String="ZION.local";
private static const STR_REMOTE_IP:String="ZION.local";
private static const NUM_PORT:Number=6666;
public function init() {
//Initialize connection to the FLOSC server
oscConn=new OSCConnection(STR_LOCAL_IP,NUM_PORT);
oscConn.addEventListener(OSCConnectionEvent.ON_CONNECT,onConnect);
oscConn.addEventListener(OSCConnectionEvent.ON_CONNECT_ERROR,onConnectError);
oscConn.addEventListener(OSCConnectionEvent.ON_CLOSE,onClose);
oscConn.connect();
}
private function onConnect(evtEvent:OSCConnectionEvent):void {
trace("MIDI MODULE CONNECTED.");
}
private function onConnectError(evtEvent:OSCConnectionEvent):void {
trace("ERROR");
}
private function onClose(evtEvent:OSCConnectionEvent):void {
trace("CONNECTION TO SERVER CLOSED.");
}
public function sendMIDI(_note:uint,_velocity:uint):void {
//Send the actual OSC packet
///osc/midi/out/noteOnchannel (int)key (int)velocity (int)
oscConn.sendOSCPacket(new OSCPacket("/osc/midi/out/noteOn",[1,_note+"",_velocity+""],STR_REMOTE_IP,57117));
Tweener.addTween(new Sprite(), {alpha:1, time:.1, onComplete:function():void
{
// KILL MIDI NOTE:
oscConn.sendOSCPacket(new OSCPacket("/osc/midi/out/noteOff",[1,_note+"",_velocity+""],STR_REMOTE_IP,57117));
}});
}
}
}
13
Oct 09
Multitouch Experiment
Neues Video online!
Multitouch-Installation in Glasplatte.
Beamer ist mit 45 Grad Neigungswinkel an der Wand hinter dem Schreibtisch gemountet.
7
Oct 09
Control different lights with the iPhone based on your position
This is the HAL iPhone App.
It is based on the HAL9031 API
http://code.google.com/p/hal9031/
It basically triggers AppleScripts to control lights via X10.
Multi-Touch Features and the User-tracking Class of HAL9031 make it smarter as the interface may look.
Based on the position of the User the app only controls the device that is near the user. If there are more lights in one room you can trigger them by pressing the light button with more than one finger.
Another example of user-location-based programming is the HAL IR (infra red) module. You can send IR signals to different rooms. If you are near the TV the Power button toggels the state of the device that is in the same room as you are.




