Skip to main content

TypeScript implementation of OSC (Open Sound Control)

Works with
This package works with Bun
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Browsers
JSR Score
100%
Published
3 weeks ago (1.0.0)

Deno-PLC / Adapter-OSC

TypeScript implementation of OSC (Open Sound Control)

Installation

Use JSR: JSR

Usage

Encoder

import { encodeOSC } from "@deno-plc/adapter-osc";

const packet = encodeOSC("/foo/bar", [5, true]);

This might thro an OSCProtocolError if the supplied data is invalid

Decoder

import { decodeOSC } from "@deno-plc/adapter-osc";

const [address, args] = decodeOSC(packet);

This might thro an OSCProtocolError if the supplied data is invalid

OSC over TCP

This package has support for OSC-over-TCP (=OSC packets are transmitted SLIP (Serial Line Internet Protocol) encoded over a TCP socket) usable in conjunction with adapter-tcp. For usage instructions see examples/tcposc.ts

Supported data types

  • string (s) (string)
  • int32 (i) (number)
  • blob (b) (Uint8Array)
  • float32 (f) (number)
  • float64 (d) (number)
  • boolean (T,F) (boolean)

License (GPL-3.0-or-later)

(C) 2024 Hans Schallmoser

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Built and signed on
GitHub Actions
View transparency log

Add Package

deno add @deno-plc/adapter-osc

Import symbol

import * as mod from "@deno-plc/adapter-osc";

Add Package

npx jsr add @deno-plc/adapter-osc

Import symbol

import * as mod from "@deno-plc/adapter-osc";

Add Package

yarn dlx jsr add @deno-plc/adapter-osc

Import symbol

import * as mod from "@deno-plc/adapter-osc";

Add Package

pnpm dlx jsr add @deno-plc/adapter-osc

Import symbol

import * as mod from "@deno-plc/adapter-osc";

Add Package

bunx jsr add @deno-plc/adapter-osc

Import symbol

import * as mod from "@deno-plc/adapter-osc";