MOSCion:
Filter:
Classes (extension) | OSC control

MOSCion
ExtensionExtension

class to respond to the iOS app MOSCion by Op 133 Studios LLC (http://www.op133studios.com).
Location: NOT INSTALLED!

Description

mOSCion (https://itunes.apple.com/us/app/moscion/id918992600?mt=8) turns your iPhone or iPad into a gestural and environmental sensing device. Information about the device’s motion, surroundings and your touches are converted into data that can be sent with the Open Sound Control (OSC) network protocol to another device that is listening for this information.

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 MOSCion

Arguments:

port

the port to listen on

baseAddr

the base of the OSC addr that mOSCion will be sending. Multiple instances of MOSCion can be set up to support multiple devices. Changing the base addr on the device will make message handling easier.

Inherited class methods

Instance Methods

.listen

listens for the '/pong' message from the mOSCion app. If port is nil, the port from the OSC message will be saved for you, and this instance of MOSCion will filter for messages on this port.

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.

.clearResponders

removes all responders associated with this instance of MOSCion.

.addResponderForAccelerometer

adds the necessary responders to react to accerlerometer data.

Arguments:

key

a unique key for this set of responders. Reassigning with the same key will overwrite a previous set of responders.

allFunc

a function that has the x, y and z values passed into it. This function will be executed with every message received.

xFunc

a function that has the x value passed into it. This function will be executed with every message received.

yFunc

a function that has the y value passed into it. This function will be executed with every message received.

zFunc

a function that has the z value passed into it. This function will be executed with every message received.

.removeAccelerometerResponder

removes a set of responders with the key id.

Arguments:

key

the key to search for.

.addResponderForGyroscope

.addResponderForMagnetometer

see accelerometer details above.

.addResponderForAttitude

similar to accelerometer, except the functions are for all controls, pitch, yaw and roll.

.addResponderForSpeed

similar to accelerometer, except the functions are for all controls, speed (in meters/sec) and course.

.addResponderForHeading

similar to accelerometer, except the functions are for all controls, true heading and magnetic heading.

.addResponderForGPS

similar to accelerometer, except the functions are for all controls, latitude, longitude and altitude

.addResponderForMicrophone

similar to accelerometer, except the functions are for all controls, linear amplitude, frequency and a floating point midi keynum

.addRespondersForTouch

Arguments:

key

a unique key for this set of responders. Reassigning with the same key will overwrite a previous set of responders.

touchBeganFunc
touchMovedFunc
touchEndedFunc

methods to respond to touch began, move and ended. All functions are passed a unique integer touch ID (to track touches with) and current x and y position.

.removeGyroscopeResponder

.removeMagnetometerResponder

.removeAttitudeResponder

.removeSpeedResponder

.removeHeadingResponder

.removeGPSResponder

.removeMicrophoneResponder

.removeTouchResponders

similar to the method for removing accelerometer responders

.clearAllTouches

sends the touch end for all current tracked touches. Touches on the device are sometimes lost, and this helps clear out stuck touches.

Inherited instance methods

Examples