This is an alternative implementation to @timthompson’s MorphOsc which is Windows-only. senselosc is currently tested on OSX with SuperCollider.
OSC implementation is straight-forward, so this should also work with any other OSC-capable host (e.g. Reaktor/Pd/…).
The project is written to be cross-platform and should thus also work (with slight changes in the cmake configuration files) on Linux. I did not yet test this, though and would be happy for others to give it a try.
OSC interface
Usage: senselosc [options]
options:
-h [ --help ] this help message
-x [ --nobundle ] send messages unbundled
-d [ --scandetail ] arg set scanning detail (0: low, 1:med, 2:high), defaults
to high
-p [ --port ] arg set output port number (default: 7000)
OSC messages sent:
/morph <index> <id> <state> <x> <y> <force> <area> <orient> <major_axis> <minor_axis>
/morphDelta <index> <id> <d_x> <d_y> <d_force> <d_area>
/morphBB <index> <id> <min_x> <min_y> <max_x> <max_y>
/morphPeak <index> <id> <peak_x> <peak_y> <peak_force>
with
index [int] device index (currently always 0)
id [int] contact id (0..15)
state [int] one of invalid(0), start(1), move(2), end(3)
x [float] x-coordinate in [mm]
y [float] y-coordinate in [mm]
force [float] sum of pressure applied [g]
area [int] covered area [sensels]
orientation [float] orientation of bounding elipsis [deg] (0..360)
major_axis [float] major axis length of bounding elipsis [mm]
minor_axis [float] minor_axis length of bounding elipsis [mm]
delta_x [float] x displacement [mm]
delta_y [float] y displacement [mm]
delta_force [float] change of force [g]
delta_area [int] change of covered area [sensels]
min_x [float] upper-left x-coordinate of bounding-box [mm]
min_y [float] upper-left y-coordinate of bounding-box [mm]
max_x [float] lower-right x-coordinate of bounding-box [mm]
max_y [float] lower-right y-coordinate of bounding-box [mm]
peak_x [float] x-coordinate of pressure peak [mm]
peak_y [float] y-coordinate of pressure peak [mm]
peak_force [float] force at pressur peak [g]
(unfortunately, I cannot edit my initial post anymore, so here you have the updated interface)
I implemented some additional features I found useful (average position / force, force-weighted average position, …) and changed the OSC-interface to
/contactAvg index num_contacts x y avg_force avg_dist area x_w y_w total_force avg_wdist
/contact index id state x y force area dist wdist orientation major_axis minor_axis
/contactDelta index id delta_x delta_y delta_force delta_area
/contactBB index id min_x min_y max_x max_y
/contactPeak index id peak_x peak_y peak_force
i am trying to compile senselosc on my manjaro (arch based) linux machine.
i unpacked the files from senselliblinux0.8.2.deb in /usr/lib/, /usr/include/ and senselapp0.19.32.deb in /usr/share/.
the app is working and detects sensel and the L2Ork Pd external (after installing senselliblinux0.8.2) works as well.
but “cmake -S . -B build” outputs the following error:
-- The CXX compiler identification is GNU 11.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Doxygen: /usr/bin/doxygen (found version "1.9.3") found components: doxygen dot
-- Found Boost: /usr/lib64/cmake/Boost-1.78.0/BoostConfig.cmake (found suitable version "1.78.0", minimum required is "1.73") found components: program_options
CMake Error at CMakeLists.txt:52 (find_package):
By not providing "FindSensel.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Sensel", but
CMake did not find one.
Could not find a package configuration file provided by "Sensel" with any
of the following names:
SenselConfig.cmake
sensel-config.cmake
Add the installation prefix of "Sensel" to CMAKE_PREFIX_PATH or set
"Sensel_DIR" to a directory containing one of the above files. If "Sensel"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!
this looks cmake script cannot find the sensel lib… i do not have a linux system at hand atm and additionally, i cannot get the sensel lib built on my m1 system, so a lottle difficult to help… maybe you could try changing the path to the sensel lib by hand in the cmake script and try again?
no. i m afraid it doesnt help. also tried before removing the “local” from path. same error.
so i wonder if it really doesnt find the lib or if there is some sort of compatibility issue.
is there a way to test this ?
changed the ownership of all sensel files in /usr/lib and /usr/include to root. also no succsess.
did this work on linux before ?
pd external L2Ork Sensel Morph v.1.2.0 and sensel app work well (besides some grafik glitches in the app).
yes. that works ! we are getting closer
now it hangs at:
/home/username/senselosc/extern/oscpack
does not contain a CMakeLists.txt file.
that folder is empty
$ cmake -S . -B build ✔
-- The C compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Version: 5.3.0
-- Build type:
-- CXX_STANDARD: 11
-- Performing Test has_std_11_flag
-- Performing Test has_std_11_flag - Success
-- Performing Test has_std_0x_flag
-- Performing Test has_std_0x_flag - Success
-- Performing Test SUPPORTS_VARIADIC_TEMPLATES
-- Performing Test SUPPORTS_VARIADIC_TEMPLATES - Success
-- Performing Test SUPPORTS_INITIALIZER_LIST
-- Performing Test SUPPORTS_INITIALIZER_LIST - Success
-- Performing Test SUPPORTS_ENUM_BASE
-- Performing Test SUPPORTS_ENUM_BASE - Success
-- Performing Test SUPPORTS_TYPE_TRAITS
-- Performing Test SUPPORTS_TYPE_TRAITS - Success
-- Performing Test SUPPORTS_USER_DEFINED_LITERALS
-- Performing Test SUPPORTS_USER_DEFINED_LITERALS - Success
-- Looking for open
-- Looking for open - found
CMake Error at CMakeLists.txt:64 (add_subdirectory):
The source directory
/home/username/senselosc/extern/oscpack
does not contain a CMakeLists.txt file.
-- Configuring incomplete, errors occurred!
See also "/home/username/senselosc/build/CMakeFiles/CMakeOutput.log".