Media osc

From damionrashford/media-os · View interactive version

Media osc is an AI agent skill from the GitHub repository damionrashford/media-os. Open Sound Control (OSC) wire protocol: OSC 1.0 and 1.1 spec, packet layout (address pattern + comma-prefixed type tag + 4-byte-aligned args), OSC bundles with NTP timetags, address-pattern matching (?/*/[]/{}), OSC over UDP/TCP/SLIP, liblo CLIs (oscsend, oscdump), python-osc library, Stanford CCRMA

How to use this skill

Skill file

Media OSC

Context: $ARGUMENTS

Hand-roll OSC 1.0/1.1 packets over UDP from the CLI. No dependencies. For real-time control of SuperCollider, TouchDesigner, Max/MSP, Resolume, QLab, Ableton Link, ReaCoder, or any OSC-speaking app.

Quick start

When to use

Step 1 — Wire format refresher

An OSC packet is either a Message or a Bundle:

Message := <address:OSC-string> <type-tag:OSC-string> <arg0> <arg1> ...
Bundle  := "#bundle\0" <timetag:u64 NTP> <size:i32> <packet> <size:i32> <packet> ...

Address-pattern matching (1.0):

Step 2 — Send

uv run ${CLAUDE_SKILL_DIR}/scripts/oscctl.py send \
    --host 127.0.0.1 --port 7000 \
    /fader/1 --float 0.75

uv run ${CLAUDE_SKILL_DIR}/scripts/oscctl.py send \
    --host 127.0.0.1 --port 7000 \
    /trigger --int 1 --string "cue-3"

Mix --int, --float, --string, --true, --false, --nil, --blob-hex. The script builds the type tag from the order of flags.

TCP with SLIP framing (OSC 1.1):

uv run ${CLAUDE_SKILL_DIR}/scripts/oscctl.py send --tcp \
    --host 127.0.0.1 --port 7000 /volume --float 0.5

Step 3 — Dump (listen)

uv run ${CLAUDE_SKILL_DIR}/scripts/oscctl.py dump --port 7000

Pretty-prints each received packet. Recurses into bundles. Ctrl-C to stop.

Step 4 — Ping reachability

uv run ${CLAUDE_SKILL_DIR}/scripts/oscctl.py ping --host 192.168.1.50 --port 7000 /ping

Sends, waits 500 ms, reports whether any reply was received on the same socket (for apps that mirror).

Step 5 — Send a bundle

cat > cues.json <<'JSON'
{
  "timetag": "+0.5",
  "messages": [
    {"address": "/fader/1", "args": [{"type": "f", "value": 0.25}]},
    {"address": "/cue/go",  "args": [{"type": "i", "value": 3}]}
  ]
}
JSON
uv run ${CLAUDE_SKILL_DIR}/scripts/oscctl.py bundle \
    --host 127.0.0.1 --port 7000 --json cues.json

timetag:

Gotchas

Examples

Example 1 — Ableton Live via LiveOSC / AbletonOSC

uv run ${CLAUDE_SKILL_DIR}/scripts/oscctl.py send \
    --host 127.0.0.1 --port 11000 /live/play

Example 2 — SuperCollider scsynth

uv run ${CLAUDE_SKILL_DIR}/scripts/oscctl.py send \
    --host 127.0.0.1 --port 57110 /s_new --string "default" --int -1 --int 0 --int 0

Example 3 — TouchDesigner OSC In CHOP

uv run ${CLAUDE_SKILL_DIR}/scripts/oscctl.py send \
    --host 192.168.1.20 --port 10000 /ch1/vol --float 0.6

Example 4 — Resolume composition trigger

uv run ${CLAUDE_SKILL_DIR}/scripts/oscctl.py send \
    --host 127.0.0.1 --port 7000 /composition/layers/1/clips/1/connect --int 1

Example 5 — Dry-run a packet (see the hex bytes)

uv run ${CLAUDE_SKILL_DIR}/scripts/oscctl.py send \
    --host 127.0.0.1 --port 7000 /fader/1 --float 0.75 --dry-run

Reference docs

CLI alternatives

Troubleshooting

Receiving app sees nothing

Cause: Wrong port, firewall, or sending to 127.0.0.1 instead of 0.0.0.0/LAN IP.

Solution: tcpdump -i any -nn udp port 7000 to confirm packets on the wire. Fix firewall or bind address.

Args arrive as garbage (wrong types)

Cause: Type tag order doesn't match arg order, or missing leading ,.

Solution: Use --dry-run --verbose to print the exact bytes. Rebuild with args in declared order.

Bundle ignored

Cause: Some apps reject bundles with past timetags.

Solution: Use "now" for immediate, or "+0.1" for a tiny future delay.

TCP framing mismatch

Cause: Receiver expects SLIP but we send length-prefix (or vice versa).

Solution: Most apps accept either; check docs. --tcp-framing slip forces SLIP.

Stanford URL 404

Cause: Path changed.

Solution: Canonical pages are https://opensoundcontrol.stanford.edu/spec-1_0.html and spec-1_1.html. If those 404, try https://ccrma.stanford.edu/groups/osc/.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.