Skip to content

OSC operation API v1 ​

Addresses start with /xhape/. Enable OSC in Preferences > Remote control. UDP uses the existing port (9000 by default). TCP is independently enabled on the same numeric port. The listen address is installation-local, defaults to 0.0.0.0, and can be set to 127.0.0.1 for local-only operation. No project stores network listener settings. This is a trusted local show-control network interface, without login.

Existing /xhape/play, /xhape/pause, /xhape/toggle, /xhape/stop, cue and marker navigation (/xhape/marker/next, /xhape/marker/prev), timeline navigation, relative seek and view addresses retain their meaning. /xhape/go, /xhape/devamp and /xhape/devamp/cancel are additional fire-and-forget controls for simple buttons. So is /xhape/panic, which stops the transport and silences the MIDI gear of the project (all sound off, reset controllers and all notes off on 16 channels of every MIDI port it uses); see Remote control.

Requests and replies ​

Every /xhape/v1/... request starts with a nonempty OSC string request ID (up to 128 bytes). Parameters below follow that ID. Replies go to the UDP sender's address/port or the same TCP connection:

text
/xhape/v1/reply  <requestId:string> <ok:OSC-boolean> <result:JSON-string>

Successful actions return {"accepted":true}. This acknowledges queuing, not completion of a transition; state feedback reports execution. Errors return {"error":"reason"}. An unknown address, missing/invalid argument, unknown identity or unavailable output is an explicit error.

The last 256 replies are cached for 60 seconds by sender and request ID. Retrying an identical request returns the cached reply without executing it again. Reusing an ID with different content returns requestIdConflict. Give every new action or lease renewal a new ID. Legacy fire-and-forget addresses do not have this deduplication guarantee.

Packets are OSC messages or bundles processed in order. Timetags are ignored, as with the original interface: packets request immediate operation, not future scheduling. TCP packets have a four-byte unsigned big-endian length prefix. Zero-length frames and frames larger than 65,507 bytes close the connection. Oversized replies return responseTooLarge.

Dictionary ​

AddressAdditional argumentsResult/action
/xhape/v1/state/getnoneRevision and current show state
/xhape/v1/setlists/getnoneSetlists and entries, including omitted entries
/xhape/v1/setlist/selectsetlist ID: stringPrepare the included entries; requires a stopped show
/xhape/v1/entry/prepareentry ID: stringPrepare an included entry in the current run; requires Stop
/xhape/v1/timelines/getnoneTimeline IDs, names and timecode settings
/xhape/v1/timeline/selecttimeline ID: stringLeave setlist operation and prepare ordinary timeline playback; requires Stop
/xhape/v1/cues/getnoneCurrent timeline's derived cues with stable IDs
/xhape/v1/cue/gotocue ID: stringSeek without replaying skipped events
/xhape/v1/gononeRun the displayed GO action
/xhape/v1/devampnoneRequest exit after the current loop turn
/xhape/v1/devamp/cancelnoneWithdraw the pending loop exit
/xhape/v1/transport/playnonePlay/resume transport; explicit GO waits still require GO
/xhape/v1/transport/pausenonePause
/xhape/v1/transport/stopnoneStop and reset the current entry
/xhape/v1/panicnoneStop, then MIDI panic. The reply result is { sent, viaOutput, failed }: ports reached (of which viaOutput through the running output) and the names of those that were not
/xhape/v1/transport/seekabsolute frame: nonnegative OSC intSeek within the current timeline
/xhape/v1/tracks/getnoneCurrent tracks and operational levels/mutes
/xhape/v1/track/gaintrack ID: string, dB: int/floatSet an audio/operator track's run level, −60 to +6; requires a prepared setlist
/xhape/v1/track/mutetrack ID: string, muted: bool or 0/1Set its run mute; requires a prepared setlist
/xhape/v1/outputs/getnoneOutput/device information and route health
/xhape/v1/subscribeoptional Hz: int (1–30, default 10), optional UDP reply port: intSubscribe or renew state feedback
/xhape/v1/unsubscribenoneRemove this sender's subscription

Operational levels apply to every reference to that timeline in the prepared run. They do not rewrite the project. Setlist order, controls and event editing remain in Edit, not in this API.

Feedback ​

Feedback uses /xhape/v1/state with the same three-argument reply envelope. Its JSON contains sequence, revision, and state. Sequence increases per subscriber, so a UDP client can detect missing updates. Query a fresh snapshot after a gap. Revision belongs to this listener's lifetime and changes when its observed state changes; it is not a project revision.

The state includes entry/timeline identity, current and next entry, transport position and frame rate, show status, the available GO action, loop turn, pending devamp, current/next cue, running cues, audio route health and operational track levels. go: "none" means a GO button should be disabled; blocked requires operator attention.

UDP leases expire after 30 seconds; renew with a new request ID before then. A reply port can only redirect feedback to another port on the sender's IP. TCP subscriptions last until unsubscribe or disconnection. Important state changes are sent promptly; position updates follow the requested rate. There are at most 32 subscribers/connections, and slow TCP clients are disconnected when their bounded pending data fills. Feedback cannot block audio playback.

Examples ​

For a simple Stream Deck OSC button, send /xhape/go without arguments. For a controller with feedback, send these OSC messages (quotes denote OSC strings, not literal quote characters):

text
/xhape/v1/setlists/get "list-1"
/xhape/v1/setlist/select "prepare-1" "<setlist-id-from-the-reply>"
/xhape/v1/subscribe "subscribe-1" 10 9001
/xhape/v1/go "go-1"
/xhape/v1/devamp "exit-1"
/xhape/v1/transport/stop "stop-1"

TouchOSC can listen on 9001 and use state.status, state.go and state.devampPending from the feedback JSON to drive indicators. Renew its UDP subscription periodically with new IDs. OSC packet delivery and external device behavior still need a sound/show-control check at the venue.

Xhape is in early development and licensed under the GNU General Public License v3.0 or later. Xhape™ and the Xhape logo are trademarks of Juan Luis Caro Benito.