SendViaOsc
These pages are not yet fully reviewed. The LUIDA team is continuing to review and improve them. If you find anything wrong on these pages, or have questions that aren't resolved by reading them, please ask or report to the LUIDA team.
SendViaOsc(participantId, address, values)StableUser Feedback & Utilities- Fires
- On State Start · During State · On State Exit
Description
Sends an OSC message from the client of the player specified by participantId. This is typically used to control external hardware or software outside Cluster.
Parameters
| Name | Type | Description |
|---|---|---|
participantId | integer (≥ 1) | 1-based participant index. Identifies which client emits the OSC packet. |
address | string | OSC path. Must begin with / (e.g., /eeg/marker). |
values | array | Argument list. Each element must be Boolean, Number, or String. |
Side effects
- Resolves the target player via
PARTICIPANTS[participantId]and dispatches an OSC packet from that participant's client process. The packet is sent over UDP from the participant's machine — not from a Cluster server — so the receiver (EEG box, MoCap rig, lighting controller) must be reachable on that LAN. - Silently no-ops if the participant is not present, on an unsupported platform, or has OSC disabled in their Cluster client.
- No state keys are written, no signals fired, and
$.groupStateis untouched. - The OSC destination host and port are configured client-side in Cluster, not by this action. The action only specifies what to send; where it goes is the participant's Cluster client settings.
Example
Mark the onset of a stimulus to an external EEG box on participant 1's machine, sending the condition's fontColor as a string argument:
// On State Start of a Trial - Start
SendViaOsc(1, "/eeg/marker", ["stimulus_on", CONDITION["fontColor"]]);For boolean toggles to external hardware (e.g., a relay-driven light):
// Turn on
SendViaOsc(1, "/lab/relay/1", [true]);
// Turn off
SendViaOsc(1, "/lab/relay/1", [false]);Related
SendHaptics(participantId, target, frequency, amplitude, duration)— the other per-client "talk to this participant's machine" action.- Reference → Variables →
PARTICIPANTS— the index resolution model. - Concepts → Data collection — when OSC fits alongside
SendDataToCollectoras an out-of-band side-channel.
Source
Assets/Doc/LUIDA-StateListeningItemScriptDoc.md
Original markdown body
- **Description**: Sends an OSC message from the client of the player specified by `participantId`. This is typically used to control external hardware or software outside Cluster.
- **Parameters**:
- `participantId`: `integer` (starts from 1).
- `address`: `string`
- The OSC path, which must begin with `/` (e.g., `/sample`).
- `values`: `array`
- A list of arguments to send with the message. Each argument should be one of the following types: `Boolean`, `Number`, `String`.