MonomeGrid:
Filter:
Classes (extension) | monome

MonomeGrid : Object
ExtensionExtension

Interface for monome grids

Description

Communication and management for monome serialosc grid controllers. For more information on monome see https://monome.org

For details on the serialosc protocol used with grid devices see https://monome.org/docs/serialosc/serial.txt

All grid coordinates and level values are 0-indexed.

NOTE: If a monome grid is connected after Server boot, it will not be detected until MonomeGrid.initClass() or 'Recompile Class Library' is executed.
NOTE: January 2011 devices only support four intensity levels (off + 3 brightness levels). The value passed in methods prefixed "lev" will be “rounded down” to the lowest available intensity as below:
0-3off
4-7low intensity
8-11medium intensity
12-15high intensity

Class Methods

MonomeGrid.new(rotation, prefix, fps)

allocate MonomeGrid object

Arguments:

rotation

cable orientation: left = 0 (default), down = 1, right = 2, up = 3

(also accepts 0, 90, 180, and 270 degrees)

prefix

assign this grid a unique string identifier

defaults to "/monome" if nil

fps

rate of maximum grid redraw in frames per second

defaults to 60 if nil

MonomeGrid.setAddCallback(func)

assign a callback function whenever a new grid is added / physically connected

Arguments:

func

MonomeGrid.setRemoveCallback(func)

assign a callback function whenever an added grid is removed / physically disconnected

Arguments:

func

MonomeGrid.getConnectedDevices

returns the serial numbers of each device that's been connected since the Server started (or last refreshConnections)

MonomeGrid.getPortList

returns the OSC ports of each device that's been connected since the Server started (or last refreshConnections)

MonomeGrid.getPrefixes

returns the assigned prefixes of each device that's been connected since the Server started (or last refreshConnections)

MonomeGrid.refreshConnections

sends message to serialosc to refresh SuperCollider's list of currently-connected devices

Inherited class methods

Instance Methods

.connect(devicenum)

choose which device to connect from the device list

Arguments:

devicenum

device list index, begins at 0

if not provided, will default to 0

.connectToPort(port)

choose which device to connect via OSC port

Arguments:

port

OSC port identifier

.connectToSerial(serial)

choose which device to connect via serial string

Arguments:

serial

serial identifier

.key(func)

assign a function to interpret key presses

Arguments:

func

function which receives key x/y coordinates and z state

.led(x, y, val)

Arguments:

x

x in cartesian coordinates

y

y in cartesian coordinates

val

brightness level value 0-15

.ledset(x, y, state)

Arguments:

x

x in cartesian coordinates

y

y in cartesian coordinates

state

0 (off) - 1 (full brightness)

.all(val)

set all leds to a variable brightness

Arguments:

val

brightness level 0-15

.intensity(val)

global intensity for entire grid

Arguments:

val

intensity level 0-15

.tilt_enable(device, state)

set active state of tilt sensor on (device) n to (state) s

Arguments:

device

nth device: to receive tilt for

state

0 or 1

.usePort(portnum)

use a specific port for device communication

Arguments:

portnum

.cleanup

all leds are turned off and osc communication is disconnected

Accessor Methods

.prefix

Returns:

device prefix

.dvcnum

Returns:

index of device in device list (0-indexed)

.serial

Returns:

the device's serial number

.port

Returns:

OSC port the device is currently communicating on

.rotation

Returns:

rotation of device (cable orientation): 0, 90, 180, 270

.fps

Returns:

the device's redraw rate (frames per second)

.rows

Returns:

number of rows a grid device has (1-indexed)

.cols

Returns:

number of columns a grid device has (1-indexed)

Inherited instance methods

Undocumented instance methods

.oscout