companion-osc-integration

Integrates OSC UDP communication, lifecycle management, and state updates into Bitfocus Companion modules.

Updated May 19, 2026
One-click install
npx skills add https://github.com/digitaldrummerj/bitfocus-companion-skills --skill companion-osc-integration-digitaldrummerj
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: companion-osc-integration
Source: https://github.com/digitaldrummerj/bitfocus-companion-skills/tree/main/plugins/companion-osc-integration
Command: npx skills add https://github.com/digitaldrummerj/bitfocus-companion-skills --skill companion-osc-integration-digitaldrummerj

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires osc, @companion-module/base.

What problem does it solve? Adding OSC (Open Sound Control) communication to a Bitfocus Companion module involves tricky details: the osc npm package lacks ESM exports, sockets must survive configUpdated and destroy cycles, and incoming messages must be routed into state, variables, and feedbacks. This Skill provides the complete, tested pattern so you avoid port conflicts, silent send failures, and stale feedbacks. ## Core Features & Use Cases - OSC Class Encapsulation: Structure a dedicated OSC class that owns the UDP socket, keeping connection logic out of your InstanceBase subclass. - Lifecycle Wiring: Correct teardown and recreation of sockets across init, configUpdated, and destroy, including keepalive timer management. - Send and Receive Patterns: Typed sendCommand helpers wired into action callbacks, plus processMessage routing that updates state, variables, and calls checkFeedbacks. - Use Case: You are building a Companion module for a device controlled over OSC. Use this Skill to scaffold the socket layer, wire an action that sends /device/command with typed arguments, and update button feedbacks when status messages arrive. ## Quick Start Ask the agent to add OSC UDP communication to your Companion module using the osc npm package with send, receive, and lifecycle handling.

Frequently Asked Questions about companion-osc-integration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add OSC communication to a Bitfocus Companion module?▼

Create a dedicated OSC class that wraps an osc.UDPPort socket, hold a nullable reference to it on your InstanceBase subclass, and recreate it in configUpdated after destroying the old instance. Wire action callbacks to a sendCommand helper for outgoing messages.

Why does 'import osc from osc' fail in a Companion module?▼

The osc npm package ships only CommonJS exports, so ESM import fails at runtime in Node ESM mode. Use const osc = require('osc') at the top of the file, with an eslint-disable comment if your lint rules forbid require.

Why are incoming OSC messages missing typed args?▼

The UDPPort must be created with metadata: true, otherwise the osc library delivers raw values instead of typed {type, value} argument objects. Add metadata: true to the UDPPort configuration to receive typed args.

How do I update Companion feedbacks when an OSC message arrives?▼

In your processMessage handler, update the in-memory state object, optionally call setVariableValues, then call checkFeedbacks with the relevant feedback IDs. Skipping checkFeedbacks is the most common reason feedbacks appear stale.

Why does my Companion module hit port conflicts after a config change?▼

The old UDP socket was not closed before creating a new one. Always call destroy() on the existing OSC instance inside configUpdated before constructing a new OSC instance with the updated configuration.