The spiderweb problem
Separate mappings. Separate parsers. Silent failures between tools that are meant to work together.
CONVENTION-BASEDA shared language for live creative systems. Mathematical grounding for everything you make.
PCHI (Peachy) v2.0 is a scene state protocol with embedded PIR (Prime Integer Relations) mathematical invariants, bringing coordination, verification, and intelligence to live creative software.
Live shows can involve 10+ tools—Resolume, TouchDesigner, Ableton, lighting consoles, and tracking systems—connected through dozens of custom OSC mappings. Scene coherence is maintained by convention. When something breaks, it can be difficult to know which state is valid.
PCHI standardizes the “letter”—the message schema—while remaining transport-agnostic. It adds explicit mathematical checks, so state verification becomes part of the protocol rather than an assumption.
Separate mappings. Separate parsers. Silent failures between tools that are meant to work together.
CONVENTION-BASEDA unified schema and a central Conductor. Every proposed update passes through the same validation process.
MATHEMATICS-BASEDEvery PCHI message carries invariant data describing its mathematical state. Before a change is applied, the Conductor checks these values against its configured validation criteria.
{
"pirInvariants": {
"equilibriumCheck": {
"residual": 0.000000000001,
"precision": 1e-12,
"signSequence": [1, -1, -1, 1]
},
"coherenceGap": 0.0234,
"curvatureSignature": "0.001234, -0.000567, 0.000890",
"residual": 0.000000000001
}
}
Generative agents can introduce unexpected changes into a live environment. Only-Lang rules — real .only-pchi files, parsed and evaluated by primeswarm-pchi/src/only_lang.rs, not a description — define explicit boundaries for those behaviors, and the Conductor evaluates them against every incoming message before it reaches receivers.
if tentacle_system.total_curl > 4.0 then
deny("Tentacle curl exceeds harmonic threshold")
end
When this fires, the Conductor rejects the update — and signs (Ed25519) and hash-chains the decision into an append-only governance log, in the same pattern DGV uses for tool-call authorization. Export it and check it independently, no trust in the running Conductor required:
curl http://127.0.0.1:3000/governance/export > export.json
python3 scripts/verify_governance_chain.py export.json
# ✅ All receipts verified — chain contiguous, hashes correct, signatures valid.
The rule grammar is a documented, tested subset (if/then/end, and/or, escalate/deny/evolve) — not the full grammar shown in some example files. A signed receipt proves the Conductor enforced the rule as written; it doesn't audit whether the rule's own threshold is the right one for your show. Software governance is one layer of protection — not a substitute for show-specific safety limits, hardware interlocks, or operator oversight. See LIMITATIONS.md for the full list.
A common message format carries object state, control parameters, musical context, and tracking data. JSON keeps messages readable; FlatBuffers supports high-performance binary serialization.
The overview example uses a state_update envelope. Check the repository’s versioned schema for the exact message types and fields your implementation supports.
The PrimeSwarm Engine acts as the PCHI Conductor: a central Rust-based server that receives proposed changes, verifies them, and distributes a coherent state to connected tools.
Install Git and the Rust toolchain, then clone the repository. Consult its README for current prerequisites and configuration.
// Check the repository for current imports and API signatures.
#[tokio::main]
async fn main() {
let conductor = PCHIConductor::new(1e-12);
conductor.start_transport("0.0.0.0:8888").await.unwrap();
conductor.load_rules("kraken-rules.only").await.unwrap();
tokio::signal::ctrl_c().await.unwrap();
}
UDPTCPWebSocketOSC bridgesStart by identifying which role a tool plays. A creative system may send updates, receive validated state, or do both.
Clients translate their native state into PCHI messages and calculate invariant data before sending. Think Ableton Live, Resolume Arena, or tracking hardware.
PROPOSE A CHANGEHosts listen to the Conductor’s validated broadcast and apply updates to their internal scene. Think Unreal Engine or a TouchDesigner scene network.
APPLY VERIFIED STATEThe bridge listens for OSC messages from Resolume Arena, calculates invariant data, converts messages into the PCHI format, and forwards them to the Conductor.
pip install python-osc numpy
python resolume_pchi_bridge.py \
--resolume-port 7000 \
--pchi-host 127.0.0.1 \
--pchi-port 8888 \
--threshold 1e-12
An OSC address such as /composition/layers/{layer_id}/video/opacity maps to a PCHI control_parameter targeting that layer.
A Python CHOP connects to the Conductor over UDP and creates channels from incoming scene objects, musical context, and invariant status.
equilibriumcoherence_gapbpmbeatkicksnare{object_id}_x_y_zExport the appropriate channels to a Geometry COMP’s transform parameters to drive your objects from the shared scene state.
Browse CHOP sourceA Max for Live device monitors Ableton’s musical state, including BPM and clip changes. It calculates PIR invariant data from the musical state and emits a musical_context payload.
127.0.0.18888Pitch values can be mapped to Prouhet–Thue–Morse sequences for equilibrium calculations. Match the device’s transport and destination to your Conductor before sending.
Browse Max device filesTiXL is an open-source, real-time motion graphics tool (C#/.NET, DirectX 11). There's no separate plugin DLL system — TiXL is the SDK, and operators are .cs source files the running editor compiles and hot-reloads. Two integration paths exist, trading off setup simplicity against directness.
A Python process sits between TiXL's own OscOutput/OscInput operators and the Conductor. TiXL's OSC operators are built on Rug.Osc, a real spec-compliant library — confirmed directly from TiXL's source (Operators/Io/Symbols/lib/io/osc/{OscOutput,OscInput}.cs), so no wire-format guesswork was needed on the TiXL side.
pip install python-osc websocket-client
python tixl_pchi_bridge.py \
--osc-in-port 9001 \
--osc-out-port 9002 \
--pchi-host 127.0.0.1 \
--pchi-port 8888 \
--pchi-ws-port 8889
In TiXL, an OscOutput sends to the bridge's --osc-in-port at the fixed address /pchi/control, with a float value and a string payload of "<target_id>.<parameter>". An OscInput listening on --osc-out-port receives /pchi/governance/gate_state as a float — 1.0/0.5/0.0 for ALLOW/ESCALATE/DENY, since OscInput's outputs are float-only (confirmed from source, no string channel).
PCHISendControlParameter and PCHIGovernanceReceive are real TiXL operators — Instance<T> subclasses carrying [Guid]/[Input]/[Output] attributes, the same shape as any built-in TiXL op. PCHISendControlParameter writes raw JSON directly over UDP; PCHIGovernanceReceive owns a reconnecting ClientWebSocket and exposes GateState/ReceiptId/Tool/IsConnected as live outputs — no bridge process in between.
cd tixl-native-operators/verify-build
dotnet build Pchi.csproj # references TiXL's own Core.csproj
Governance telemetry on both paths requires vdmo/pchi#5 (the WebSocket accept-loop fix) and benefits from #9 (heartbeat exclusion, so a lingering violation doesn't sign a fresh receipt on every heartbeat). Control updates work regardless.
cables.gl is an open-source, browser-based node/patch tool for interactive content. Patches run entirely inside a browser sandbox, which cannot open a raw UDP socket — the transport the Conductor's control-update path requires. A relay translates between the two: browser-safe HTTP/WebSocket on the cables side, raw JSON-over-UDP and a WebSocket client on the Conductor side.
pip install websockets
python cables_pchi_relay.py \
--http-port 9100 \
--ws-port 9101 \
--pchi-host 127.0.0.1 \
--pchi-port 8888 \
--pchi-ws-port 8889 \
--cors-origin "*"
Outbound, use an HTTP request op to POST to http://<relay>:9100/pchi/control with a JSON body (target_id, parameter, value). Inbound, point cables' own WebSocket op at ws://<relay>:9101 — the governance-telemetry leg needed zero new protocol work, since cables already ships a working WebSocket client op, confirmed against a real official example (cables-gl/websocket-example). Each message carries both a flattened gate_state string and a numeric gate_state_code (1.0/0.5/0.0), since cables' JSON handling isn't constrained to numbers the way TiXL's float-only OSC outputs are.
A cables patch is served from a different origin than the relay, so every control POST is cross-origin — the browser sends a CORS preflight (OPTIONS) first. Both the preflight and the actual request are handled; tighten --cors-origin from the development default (*) for anything reachable beyond your own machine.
Grab the schemas, connect your tools, and start building with PCHI.
Projects & Downloads