Sensors2OSC

Open Sound Control (OSC) is a protocol for networking sound synthesizers, computers, and other multimedia devices for purposes such as musical performance or Show control. Bringing the benefits of modern networking technology to the world of electronic musical instruments, OSC’s advantages include interoperability, accuracy, flexibility, and enhanced organization and documentation.
Wikipedia

This is an Android app for sending sensor data via Open Sound Control (OSC).

Get it from F-Droid

Basics

Depending on your Android version and your device, a number of sensors are available for apps to read. This app enables you to selectively send this data as float over OSC to any receiver.

Use the settings dialog to set the host, that should receive the data, as well as the UDP port, that the receiver is listening to. The rate of sensor readings is settable too.

The switches on the main screen are used to toggle sending of data.

The main switch toggles sending the data as a whole. Only when this switch is set to “on” will the app send data over the network.

Different sensors have different number of ranges and different number of values. Each sensor type has a corresponding OSC address, that is shown to the right of the sensor name.

If a sensor has only one value, then the value will be sent as:
/<osc_prefix> ,<n times f> <values separated by space>
Example for one dimensional data: /proximity ,f 9.
Example for three dimensional data: /acceleration ,fff 0.001 -0.001 9.790.

The numerical values all correspond to real physical values, for details about these and possible ranges, see the Android developer documentation.

Tapping on multitouch while sending data is enabled will enable sending touch data. Each finger touching the phone will send a two dimensional data corresponding to Cartesian coordinates, normalized to a range of 0 to 1, starting from bottom left. Lifting the finger will result in a message of -1 on both axes.

Usage Examples

An example of a working Pd patch that displays typical sensors for most devices and multi-touch:

The phone is lying flat on the desk, so only the gravity is showing as the acceleration value. Shaking the phone violently will show much higher absolute values. NB: negative values are possible as well.

Three fingers are still touching the phone. Values range from 0 to 1. Finger 1 has been lifted from the phone, so it reports both X and Y as -1. There were never more than 4 fingers on the multi-touch page, so touch5 and higher show constant 0. NB: finger 1 has been lifted, but the other touches are not renumbered.

Download and Installation


Get it on F-Droid

You can also download the source code from Github and build it yourself:

  • Install Android SDK and Gradle
  • Build it by running gradlew (Mac, Linux) or gradle.bat (Windows)

Development and Bug Reporting

Development is done over at Github.

If you want to report a bug, please first have a look at the issue tracker. If you already have a Github account, please report your bug there.

You can also send bug reports or feature requests to osc-bugs@sensors2.org. Please try to be as specific about your problem as possible.

If you want to help with translating: Translation is currently coordinated via weblate.
Translation state

License

Authors:
Thomas Mayer <thomas@residuum.org>
Antonio Deusany de Carvalho Junior <dj@ime.usp.br>

Contributors:
Tal Kirshboim
naofum (Japanese translation)

Copyright (c) 2014 – 2017 Thomas Mayer, Antonio Deusany de Carvalho Junior
and others.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Uses the following component:
JavaOSC, licensed under its own terms.