#hs.osc

Open Sound Control (OSC) support.

This extension allows you to create both OSC Servers and Clients.

This extension was thrown together by Chris Hocking for CommandPost.

This extension uses F53OSC.

F53OSC LICENSE: Copyright (c) 2010-2020 Figure 53 LLC, https://figure53.com

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.


#API Overview

Constructors - API calls which return an object, typically one that offers API methods

Methods - API calls which can only be made on an object returned by a constructor


#API Documentation

#Constructors

Signaturehs.osc.newClient(host, port) -> oscObject
TypeConstructor
DescriptionCreates a new OSC Client.
Parameters
  • host - A string of the host path.
  • port - A number of the port.
Returns
  • An hs.osc object or nil if an error occured.
NotesNone
ExamplesNone
Sourceextensions/osc/libosc.m line 167

Signaturehs.osc.newServer(listeningPort) -> oscObject
TypeConstructor
DescriptionCreates a new OSC Server.
Parameters
  • listeningPort - A number for the listening port.
Returns
  • An hs.osc object or nil if an error occured.
NotesNone
ExamplesNone
Sourceextensions/osc/libosc.m line 136

#Methods

Signaturehs.osc:callback(callbackFn) -> oscObject
TypeMethod
DescriptionSets or removes a callback function for a OSC Server.
Parameters
  • callbackFn - a function to set as the callback for this OSC Server. If the value provided is nil, any currently existing callback function is removed.
Returns
  • The hs.osc object
Notes
  • The callback function should expect 3 arguments and should not return anything:
  • oscObject - The OSC object that triggered the callback.
  • addressParts - A table of address parts.
  • arguments - A table of arguments.
ExamplesNone
Sourceextensions/osc/libosc.m line 202

Signaturehs.osc:host() -> string
TypeMethod
DescriptionReturns the host path of a OSC Client.
Parameters
  • None
Returns
  • The host as a string.
NotesNone
ExamplesNone
Sourceextensions/osc/libosc.m line 278

Signaturehs.osc:isActive() -> boolean
TypeMethod
DescriptionGets whether or not a OSC Server or Client is active.
Parameters
  • None
Returns
  • true if open, otherwise false.
NotesNone
ExamplesNone
Sourceextensions/osc/libosc.m line 361

Signaturehs.osc:listeningPort() -> number
TypeMethod
DescriptionReturns the listening port of a OSC Server.
Parameters
  • None
Returns
  • The port as a number.
NotesNone
ExamplesNone
Sourceextensions/osc/libosc.m line 244

Signaturehs.osc:port() -> number
TypeMethod
DescriptionReturns the port of a OSC Client.
Parameters
  • None
Returns
  • The port as a number.
NotesNone
ExamplesNone
Sourceextensions/osc/libosc.m line 261

Signaturehs.osc:send(address, arguments) -> oscObject
TypeMethod
DescriptionSends a message from an OSC Client.
Parameters
  • address - A string of the OSC address.
  • arguments - A table of arguments.
Returns
  • The hs.osc object.
NotesNone
ExamplesNone
Sourceextensions/osc/libosc.m line 331

Signaturehs.osc:start() -> oscObject
TypeMethod
DescriptionStarts an OSC Server or Client.
Parameters
  • None
Returns
  • The hs.osc object.
NotesNone
ExamplesNone
Sourceextensions/osc/libosc.m line 295

Signaturehs.osc:stop() -> oscObject
TypeMethod
DescriptionStops an OSC Server or Client.
Parameters
  • None
Returns
  • The hs.osc object.
NotesNone
ExamplesNone
Sourceextensions/osc/libosc.m line 313