OSC: Difference between revisions

From Resonite Wiki
m typo fix
add feature category
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
OSC ([[wikipedia:Open_Sound_Control|Open Sound Control]]) is a networking protocol that allows software and hardware to send/receive data over a network, allowing for interoperability of separate devices. An example of OSC control would be rotating an in-game box with your [https://www.youtube.com/watch?v=AS87ymvZhoM phone's gyroscope by Frooxius].
{{Note|OSC requires the use of third party applications to send/receive data beyond Resonite, please use your best judgement when downloading 3rd party applications.|warning}}


{{Note|OSC requires the use of third party applications to send/receive data beyond Resonite, please ensure you download programs/software that you trust!|warning}}
[[wikipedia:Open_Sound_Control|Open Sound Control]](OSC) is a network protocol that allows software and hardware to send and receive data. It is traditionally used for controlling Sound related equipment such as DJ Equipment, Musical Instruments and Sliders/Faders.
 
However, OSC itself can be used for basically any purpose where you need to send structured data over the network. In Resonite, we're seeing this used for:
* Haptics
* Face and Eye Tracking
* Macro Pads/Shortcut pads
 
== Prerequisities ==
While OSC makes it much easier to get data in and out of Resonite, it is still a network protocol which means that there are some prerequisites:
* Basic knowledge about [[wikipedia:IP_address|IP Addresses]] and [[wikipedia:Port_(computer_networking)|Network Ports]].
* For receiving:
** An open port on the computer running Resonite.
** The IP Address of the computer running Resonite.
* For sending:
** An OSC Server reachable by Resonite on the network
* Some sort of OSC Application/Tool. See [[#Tools|tools]] for some examples.
 
== Components ==
OSC has the following Resonite Components:
* [[Component:OSC_Receiver]] - Receive data into Resonite from OSC
* [[Component:OSC_Sender]] - Send data out of Resonite from OSC
* [[Component:OSC_Value]] - Expose an OSC value as a regular component field
* [[Component:OSC_Field]] - Store an OSC value in another component's value field
 
== Data ==
OSC Supports many data types, but Resonite supports:
* Float
* Double
* Int
* Long
* String
* Color
* ColorX (Will convert to sRGB)
* DateTime
* Byte
 
Many OSC Applications send data purely as Floats.
 
== Multi-Dimensional Values ==
OSC Supports values which have multiple values. This is very similar to Resonite's Type system that has types such as [[Type:Float3|Float3]].
 
For example, an application might send a rotational value as a Multi-Dimensional value, when this occurs you can use the <code>ArgumentIndex</code> to control which value you are interacting with:
 
{| class="wikitable"
|-
! Path !! Argument Index !! Value !! Description
|-
| /osc/rotation || 0 || 90 ||The Pitch value of a rotation
|-
| /osc/rotation || 1 || 180 ||The Yaw value of a rotation
|-
| /osc/rotation || 2 || 0 ||The Roll value of a rotation
|}
 
The structure of OSC messages and data is up to the Sender, as such some applications or tools send this data in different ways.
 
== Tools ==
A number of tools that support OSC already exist and are compatible with Resonite's implementation:
* [https://play.google.com/store/apps/details?id=com.ffsmultimedia.osccontroller OSC Controller] - Control Sliders, Buttons etc on your phone and send the data via OSC
* [https://f-droid.org/en/packages/org.sensors2.osc/ Sensors2OSC] - Send Android Sensor data over OSC
* [https://github.com/Yellow-Dog-Man/Basic-OSC-Example Basic-OSC-Example] - A very simple OSC app written in C#. Used for testing OSC Connectivity.
* [[GigglePuck]] - A haptic device, that vibrates in response to Resonite based Interactions
* [https://github.com/Andymann/ofxOscMidi ofxOscMidi] - A program to receive MIDI messages from a source such as a hardware MIDI controller or software DAW and convert them to OSC messages which Resonite can understand. Can also receive OSC input from Resonite and send to MIDI output.
 
== Examples ==
* Using a Phone's sensors
** Rotating an in-game box with your [https://www.youtube.com/watch?v=AS87ymvZhoM phone's gyroscope by Frooxius].
** Accessing [https://sensors2.org/osc Sensors2OSC] Data - [https://www.youtube.com/watch?v=gn3IcfgpDh0 Tutorial by ProbablePrime]
* Sliders, Buttons and a Multi-Touch System
** [https://youtu.be/l2RmJc9Ek_A Frooxius testing OSC Support]
** [https://www.youtube.com/watch?v=gvbZV_x9cak Tutorial by ProbablePrime]
 
[[Category:Features]]

Latest revision as of 05:48, 10 June 2024

OSC requires the use of third party applications to send/receive data beyond Resonite, please use your best judgement when downloading 3rd party applications.

Open Sound Control(OSC) is a network protocol that allows software and hardware to send and receive data. It is traditionally used for controlling Sound related equipment such as DJ Equipment, Musical Instruments and Sliders/Faders.

However, OSC itself can be used for basically any purpose where you need to send structured data over the network. In Resonite, we're seeing this used for:

  • Haptics
  • Face and Eye Tracking
  • Macro Pads/Shortcut pads

Prerequisities

While OSC makes it much easier to get data in and out of Resonite, it is still a network protocol which means that there are some prerequisites:

  • Basic knowledge about IP Addresses and Network Ports.
  • For receiving:
    • An open port on the computer running Resonite.
    • The IP Address of the computer running Resonite.
  • For sending:
    • An OSC Server reachable by Resonite on the network
  • Some sort of OSC Application/Tool. See tools for some examples.

Components

OSC has the following Resonite Components:

Data

OSC Supports many data types, but Resonite supports:

  • Float
  • Double
  • Int
  • Long
  • String
  • Color
  • ColorX (Will convert to sRGB)
  • DateTime
  • Byte

Many OSC Applications send data purely as Floats.

Multi-Dimensional Values

OSC Supports values which have multiple values. This is very similar to Resonite's Type system that has types such as Float3.

For example, an application might send a rotational value as a Multi-Dimensional value, when this occurs you can use the ArgumentIndex to control which value you are interacting with:

Path Argument Index Value Description
/osc/rotation 0 90 The Pitch value of a rotation
/osc/rotation 1 180 The Yaw value of a rotation
/osc/rotation 2 0 The Roll value of a rotation

The structure of OSC messages and data is up to the Sender, as such some applications or tools send this data in different ways.

Tools

A number of tools that support OSC already exist and are compatible with Resonite's implementation:

  • OSC Controller - Control Sliders, Buttons etc on your phone and send the data via OSC
  • Sensors2OSC - Send Android Sensor data over OSC
  • Basic-OSC-Example - A very simple OSC app written in C#. Used for testing OSC Connectivity.
  • GigglePuck - A haptic device, that vibrates in response to Resonite based Interactions
  • ofxOscMidi - A program to receive MIDI messages from a source such as a hardware MIDI controller or software DAW and convert them to OSC messages which Resonite can understand. Can also receive OSC input from Resonite and send to MIDI output.

Examples