@miadi/osc
v0.1.1
Published
Open Sound Control 1.0 over UDP, both directions — strict encoding, total decoding (a malformed packet keeps its metadata and names its parse error), and sender/listener that never confuse a destination port with an observed source port. The wire of the E
Readme
@miadi/osc
Open Sound Control 1.0 over UDP — the wire of the Miadi movement practice
(Episode 083: body-worn device → /wek/inputs → Wekinator on destination port
6448), extracted from a one-off capture script into the one implementation.
- Strict encoding:
f/i/d/s, big-endian, four-byte padding. Numbers encode asfby default — the Wekinator dialect. - Total decoding: any datagram yields either a message or the fields that
could be read plus a named
parse_error. Nothing vanishes. - The port lesson, kept: a listener binds the destination port; a sender's UDP source port is ephemeral and merely observed. The two are named distinctly everywhere they appear.
import { OscListener, OscSender } from "@miadi/osc"
const listener = new OscListener({ port: 6448, onPacket: (p) => console.log(p) })
await listener.start()
const sender = new OscSender({ host: "127.0.0.1", port: 6448 })
await sender.send("/wek/inputs", [0, 0, 0, 0, 0, 0, 0, 0, 0])Zero runtime dependencies. Specification of record:
rispecs/osc-wire.spec.md in miadisabelle/gmtermux.
