OSC Message Elements#

In order to create a correct OSC message, we will use a few classes that set the specific Sub Elements of the <osc> Element.

We can create a message from ElementTOSC with:

ElementTOSC.createOSC(message=<tosclib.elements.OSC object>)[source]#

Builds and appends an OSC message

Parameters

message (tosclib.elements.OSC) –

Return type

bool

Then we can construct a custom osc message with the help of these classes:

class tosclib.tosc.OSC[source]#

Default Elements and Sub Elements for <osc>

Parameters
  • enabled (str, optional) – Boolean. Defaults to “1”.

  • send (str, optional) – Boolean. Defaults to “1”.

  • receive (str, optional) – Boolean. Defaults to “1”.

  • feedback (str, optional) – Boolean. Defaults to “0”.

  • connections (str, optional) – Binary.

  • "00001" (Defaults to) –

  • triggers (List[Trigger], optional) – [Trigger].

  • [Trigger()]. (Defaults to) –

  • path (List[Partial], optional) – [Partial].

  • [Partial (Defaults to) –

  • arguments (List[Partial], optional) – [Partial].

  • [Partial

__init__(enabled='1', send='1', receive='1', feedback='0', connections='00001', triggers=[<tosclib.elements.Trigger object>], path=[<tosclib.elements.Partial object>, <tosclib.elements.Partial object>], arguments=[<tosclib.elements.Partial object>])[source]#
Parameters
__new__(**kwargs)#
class tosclib.tosc.Trigger[source]#

Default Elements for <trigger>

Parameters
  • var (str, optional) – “x” or “touch”. Defaults to “x”.

  • con (str, optional) – “ANY”, “RISE” or “FALL”. Defaults to “ANY”.

__init__(var='x', condition='ANY')[source]#
Parameters
  • var (str) –

  • condition (str) –

__new__(**kwargs)#
class tosclib.tosc.Partial[source]#

Default Elements for <partial>

Parameters
  • type (str, optional) –

  • "CONSTANT"

  • "INDEX"

  • "VALUE"

  • "CONSTANT". ("PROPERTY". Defaults to) –

  • conversion (str, optional) –

  • "BOOLEAN"

  • "INTEGER"

  • "FLOAT"

  • "STRING". ("STRING". Defaults to) –

  • value (str, optional) – Depends on the context. Defaults to “/”.

  • scaleMin (str, optional) – If “VALUE”, set range. Defaults to “0”.

  • scaleMax (str, optional) – If “VALUE”, set range. Defaults to “1”.

__init__(type='CONSTANT', conversion='STRING', value='/', scaleMin='0', scaleMax='1')[source]#
Parameters
  • type (str) –

  • conversion (str) –

  • value (str) –

  • scaleMin (str) –

  • scaleMax (str) –

__new__(**kwargs)#