Files
video-shader-toys/docs/OSC_CONTROL.md
Aiden 254d4cd070
Some checks failed
CI / Native Windows Build And Tests (push) Failing after 7s
CI / React UI Build (push) Has been cancelled
CI / Windows Release Package (push) Has been cancelled
Added OSC
2026-05-03 12:17:03 +10:00

66 lines
1.3 KiB
Markdown

# OSC Control
Video Shader Toys can listen for local OSC messages and map them onto shader layer parameters.
## Configuration
Set the UDP port in `config/runtime-host.json`:
```json
{
"oscPort": 9000
}
```
Set `oscPort` to `0` to disable the OSC listener.
## Address Pattern
Send OSC messages to:
```text
/VideoShaderToys/{LayerNameOrID}/{ParameterNameOrID}
```
Examples:
```text
/VideoShaderToys/layer-1/brightness
/VideoShaderToys/VHS/intensity
/VideoShaderToys/TemporalLowFPS/frameRate
```
Layer keys are resolved against:
- Layer ID, such as `layer-1`
- Shader package ID, such as `vhs`
- Shader display name, such as `VHS`
Parameter keys are resolved against:
- Parameter ID from `shader.json`
- Parameter label from `shader.json`
Matching is exact first. If that fails, names are compared in a simplified form that ignores spaces, underscores, hyphens, and casing. For live control, prefer stable IDs where possible.
## Values
The listener accepts one OSC argument per message:
- `f`: float
- `i`: integer
- `s`: string
- `T` / `F`: boolean true/false
Values are validated with the same shader parameter rules used by the REST API. Invalid values or unknown addresses are ignored.
## Network
The listener binds to localhost only:
```text
127.0.0.1:<oscPort>
```
This keeps the control surface local to the machine running Video Shader Toys.