Vapor:
Filter:
Vapor/Classes (extension) | OSC control

Vapor
ExtensionExtension

class to control and respond to the iOS app Vapor by Rockmore Tech LLC (http://www.rockmoretech.com).

Description

Vapor (http://itunes.apple.com/us/app/vapor./id433370498?mt=8) allows for control via OSC and also sends a number of OSC messages based on touch input. The Vapor class sets up a number of ways for this communication to happen.

Class Methods

.showComputerIP

Posts your computer iP address and the port that sclang is listening on.

.dumpAllOSC

For debugging, when set to 'true' all incoming OSC messages will be dumped to the post window. Call the method again with 'false' to turn off OSC dumping.

.new

creates a new instance of Vapor

Arguments:

ip

the ip of the device running Vapor (can be left empty - see the 'listen' method below)

port

the port to listen on

Instance Methods

.ip

the ip address the SuperCollider sends Vapor messages to.

Arguments:

newIP

an ip string

.listen

listens for the '/vaporPing' message from the Vapor app. If IP is nil, the IP from the OSC message will be saved for you.

Arguments:

action

a Function to evaluate when the message comes in

remove

a boolean that tells the class whether or not to remove this responder when the message comes in.

.addResponders

adds the necessary responders for responding to touches in the Vapor app

.removeResponders

removes all responders listening for OSC from Vapor

.ping

sends a /vaporPing message to Vapor after setting up an OSCresponderNode to listen for the '/pong' reply.

.pic

sends a command for Vapor to take a screen shot and store it in the device's photo roll.

.touch

sends an OSC message to Vapor to create a Vapor touch.

Arguments:

x

a value between 0.0 and 1.0 (0.0 is left, 1.0 is right)

y

a value between 0.0 and 1.0 (0.0 is bottom, 1.0 is top)

.cloud

sends an OSC message to Vapor to create a Vapor cloud.

Arguments:

x

a value between 0.0 and 1.0 (0.0 is left, 1.0 is right)

y

a value between 0.0 and 1.0 (0.0 is bottom, 1.0 is top)

.bomb

sends an OSC message to Vapor to create a Vapor bomb.

Arguments:

x

a value between 0.0 and 1.0 (0.0 is left, 1.0 is right)

y

a value between 0.0 and 1.0 (0.0 is bottom, 1.0 is top)

strength

an optional value (between 1 and 10000) that describes how long it takes for the bomb to fade

.newTouchFunc

a Function to evaluate when a Vapor cloud (double tap) is created. msg, time, addr, recvPort and a touchID are passed into the Function.

.touchMovedFunc

a Function to evaluate when a tracked touch moves. msg, time, addr, recvPort and a touchID are passed into the Function.

.touchEndedFunc

a Function to evaluate when a tracked touch ends. msg, time, addr, recvPort and a touchID are passed into the Function.

.pinchFunc

a Function to evaluate when a pinch gesture is detected. msg, time, addr and recvPort are passed into the Function.

.accelFunc

a Function to evaluate when a accelerometer values are calculated. msg, time, addr and recvPort are passed into the Function.

.cloudFunc

a Function to evaluate when a Vapor cloud (double tap) is created. msg, time, addr and recvPort are passed into the Function.

.rotationFunc

a Function to evaluate when a Vapor detects a rotation gesture. msg, time, addr and recvPort are passed into the Function.

.bombFunc

a Function to evaluate when a Vapor bomb (triple tap) is created. msg, time, addr and recvPort are passed into the Function.

.viscosity

sets the viscosity setting in Vapor

Arguments:

viscosityIn

a value between 0.01 and 0.99

.hue

sets the hue setting in Vapor

Arguments:

hueIn

a value between 0.0 and 360.0

.speed

sets the speed setting in Vapor

Arguments:

speedIn

a value between 0.01 and 0.99

.gravity

sets the gravity setting in Vapor

Arguments:

gravityIn

a value between -1.0 and 1.0.

.fade

sets the fade setting in Vapor

Arguments:

fadeIn

a value between 0.01 and 0.99

.diffusion

sets the diffusion setting in Vapor

Arguments:

diffusionIn

a value between 0.01 and 0.99

.mode

sets the mode setting in Vapor.

Arguments:

modeIn

an integer value between 1 and 10

.colorChange

sets the colorChange setting in Vapor.

Arguments:

colorChangeIn

a value between -1.0 and 1.0

.reflectX

sets the reflectX setting in Vapor

Arguments:

reflectXIn

a boolean value

.reflectY

sets the reflectY setting in Vapor

Arguments:

reflectYIn

a boolean value

.reflectCenter

sets the reflectCenter setting in Vapor

Arguments:

reflectCenterIn

a boolean value

Examples