Morph:
Filter:
Morph/Classes (extension) | External Control

Morph
ExtensionExtension

Interfacing with the Sensel Morph

Description

Interfacing with the Sensel Morph via senselosc. 2020, Till Bovermann (http://tai-studio.org | http://lfsaw.de)

NOTE: This class requires the senselosc command-line interface, get it at https://github.com/tai-studio/senselosc .

Class Methods

.new

create new instance

Arguments:

deviceID

the id of the sensel morph (currently only 0 supported)

Instance Methods

.runBinary

run the senselosc binary in a terminal

Arguments:

scanDetail

set scanning detail (0: low, 1:med, 2:high)

.binary

binary path to the senselosc binary.

.start

start operating

Arguments:

force

when true, forces a restart

.stop

stop operating

.deviceID

Returns:

device ID

.deviceSpecs

Returns:

Dictionary of ControlSpecs used to normalise incoming values.

Values

Collected values are stored in dictionaries.

Each contact has the following elements stored. Ranges are normalised (vals.c) or raw (deviceVals.c, in sensels or gram).

stateone of [\invalid, \start, \drag, \end], raw values are [0, 1, 2, 3]
xx-pos
yy-pos
forcepressure
areacovered area
distdistance to center position
wDistdistance to weighted center position
orientationorientation of elipsis
majAxismajor axis length of elipsis
minAxisminor axis length of elipsis
peakXx-pos of pressure peak
peakYy-pos of pressure peak
peakForcepressure at pressure peak
minXupper-left x-pos of bounding box
minYupper-left y-pos of bounding box
maxXlower-right x-pos of bounding box
maxYlower-right y-pos of bounding box
dXdelta x since last update
dYdelta y since last update
dForcedelta force since last update
dAreadelta area since last update

The avg has the following elements stored. Ranges are normalised (vals.avg) or raw (deviceVals.avg, in sensels or gram).

\numContactsnumber of contacts (normalised: i/16)
\xaverage x-pos
\yaverage y-pos
\forceaverage pressure
\distaverage distance between average position and all contacts
\areaaverage covered area
\wXforce-weighted x-pos
\wYforce-weighted y-pos
\tForcesummed forces of all contacts
\wDistaverage distance between weighted average position and all contacts

Below you can see how the different parametes affect each other. Shown are: positions and force of two contacts, their average position and force (contantly in-between), and their weighted average position and force (moving from one to the other while force is altered).

.avg

Returns:

Dictionary of all stored average values (normalised)

.contacts

Returns:

Array of all stored contact values (normalised)

.vals

.prevVals

Returns:

Dictionary of all stored (previous) values (normalised)

.deviceVals

.devicePrevVals

Returns:

Dictionary of all stored (previous) values (raw)

.updatedContacts

Returns:

Dictionary of all contacts that were updated in the last frame

.contactStates

Returns:

Array of states, each one of [0, 1, 2, 3].

Actions

actions are evaluated in the order

  1. avgAction
  2. contactPreAction
  3. contactDownAction
  4. contactDragAction
  5. contactUpAction
  6. contactPostAction
  7. syncAction

.avgAction

.contactPreAction

.contactDownAction

.contactDragAction

.contactUpAction

.contactPostAction

.syncAction

.clearActions

remove all actions

.gui

creates a graphical display of the morph's state.

Examples

no sound example

simple sound example

visualisation