Create OSC Translator File

Usine contains a powerful OSC messages translator used to automatically convert incoming or outgoing OSC messages.

Available in the Expert version only

In the setup-panel-tab-network the OSC translator file option allows to load a file which describes how the messages have to be translated. Translation can be made in both direction, input and output.

The file is a text file with the extension .osc-translator.

convert OSC addresses

:: example of OSC address conversion
[/position/*/x]
target=/usine/position/x/*

[/position/*/y]
target=/usine/position/y/*

In the example above the incoming OSC messages of the form /position/.../x will be translated into /usine/position/x/.... The * character is a joker. It means that it can take any value. For example input message /position/1/x will be translated into /usine/position/x/1 or /position/ball/x will be translated into /usine/position/x/ball.

conversion direction

By default the conversion is made in both direction for incoming and outgoing messages. But you can specify the conversion direction

In the example above, the translation is made also for outgoing messages. So output messages of the form /usine/position/x/... will be translated into /position/.../x. For example output message /usine/position/x/1 will be translated into /position/1/x or /usine/position/x/ball will be translated into /position/ball/x.

mode=in      (only for incoming messages)
mode=out     (only for out going messages)
mode=in-out  (default)

Example

:: example of different directions
[/get/position/*/x]
mode=in
target=/usine/position/x/*

[/set/position/*/x]
mode=out
target=/usine/position/x/*

The target is always the message that goes to or comes from Usine. So, in this example output messages /usine/position/x/*will be converted into /set/position/*/x.

range conversion

You can specify the ranges of values if they have to be also converted. min-source=-100, max-source=100 defines that the range of /position/*/x messages is in the interval [-100..100] and must be converted into min-target=0, max-target=1 so the interval [0..1].

:: range conversion
[/position/*/x]
min-source=-100
max-source=100
target=/usine/position/x/*
min-target=0
max-target=1

[/position/*/y]
min-source=-100
max-source=100
target=/usine/position/y/*
min-target=0
max-target=1

multiple range conversion

If the messages contains several type-tags you can specify for each value, the ranges of the conversion as in the example bellow:

:: example of a 3 values message (type fff)
[/position/*/xyz]
min-source1=-100
max-source1=100
min-source2=-200
max-source2=200
min-source3=-50
max-source3=50
target=/usine/position/xyz/*
min-target1=0
max-target1=1
min-target2=0
max-target2=1
min-target3=0
max-target3=1

The first value (x) incoming value is in the range min-source1=-100, max-source1=100, the second value (y) is in the range min-source2=-200, max-source2=200 and the third value (z) is in the range min-source3=-50, max-source3=50. They will be converted in the range respectively min-target1=0, max-target1=1, min-target2=0, max-target2=1, etc.

See also

version 5.2.221206

Edit All Pages