Purr-Data and Pure-Data external for interfacing with the Sensel Morph
by Rachel Hachem and Ivica Ico Bukvic [email protected]
Part of the ICAT Laptop Orchestra at Virgina Tech
Released under the GPL v3 license
Use the deken package manager to install the externals. In Pure Data, go to the "Help" menu and select Find Externals. Search for sensel
or senselmorph
and you will be given installation options.
Install in Documents/Pd/ as recommmended by deken, unless you have a non-standard installation.
This installs the objects as well as helpfiles and several examples that can be found in your /Pd/externals/senselmorph folder.
Here's what this looks like on a Mac after selecting a package to install in the deken panel - windows and linux are very simlar:
To build for Purr-Data (pd-vanilla setup may be similar with some subtle changes in the include paths and likely does not require MSYS environment, so on Windows changes may be more significant):
- Set up a build environment:
-
On Windows follow instructions on setting up the MSYS2 environment for Purr-Data (make sure it matches your OS in terms of 32-bit vs 64-bit--most modern iterations of Windows are 64-bit). Info on how to do this can be found in the purr-data repository.
-
On Linux and OSX make sure you have your build gcc environment all set up (consult the OS documentation)
-
Install the Sensel lib for your OS found in the Sensel API repo
-
Using a terminal (in Windows use the MSYS2 MinGW 32-bit shell) go into this folder and run the following command (these options are assuming you have everything installed in a default path--if you don't you will need to adjust paths accordingly):
-
Linux:
make pdincludepath=/usr/include/pd-l2ork/
-
OSX:
make pdincludepath=/Applications/Pd-l2ork.app/Contents/Resources/app.nw/include/pd-l2ork/
-
Windows:
make pdincludepath=/c/Program\ Files\ \(x86\)/Purr\ Data/include/pdl2ork pdbinpath=/c/Program\ Files\ \(x86\)/Purr\ Data/bin/
- If everything compiles correctly, you should be able to run Purr-Data or Pure Data Vanilla and open the
sensel-help.pd
to test it out.
Future installations will be mediated by the deken package manager. If you need to install from this repository, use the following directions.
Copy the
sensel.pd_darwin
sensel-help.pd
sensel-led.pd
files from this repo to your ~/Documents/Pd
folder. You may want to make a "sensel" directory so you can put these files in ~/Documents/Pd/sensel
.
Copy the
sensel.dll
sensel-help.pd
sensel-led.pd
LibSensel.dll
LibSensel.lib
LibSenselDecompress.dll
LibSenselDecompress.lib
files from this repo to your user Documents/Pd
folder. You may want to make a "sensel" directory so you can put these files in user /Documents/Pd/sensel
.
Copy the
sensel.pd_linux
sensel-help.pd
sensel-led.pd
files from this repo to your ~/Documents/Pd
folder. You may want to make a "sensel" directory so you can put these files in ~/Documents/Pd/sensel
.
discover
: discovers and connects to the first available sensel morph deviceidentify:
lists all sensel morph devices' serial numbers in the consoledisconnect
: disconnects from a connected sensel morph deviceconnect <serial-number>
: connects to a device with a matching serial numberpoll
: sets the polling rate in ms (1-100) at which the contact data is outputted. Each contact has 20 arguments described belowled <id> <brightness(0-100)>
: sets the sensel morph led brightness. Note that sending a lot of led messages can quickly bog down the sensel devicem so rate control is encouraged (e.g. see the sensel-led abstraction)
Indicates connection status (1=connected, 0=disconnected)
List of all (maximum 16) contact points, with each contact output as a list consisting of 20 arguments:
- contact point number
- contact status (0=invalid , 1=start , 2=move , 3=end)
- orientation
- major axis
- minor axis
- delta x
- delta y
- delta force
- delta area
- min x
- min y
- max x
- max y
- peak x
- peak y
- peak force
- x position
- y position
- total force
- area
More detailed descriptions of the contact data can be found in the Sensel API guide.
Currently, the external only supports detecting of individual contact points and their traits. Future revisions should focus on outputting the grayscale matrix of the surface pressure in a Gem-compatible format (and/or using other Pure-Data-compatible matrix formats that may be used by alternative visual data processing libraries).
Initial release by Rachel Hachem under the guidance of Ivica Ico Bukvic.
Threaded implementation with additional features, including, disconnect, free, identify, improved console output, versioning, and updated help file by Ivica Ico Bukvic .
Improved integration of the contacts API to fix contact id and provide contact status, as well as address missed contact status changes, reworked polling logic and removed reliance on the external metro, added total contact count, and setting the polling time by Ivica Ico Bukvic. Added SimpleSenselSynth example by Peter Nyboer.
Introduced ability to change LED brightness and further improved the help file by Ivica Ico Bukvic.