X32 Simulator
npm install @djodjonx/x32-simulator

A fully functional Behringer X32 / Midas M32 OSC Simulator.
This tool allows developers to build, test, and debug X32/M32 remote control applications without needing physical hardware. It accurately replicates the mixer's state management, OSC protocol quirks, and network behavior.
---
* Complete State Simulation: Simulates ~4000+ OSC parameters including Channels, Buses, Matrices, FX, Routing, and Config.
* Accurate OSC Protocol: Supports node-osc based communication over UDP.
* Subscription Management: Handles /xremote, /subscribe, and /renew logic for client updates.
* Meter Simulation: Generates synthetic meter data for /meters/0 through /meters/15 endpoints.
* Dual Mode: Run as a Standalone CLI Server or embed as a Library in your Node.js tests.
* Zero Dependencies (runtime): The published package bundles everything needed.
---
``bash`
npm install -g @djodjonx/x32-simulator
`bash`
npm install --save-dev @djodjonx/x32-simulator
---
Start the simulator server:
`bash`
x32-simulator
| Flag | Alias | Description | Default |
|------|-------|-------------|---------|
| --port | -p | UDP Port to listen on | 10023 |--host
| | -h | IP Address to bind to | 0.0.0.0 |
Example:
`bash`
x32-simulator --port 5000 --host 127.0.0.1
If you need to simulate a specific console IP (e.g., 192.168.1.100) that is not assigned to your machine, you must create a Network Alias. This allows the simulator to "own" that IP locally.
| OS | Create Alias Command | Remove Alias Command |
|----|----------------------|----------------------|
| macOS | sudo ifconfig lo0 alias | sudo ifconfig lo0 -alias |sudo ip addr add
| Linux | | sudo ip addr del |netsh interface ip add address "Loopback"
| Windows | | netsh interface ip delete address "Loopback" |
> Note (Windows): Requires the "Microsoft Loopback Adapter" to be installed and named "Loopback" in your Network Connections.
: Resets all faders and parameters to default values.
* stop / exit: Shuts down the server.---
๐ Library Usage
Perfect for integration testing your X32 client apps.
`typescript
import { SimulationService, UdpNetworkGateway, ConsoleLogger, InMemoryStateRepository, SchemaFactory, SchemaRegistry, OscCodec } from '@djodjonx/x32-simulator';// 1. Setup Dependencies
const logger = ConsoleLogger.getInstance();
const schemaRegistry = new SchemaRegistry(new SchemaFactory());
const codec = new OscCodec(schemaRegistry);
const gateway = new UdpNetworkGateway(logger, codec);
const repository = new InMemoryStateRepository(logger, schemaRegistry);
// 2. Initialize Service
const simulator = new SimulationService(
gateway,
logger,
repository,
schemaRegistry,
10023, // Port
'127.0.0.1' // Host
);
// 3. Start & Stop
await simulator.start();
console.log('Simulator running...');
// ... run your tests ...
await simulator.stop();
`$3
The library exports the following components for advanced usage:
Core Services
*
SimulationService: Main entry point.
* SchemaRegistry: Manages the OSC node definitions.
* SchemaFactory: Generates the default X32 schema.Domain Entities & Models
*
X32State: The "Digital Twin" state container.
* SubscriptionManager: Manages /xremote and /subscribe clients.
* X32Address: Helper for parsing OSC paths.
* OscMessage: Wrapper for parsed OSC messages.
* MeterData: Helper for handling meter blobs.
* X32Node: Represents a single parameter (type, default value).Infrastructure
*
UdpNetworkGateway: Default UDP implementation.
* ConsoleLogger: Default logger implementation.
* OscCodec: Encodes/Decodes X32-specific OSC packets.
* InMemoryStateRepository: Default state storage.Types & Interfaces
*
INetworkGateway, ILogger, IStateRepository
* OscPacket, OscMsg, RemoteClient
* LogCategory---
๐๏ธ Simulated OSC Map
The simulator covers a vast majority of the X32 OSC command set:
| Category | OSC Path Pattern | Description |
|----------|------------------|-------------|
| Channels |
/ch/{01..32}/... | Config, Preamp, Gate, Dyn, EQ, Mix, Sends |
| Buses | /bus/{01..16}/... | Config, Dyn, EQ, Mix, Sends |
| DCA | /dca/{1..8}/... | Config, Fader, Mute |
| Matrix | /mtx/{01..06}/... | Config, Dyn, EQ, Mix |
| Aux In | /auxin/{01..08}/... | Config, Preamp, EQ, Mix |
| FX Returns | /fxrtn/{01..08}/... | Config, EQ, Mix |
| Effects | /fx/{1..8}/... | Type, Parameters, Source |
| Headamps | /headamp/{000..127}/... | Gain, Phantom Power |
| Routing | /config/routing/... | Input, Output, Card, AES50 Routing |
| Status | /-stat/... | Selected Channel, Sends on Fader, Screen State |
| Meters | /meters/... | Meter data blobs (simulated noise) |---
๐งช Testing Example (E2E)
The simulator is ideal for testing broadcast behavior and multi-client synchronization. When one client changes a parameter, the simulator automatically broadcasts that update to all other clients subscribed via
/xremote.You can find a complete, runnable example of this in examples/dual-client-e2e.ts.
$3
`typescript
// Client A and Client B both subscribe to /xremote
clientA.send('/xremote');
clientB.send('/xremote');// Client A changes a fader
clientA.send('/ch/01/mix/fader', 0.85);
// Result: BOTH Client A and Client B receive the update from the simulator
// This ensures your UI stays in sync across multiple devices.
``---
We welcome contributions! Please see INSTALL.md for development instructions.
MIT ยฉ Jonathan Moutier