@djodjonx/x32-simulator 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +22 -0
- package/dist/{SchemaRegistry-BRVgnyaA.mjs → SchemaRegistry-D4eIJord.mjs} +8 -5
- package/dist/{SchemaRegistry-CfDtw84j.cjs → SchemaRegistry-DE6iObDv.cjs} +8 -5
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/server.cjs +5 -6
- package/dist/server.d.cts +1 -10
- package/dist/server.d.mts +1 -10
- package/dist/server.mjs +6 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.0.6](https://github.com/djodjonx/x32-simulator/compare/v0.0.5...v0.0.6) (2026-01-11)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* initialize schema with static response defaults ([28ef675](https://github.com/djodjonx/x32-simulator/commit/28ef675ca37fde2fb2d3402dbe2888ce8d21c584))
|
|
11
|
+
* support /node discovery without arguments ([7df0bce](https://github.com/djodjonx/x32-simulator/commit/7df0bcedd5873a31f1982f18a1cbc19b9f3a1d58))
|
|
12
|
+
|
|
13
|
+
### [0.0.5](https://github.com/djodjonx/x32-simulator/compare/v0.0.4...v0.0.5) (2026-01-10)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **cli:** fix npx execution by adding dedicated bin entry point ([1b0de49](https://github.com/djodjonx/x32-simulator/commit/1b0de498b2706c7c8caf86488c8545742344b970))
|
|
19
|
+
|
|
5
20
|
### [0.0.4](https://github.com/djodjonx/x32-simulator/compare/v0.0.3...v0.0.4) (2026-01-08)
|
|
6
21
|
|
|
7
22
|
### [0.0.3](https://github.com/djodjonx/x32-simulator/compare/v0.0.2...v0.0.3) (2026-01-08)
|
package/README.md
CHANGED
|
@@ -160,6 +160,28 @@ The simulator covers a vast majority of the X32 OSC command set:
|
|
|
160
160
|
|
|
161
161
|
---
|
|
162
162
|
|
|
163
|
+
## 🧪 Testing Example (E2E)
|
|
164
|
+
|
|
165
|
+
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`.
|
|
166
|
+
|
|
167
|
+
You can find a complete, runnable example of this in [examples/dual-client-e2e.ts](./examples/dual-client-e2e.ts).
|
|
168
|
+
|
|
169
|
+
### Multi-Client Sync Test Snippet
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
// Client A and Client B both subscribe to /xremote
|
|
173
|
+
clientA.send('/xremote');
|
|
174
|
+
clientB.send('/xremote');
|
|
175
|
+
|
|
176
|
+
// Client A changes a fader
|
|
177
|
+
clientA.send('/ch/01/mix/fader', 0.85);
|
|
178
|
+
|
|
179
|
+
// Result: BOTH Client A and Client B receive the update from the simulator
|
|
180
|
+
// This ensures your UI stays in sync across multiple devices.
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
163
185
|
## 🤝 Contributing
|
|
164
186
|
|
|
165
187
|
We welcome contributions! Please see [INSTALL.md](./INSTALL.md) for development instructions.
|
|
@@ -345,8 +345,7 @@ var NodeDiscoveryStrategy = class {
|
|
|
345
345
|
return address === "/node";
|
|
346
346
|
}
|
|
347
347
|
execute(msg, _source) {
|
|
348
|
-
const queryPath = msg.args[0];
|
|
349
|
-
if (!queryPath) return [];
|
|
348
|
+
const queryPath = msg.args[0] || "/";
|
|
350
349
|
const children = /* @__PURE__ */ new Set();
|
|
351
350
|
const prefix = queryPath.endsWith("/") ? queryPath : `${queryPath}/`;
|
|
352
351
|
for (const key of this.schemaRegistry.getAllPaths()) if (key.startsWith(prefix)) {
|
|
@@ -619,11 +618,11 @@ var OscMessageHandler = class {
|
|
|
619
618
|
this.staticResponseService = staticResponseService;
|
|
620
619
|
this.strategies = [
|
|
621
620
|
new NodeDiscoveryStrategy(this.schemaRegistry),
|
|
622
|
-
new StaticResponseStrategy(serverIp, serverName, serverModel, this.staticResponseService),
|
|
623
621
|
new SubscriptionStrategy(subscriptionManager, state, logger),
|
|
624
622
|
new BatchStrategy(subscriptionManager, logger),
|
|
625
623
|
new MeterStrategy(subscriptionManager, state, this.meterService),
|
|
626
|
-
new StateAccessStrategy(state, logger, this.schemaRegistry)
|
|
624
|
+
new StateAccessStrategy(state, logger, this.schemaRegistry),
|
|
625
|
+
new StaticResponseStrategy(serverIp, serverName, serverModel, this.staticResponseService)
|
|
627
626
|
];
|
|
628
627
|
}
|
|
629
628
|
/**
|
|
@@ -1948,7 +1947,11 @@ var SchemaFactory = class {
|
|
|
1948
1947
|
...this.generateOutputs("rec", 2)
|
|
1949
1948
|
};
|
|
1950
1949
|
Object.keys(STATIC_RESPONSES_DATA).forEach((key) => {
|
|
1951
|
-
if (key.startsWith("/-") || key.startsWith("/stat"))
|
|
1950
|
+
if (key.startsWith("/-") || key.startsWith("/stat")) {
|
|
1951
|
+
const val = STATIC_RESPONSES_DATA[key][0];
|
|
1952
|
+
const type = typeof val === "string" ? "s" : Number.isInteger(val) ? "i" : "f";
|
|
1953
|
+
schema[key] = this.node(type, val);
|
|
1954
|
+
}
|
|
1952
1955
|
});
|
|
1953
1956
|
[
|
|
1954
1957
|
"/config/routing/IN/1-8",
|
|
@@ -374,8 +374,7 @@ var NodeDiscoveryStrategy = class {
|
|
|
374
374
|
return address === "/node";
|
|
375
375
|
}
|
|
376
376
|
execute(msg, _source) {
|
|
377
|
-
const queryPath = msg.args[0];
|
|
378
|
-
if (!queryPath) return [];
|
|
377
|
+
const queryPath = msg.args[0] || "/";
|
|
379
378
|
const children = /* @__PURE__ */ new Set();
|
|
380
379
|
const prefix = queryPath.endsWith("/") ? queryPath : `${queryPath}/`;
|
|
381
380
|
for (const key of this.schemaRegistry.getAllPaths()) if (key.startsWith(prefix)) {
|
|
@@ -648,11 +647,11 @@ var OscMessageHandler = class {
|
|
|
648
647
|
this.staticResponseService = staticResponseService;
|
|
649
648
|
this.strategies = [
|
|
650
649
|
new NodeDiscoveryStrategy(this.schemaRegistry),
|
|
651
|
-
new StaticResponseStrategy(serverIp, serverName, serverModel, this.staticResponseService),
|
|
652
650
|
new SubscriptionStrategy(subscriptionManager, state, logger),
|
|
653
651
|
new BatchStrategy(subscriptionManager, logger),
|
|
654
652
|
new MeterStrategy(subscriptionManager, state, this.meterService),
|
|
655
|
-
new StateAccessStrategy(state, logger, this.schemaRegistry)
|
|
653
|
+
new StateAccessStrategy(state, logger, this.schemaRegistry),
|
|
654
|
+
new StaticResponseStrategy(serverIp, serverName, serverModel, this.staticResponseService)
|
|
656
655
|
];
|
|
657
656
|
}
|
|
658
657
|
/**
|
|
@@ -1977,7 +1976,11 @@ var SchemaFactory = class {
|
|
|
1977
1976
|
...this.generateOutputs("rec", 2)
|
|
1978
1977
|
};
|
|
1979
1978
|
Object.keys(STATIC_RESPONSES_DATA).forEach((key) => {
|
|
1980
|
-
if (key.startsWith("/-") || key.startsWith("/stat"))
|
|
1979
|
+
if (key.startsWith("/-") || key.startsWith("/stat")) {
|
|
1980
|
+
const val = STATIC_RESPONSES_DATA[key][0];
|
|
1981
|
+
const type = typeof val === "string" ? "s" : Number.isInteger(val) ? "i" : "f";
|
|
1982
|
+
schema[key] = this.node(type, val);
|
|
1983
|
+
}
|
|
1981
1984
|
});
|
|
1982
1985
|
[
|
|
1983
1986
|
"/config/routing/IN/1-8",
|
package/dist/index.cjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ConsoleLogger, c as X32Node, d as METER_COUNTS, f as MeterData, i as UdpNetworkGateway, l as X32State, m as LogCategory, n as SchemaFactory, p as SubscriptionManager, r as OscCodec, s as InMemoryStateRepository, t as SchemaRegistry, u as SimulationService } from "./SchemaRegistry-
|
|
1
|
+
import { a as ConsoleLogger, c as X32Node, d as METER_COUNTS, f as MeterData, i as UdpNetworkGateway, l as X32State, m as LogCategory, n as SchemaFactory, p as SubscriptionManager, r as OscCodec, s as InMemoryStateRepository, t as SchemaRegistry, u as SimulationService } from "./SchemaRegistry-D4eIJord.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/domain/models/OscMessage.ts
|
|
4
4
|
/**
|
package/dist/server.cjs
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const require_SchemaRegistry = require('./SchemaRegistry-
|
|
2
|
+
const require_SchemaRegistry = require('./SchemaRegistry-DE6iObDv.cjs');
|
|
3
3
|
let node_readline = require("node:readline");
|
|
4
4
|
node_readline = require_SchemaRegistry.__toESM(node_readline);
|
|
5
5
|
let node_fs = require("node:fs");
|
|
6
6
|
node_fs = require_SchemaRegistry.__toESM(node_fs);
|
|
7
7
|
let node_path = require("node:path");
|
|
8
8
|
node_path = require_SchemaRegistry.__toESM(node_path);
|
|
9
|
-
let node_url = require("node:url");
|
|
10
9
|
|
|
11
10
|
//#region src/presentation/cli/server.ts
|
|
12
11
|
const loadEnv = () => {
|
|
@@ -133,9 +132,9 @@ const bootstrap = async () => {
|
|
|
133
132
|
process.exit(0);
|
|
134
133
|
});
|
|
135
134
|
};
|
|
136
|
-
if (process.argv[1] === (0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href)) bootstrap();
|
|
137
135
|
|
|
138
136
|
//#endregion
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
137
|
+
//#region src/presentation/cli/bin.ts
|
|
138
|
+
bootstrap();
|
|
139
|
+
|
|
140
|
+
//#endregion
|
package/dist/server.d.cts
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//#region src/presentation/cli/server.d.ts
|
|
3
|
-
declare const loadEnv: () => void;
|
|
4
|
-
declare const parseArgs: (argv: string[]) => {
|
|
5
|
-
PORT: number;
|
|
6
|
-
HOST: string;
|
|
7
|
-
};
|
|
8
|
-
declare const bootstrap: () => Promise<void>;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { bootstrap, loadEnv, parseArgs };
|
|
1
|
+
export { };
|
package/dist/server.d.mts
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//#region src/presentation/cli/server.d.ts
|
|
3
|
-
declare const loadEnv: () => void;
|
|
4
|
-
declare const parseArgs: (argv: string[]) => {
|
|
5
|
-
PORT: number;
|
|
6
|
-
HOST: string;
|
|
7
|
-
};
|
|
8
|
-
declare const bootstrap: () => Promise<void>;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { bootstrap, loadEnv, parseArgs };
|
|
1
|
+
export { };
|
package/dist/server.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as ConsoleLogger, i as UdpNetworkGateway, n as SchemaFactory, o as LogLevel, r as OscCodec, s as InMemoryStateRepository, t as SchemaRegistry, u as SimulationService } from "./SchemaRegistry-
|
|
2
|
+
import { a as ConsoleLogger, i as UdpNetworkGateway, n as SchemaFactory, o as LogLevel, r as OscCodec, s as InMemoryStateRepository, t as SchemaRegistry, u as SimulationService } from "./SchemaRegistry-D4eIJord.mjs";
|
|
3
3
|
import * as readline from "node:readline";
|
|
4
4
|
import * as fs from "node:fs";
|
|
5
5
|
import * as path from "node:path";
|
|
6
|
-
import { fileURLToPath } from "node:url";
|
|
7
6
|
|
|
8
7
|
//#region src/presentation/cli/server.ts
|
|
9
8
|
const loadEnv = () => {
|
|
@@ -130,7 +129,10 @@ const bootstrap = async () => {
|
|
|
130
129
|
process.exit(0);
|
|
131
130
|
});
|
|
132
131
|
};
|
|
133
|
-
if (process.argv[1] === fileURLToPath(import.meta.url)) bootstrap();
|
|
134
132
|
|
|
135
133
|
//#endregion
|
|
136
|
-
|
|
134
|
+
//#region src/presentation/cli/bin.ts
|
|
135
|
+
bootstrap();
|
|
136
|
+
|
|
137
|
+
//#endregion
|
|
138
|
+
export { };
|