tosclib.tosc#

API for TOSC Control Elements.

Functions

createTemplate([frame])

Generates a root xml Element and adds the base GROUP node to it.

findKey(elements, key)

Iterate through element with children and return child whose key matches

getTextValueFromKey(properties, key)

Find the value.text from a known key

load(inputPath)

Reads a .tosc file and returns the XML root Element

pullValueFromKey(inputFile, key, value, ...)

If you know the name of an element but don't know its other properties.

pullValueFromKey2(root, key, value, targetKey)

If you know the name of an element but don't know its other properties.

showElement(e)

Generic print string function, UTF-8, indented 2 spaces

write(root, outputPath)

Encodes a root Element to .tosc

Classes

ControlElements

Valid xml tags for a Control

ControlType

Valid xml attrib = {"type":ControlType} for <node>

ElementTOSC

Contains a Node Element and its SubElements.

OSC

Default Elements and Sub Elements for <osc>

Partial

Default Elements for <partial>

Property

Struct like object to carry the property values

PropertyType

Valid xml attrib = {"type":PropertyType} for <property>

Trigger

Default Elements for <trigger>

Value

Default Elements for <value>.

tosclib.controls.Box

Box(id: str = <factory>, properties: list[tosclib.elements.Property] = <factory>, values: list[tosclib.elements.Value] = <factory>, messages: list[tosclib.elements.OSC | tosclib.elements.MIDI | tosclib.elements.LOCAL] = <factory>, children: list['Control'] | None | list = None)

tosclib.controls.Button

Button(id: str = <factory>, properties: list[tosclib.elements.Property] = <factory>, values: list[tosclib.elements.Value] = <factory>, messages: list[tosclib.elements.OSC | tosclib.elements.MIDI | tosclib.elements.LOCAL] = <factory>, children: list['Control'] | None | list = None)

tosclib.controls.Encoder

Encoder(id: str = <factory>, properties: list[tosclib.elements.Property] = <factory>, values: list[tosclib.elements.Value] = <factory>, messages: list[tosclib.elements.OSC | tosclib.elements.MIDI | tosclib.elements.LOCAL] = <factory>, children: list['Control'] | None | list = None)

tosclib.controls.Fader

Fader(id: str = <factory>, properties: list[tosclib.elements.Property] = <factory>, values: list[tosclib.elements.Value] = <factory>, messages: list[tosclib.elements.OSC | tosclib.elements.MIDI | tosclib.elements.LOCAL] = <factory>, children: list['Control'] | None | list = None)

tosclib.controls.Grid

Grid(id: str = <factory>, properties: list[tosclib.elements.Property] = <factory>, values: list[tosclib.elements.Value] = <factory>, messages: list[tosclib.elements.OSC | tosclib.elements.MIDI | tosclib.elements.LOCAL] = <factory>, children: list['Control'] | None | list = None)

tosclib.controls.Group

Group(id: str = <factory>, properties: list[tosclib.elements.Property] = <factory>, values: list[tosclib.elements.Value] = <factory>, messages: list[tosclib.elements.OSC | tosclib.elements.MIDI | tosclib.elements.LOCAL] = <factory>, children: list['Control'] | None | list = None)

tosclib.controls.Label

Label(id: str = <factory>, properties: list[tosclib.elements.Property] = <factory>, values: list[tosclib.elements.Value] = <factory>, messages: list[tosclib.elements.OSC | tosclib.elements.MIDI | tosclib.elements.LOCAL] = <factory>, children: list['Control'] | None | list = None)

tosclib.controls.Page

Not a main control

tosclib.controls.Pager

Pager(id: str = <factory>, properties: list[tosclib.elements.Property] = <factory>, values: list[tosclib.elements.Value] = <factory>, messages: list[tosclib.elements.OSC | tosclib.elements.MIDI | tosclib.elements.LOCAL] = <factory>, children: list['Control'] | None | list = <factory>)

tosclib.controls.Radar

Radar(id: str = <factory>, properties: list[tosclib.elements.Property] = <factory>, values: list[tosclib.elements.Value] = <factory>, messages: list[tosclib.elements.OSC | tosclib.elements.MIDI | tosclib.elements.LOCAL] = <factory>, children: list['Control'] | None | list = None)

tosclib.controls.Radial

Radial(id: str = <factory>, properties: list[tosclib.elements.Property] = <factory>, values: list[tosclib.elements.Value] = <factory>, messages: list[tosclib.elements.OSC | tosclib.elements.MIDI | tosclib.elements.LOCAL] = <factory>, children: list['Control'] | None | list = None)

tosclib.controls.Radio

Radio(id: str = <factory>, properties: list[tosclib.elements.Property] = <factory>, values: list[tosclib.elements.Value] = <factory>, messages: list[tosclib.elements.OSC | tosclib.elements.MIDI | tosclib.elements.LOCAL] = <factory>, children: list['Control'] | None | list = None)

tosclib.controls.Text

Text(id: str = <factory>, properties: list[tosclib.elements.Property] = <factory>, values: list[tosclib.elements.Value] = <factory>, messages: list[tosclib.elements.OSC | tosclib.elements.MIDI | tosclib.elements.LOCAL] = <factory>, children: list['Control'] | None | list = None)

tosclib.controls.Xy

Xy(id: str = <factory>, properties: list[tosclib.elements.Property] = <factory>, values: list[tosclib.elements.Value] = <factory>, messages: list[tosclib.elements.OSC | tosclib.elements.MIDI | tosclib.elements.LOCAL] = <factory>, children: list['Control'] | None | list = None)