@vessel-dsp/runtime 0.2.0
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/README.md +178 -0
- package/dist/admission.d.ts +94 -0
- package/dist/admission.d.ts.map +1 -0
- package/dist/admission.js +209 -0
- package/dist/admission.js.map +1 -0
- package/dist/calibrate.d.ts +104 -0
- package/dist/calibrate.d.ts.map +1 -0
- package/dist/calibrate.js +420 -0
- package/dist/calibrate.js.map +1 -0
- package/dist/chain-advisories.d.ts +71 -0
- package/dist/chain-advisories.d.ts.map +1 -0
- package/dist/chain-advisories.js +268 -0
- package/dist/chain-advisories.js.map +1 -0
- package/dist/chain-scale.d.ts +82 -0
- package/dist/chain-scale.d.ts.map +1 -0
- package/dist/chain-scale.js +121 -0
- package/dist/chain-scale.js.map +1 -0
- package/dist/chain-slot.d.ts +130 -0
- package/dist/chain-slot.d.ts.map +1 -0
- package/dist/chain-slot.js +105 -0
- package/dist/chain-slot.js.map +1 -0
- package/dist/chain.d.ts +113 -0
- package/dist/chain.d.ts.map +1 -0
- package/dist/chain.js +355 -0
- package/dist/chain.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/numeric-pivot.d.ts +4 -0
- package/dist/numeric-pivot.d.ts.map +1 -0
- package/dist/numeric-pivot.js +192 -0
- package/dist/numeric-pivot.js.map +1 -0
- package/dist/reference-runtime.d.ts +1080 -0
- package/dist/reference-runtime.d.ts.map +1 -0
- package/dist/reference-runtime.js +6743 -0
- package/dist/reference-runtime.js.map +1 -0
- package/dist/settle.d.ts +359 -0
- package/dist/settle.d.ts.map +1 -0
- package/dist/settle.js +900 -0
- package/dist/settle.js.map +1 -0
- package/dist/supply-ground.d.ts +22 -0
- package/dist/supply-ground.d.ts.map +1 -0
- package/dist/supply-ground.js +62 -0
- package/dist/supply-ground.js.map +1 -0
- package/dist/supply.d.ts +30 -0
- package/dist/supply.d.ts.map +1 -0
- package/dist/supply.js +10 -0
- package/dist/supply.js.map +1 -0
- package/dist/taper.d.ts +10 -0
- package/dist/taper.d.ts.map +1 -0
- package/dist/taper.js +34 -0
- package/dist/taper.js.map +1 -0
- package/dist/v2-wasm-engine.d.ts +91 -0
- package/dist/v2-wasm-engine.d.ts.map +1 -0
- package/dist/v2-wasm-engine.js +296 -0
- package/dist/v2-wasm-engine.js.map +1 -0
- package/dist/wasm/v2_dsp.cjs +22 -0
- package/dist/wasm/v2_dsp.wasm +0 -0
- package/package.json +62 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
// TypeScript wrapper around the C++/WASM V2 Engine console.
|
|
2
|
+
import { DEFAULT_NEWTON_MAX_ITERATIONS, RuntimeError } from "./reference-runtime.js";
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
|
+
let v2ModulePromise = null;
|
|
5
|
+
export async function getV2WasmModule() {
|
|
6
|
+
if (!v2ModulePromise) {
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
const createV2Module = (await import("./wasm/v2_dsp.cjs")).default;
|
|
10
|
+
v2ModulePromise = createV2Module();
|
|
11
|
+
}
|
|
12
|
+
return v2ModulePromise;
|
|
13
|
+
}
|
|
14
|
+
export class V2WasmEngine {
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
|
+
mod;
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
+
handle;
|
|
19
|
+
inPtr = 0;
|
|
20
|
+
outPtr = 0;
|
|
21
|
+
inBufferCapacity = 0;
|
|
22
|
+
outBufferCapacity = 0;
|
|
23
|
+
inputFloatView = null;
|
|
24
|
+
outputFloatView = null;
|
|
25
|
+
/**
|
|
26
|
+
* This wrapper's own copy of the loaded program, so `getSupplies` reflects
|
|
27
|
+
* the live supply values the engine solves with. Cloned on load so the
|
|
28
|
+
* caller's object is never mutated; updated stamp-for-stamp beside every
|
|
29
|
+
* successful engine `setSupply`, and only then.
|
|
30
|
+
*/
|
|
31
|
+
program = null;
|
|
32
|
+
constructor(mod, handle) {
|
|
33
|
+
this.mod = mod;
|
|
34
|
+
this.handle = handle;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* `mod` injects an already-instantiated Emscripten module, for hosts where the default
|
|
38
|
+
* dynamic import cannot run — an AudioWorkletGlobalScope bundles the glue statically and
|
|
39
|
+
* instantiates the wasm from bytes it was posted (see v2-audio-worklet.ts). Omitted, the
|
|
40
|
+
* module loads from `./wasm/`, the release artifact `scripts/build-wasm.sh` writes (bun scripts, node).
|
|
41
|
+
*/
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
|
+
static async create(program, mod) {
|
|
44
|
+
mod ??= await getV2WasmModule();
|
|
45
|
+
const handle = mod._v2_engine_create();
|
|
46
|
+
if (!handle) {
|
|
47
|
+
throw new Error("Failed to allocate V2 C++ Engine handle in WASM memory");
|
|
48
|
+
}
|
|
49
|
+
const engine = new V2WasmEngine(mod, handle);
|
|
50
|
+
if (program) {
|
|
51
|
+
engine.loadProgram(program);
|
|
52
|
+
}
|
|
53
|
+
return engine;
|
|
54
|
+
}
|
|
55
|
+
destroy() {
|
|
56
|
+
if (this.handle) {
|
|
57
|
+
this.mod._v2_engine_destroy(this.handle);
|
|
58
|
+
this.handle = 0;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
loadProgram(program) {
|
|
62
|
+
const json = JSON.stringify(program);
|
|
63
|
+
const len = this.mod.lengthBytesUTF8(json) + 1;
|
|
64
|
+
const ptr = this.mod._malloc(len);
|
|
65
|
+
this.mod.stringToUTF8(json, ptr, len);
|
|
66
|
+
const ok = this.mod._v2_engine_load_json(this.handle, ptr);
|
|
67
|
+
this.mod._free(ptr);
|
|
68
|
+
if (!ok) {
|
|
69
|
+
const errPtr = this.mod._v2_engine_get_last_error(this.handle);
|
|
70
|
+
const errStr = errPtr ? this.mod.UTF8ToString(errPtr) : "";
|
|
71
|
+
throw new Error(`Failed to load program into V2 C++ Engine${errStr ? `: ${errStr}` : ""}`);
|
|
72
|
+
}
|
|
73
|
+
this.program = structuredClone(program);
|
|
74
|
+
}
|
|
75
|
+
prepare(options = {}) {
|
|
76
|
+
const sr = options.sampleRate ?? 48000.0;
|
|
77
|
+
// The product runs DEFAULT_NEWTON_MAX_ITERATIONS (chain.ts:137); a lower default
|
|
78
|
+
// here made every bun-hosted probe cap-conditioned against the shipping console.
|
|
79
|
+
const maxIters = options.maxNewtonIterations ?? DEFAULT_NEWTON_MAX_ITERATIONS;
|
|
80
|
+
const inputOhms = options.inputSourceOhms ?? 0.0;
|
|
81
|
+
this.mod._v2_engine_prepare(this.handle, sr, maxIters, inputOhms);
|
|
82
|
+
}
|
|
83
|
+
reset() {
|
|
84
|
+
this.mod._v2_engine_reset(this.handle);
|
|
85
|
+
}
|
|
86
|
+
setControl(controlId, position) {
|
|
87
|
+
const len = this.mod.lengthBytesUTF8(controlId) + 1;
|
|
88
|
+
const ptr = this.mod._malloc(len);
|
|
89
|
+
this.mod.stringToUTF8(controlId, ptr, len);
|
|
90
|
+
this.mod._v2_engine_set_control(this.handle, ptr, position);
|
|
91
|
+
this.mod._free(ptr);
|
|
92
|
+
}
|
|
93
|
+
getControl(controlId) {
|
|
94
|
+
const len = this.mod.lengthBytesUTF8(controlId) + 1;
|
|
95
|
+
const ptr = this.mod._malloc(len);
|
|
96
|
+
this.mod.stringToUTF8(controlId, ptr, len);
|
|
97
|
+
const val = this.mod._v2_engine_get_control(this.handle, ptr);
|
|
98
|
+
this.mod._free(ptr);
|
|
99
|
+
return val;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Every addressable `dc-source` stamp in `program.blocks` order, then stamp
|
|
103
|
+
* order within each block -- the same order and the same `SupplyInfo` shape
|
|
104
|
+
* as the TypeScript runtime, so `infos.map((info) => info.address)` feeds
|
|
105
|
+
* `setSupply` directly. Reads this wrapper's own live record, which tracks
|
|
106
|
+
* every successful `setSupply`, not the caller's original object.
|
|
107
|
+
*/
|
|
108
|
+
getSupplies() {
|
|
109
|
+
if (this.program === null)
|
|
110
|
+
return [];
|
|
111
|
+
const infos = [];
|
|
112
|
+
for (const [blockIndex, block] of this.program.blocks.entries()) {
|
|
113
|
+
if (block.kind !== "mna")
|
|
114
|
+
continue;
|
|
115
|
+
for (const stamp of block.stamps) {
|
|
116
|
+
if (stamp.kind !== "dc-source")
|
|
117
|
+
continue;
|
|
118
|
+
infos.push({
|
|
119
|
+
address: { blockIndex, sourceIndex: stamp.sourceIndex },
|
|
120
|
+
positive: stamp.positive,
|
|
121
|
+
negative: stamp.negative,
|
|
122
|
+
volts: stamp.volts,
|
|
123
|
+
sourceOhms: stamp.sourceOhms,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return infos;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Retarget one or more supply stamps between `process()` calls, with the
|
|
131
|
+
* SAME validation and `RuntimeError` behaviour as
|
|
132
|
+
* `ReferenceRuntime.setSupply`: `volts` must be finite, `sourceOhms` finite
|
|
133
|
+
* and non-negative, and every address must name an existing `dc-source`
|
|
134
|
+
* stamp. All addresses are validated before the engine is touched once per
|
|
135
|
+
* address, so a bad address leaves even the valid ones unchanged; if the
|
|
136
|
+
* engine itself refuses one after that, the wrapper's record tracks exactly
|
|
137
|
+
* the calls that succeeded, so wrapper and engine stay consistent, and the
|
|
138
|
+
* error names the address. Reapplying the values a stamp already carries
|
|
139
|
+
* calls nothing and changes nothing.
|
|
140
|
+
*/
|
|
141
|
+
setSupply(addresses, volts, sourceOhms) {
|
|
142
|
+
if (this.program === null) {
|
|
143
|
+
throw new RuntimeError("setSupply: no program loaded");
|
|
144
|
+
}
|
|
145
|
+
if (!Number.isFinite(volts)) {
|
|
146
|
+
throw new RuntimeError(`supply volts ${String(volts)} is not finite`);
|
|
147
|
+
}
|
|
148
|
+
if (!Number.isFinite(sourceOhms) || sourceOhms < 0) {
|
|
149
|
+
throw new RuntimeError(`supply sourceOhms ${String(sourceOhms)} is not a finite non-negative resistance`);
|
|
150
|
+
}
|
|
151
|
+
const targets = [];
|
|
152
|
+
for (const address of addresses) {
|
|
153
|
+
const block = Number.isInteger(address.blockIndex) &&
|
|
154
|
+
address.blockIndex >= 0 &&
|
|
155
|
+
address.blockIndex < this.program.blocks.length
|
|
156
|
+
? this.program.blocks[address.blockIndex]
|
|
157
|
+
: undefined;
|
|
158
|
+
if (block === undefined) {
|
|
159
|
+
throw new RuntimeError(`setSupply: unknown block index ${String(address.blockIndex)}`);
|
|
160
|
+
}
|
|
161
|
+
if (block.kind !== "mna") {
|
|
162
|
+
throw new RuntimeError(`setSupply: block index ${address.blockIndex} ("${block.id}") is not an MNA block`);
|
|
163
|
+
}
|
|
164
|
+
let matched = false;
|
|
165
|
+
for (const stamp of block.stamps) {
|
|
166
|
+
if (stamp.kind === "dc-source" && stamp.sourceIndex === address.sourceIndex) {
|
|
167
|
+
matched = true;
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (!matched) {
|
|
172
|
+
throw new RuntimeError(`setSupply: block index ${address.blockIndex} ("${block.id}") has no dc-source with sourceIndex ${String(address.sourceIndex)}`);
|
|
173
|
+
}
|
|
174
|
+
targets.push({ blockIndex: address.blockIndex, sourceIndex: address.sourceIndex });
|
|
175
|
+
}
|
|
176
|
+
if (targets.length === 0)
|
|
177
|
+
return;
|
|
178
|
+
// Deduplicate and drop stamps that already carry the values: only a real
|
|
179
|
+
// change reaches the engine, mirroring the reference runtime's no-op rule.
|
|
180
|
+
const seen = new Set();
|
|
181
|
+
const pending = [];
|
|
182
|
+
for (const target of targets) {
|
|
183
|
+
const key = `${target.blockIndex}:${target.sourceIndex}`;
|
|
184
|
+
if (seen.has(key))
|
|
185
|
+
continue;
|
|
186
|
+
seen.add(key);
|
|
187
|
+
const block = this.program.blocks[target.blockIndex];
|
|
188
|
+
if (block?.kind !== "mna")
|
|
189
|
+
continue;
|
|
190
|
+
let alreadyMatches = true;
|
|
191
|
+
let hasStamp = false;
|
|
192
|
+
for (const stamp of block.stamps) {
|
|
193
|
+
if (stamp.kind === "dc-source" && stamp.sourceIndex === target.sourceIndex) {
|
|
194
|
+
hasStamp = true;
|
|
195
|
+
if (stamp.volts !== volts || stamp.sourceOhms !== sourceOhms) {
|
|
196
|
+
alreadyMatches = false;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
if (!hasStamp || alreadyMatches)
|
|
201
|
+
continue;
|
|
202
|
+
pending.push(target);
|
|
203
|
+
}
|
|
204
|
+
if (pending.length === 0)
|
|
205
|
+
return;
|
|
206
|
+
const setSupplyFn = this.mod._v2_engine_set_supply;
|
|
207
|
+
if (typeof setSupplyFn !== "function") {
|
|
208
|
+
throw new RuntimeError("setSupply: wasm console was built without v2_engine_set_supply; rebuild with scripts/build-wasm.sh");
|
|
209
|
+
}
|
|
210
|
+
for (const target of pending) {
|
|
211
|
+
const code = setSupplyFn(this.handle, target.blockIndex, target.sourceIndex, volts, sourceOhms);
|
|
212
|
+
if (code !== 0) {
|
|
213
|
+
throw new RuntimeError(`setSupply: block index ${target.blockIndex} sourceIndex ${target.sourceIndex} refused by the engine (code ${code})`);
|
|
214
|
+
}
|
|
215
|
+
// Engine accepted it: move the wrapper's own record alongside, stamp
|
|
216
|
+
// for stamp, so getSupplies reflects the values the solver now reads.
|
|
217
|
+
const block = this.program?.blocks[target.blockIndex];
|
|
218
|
+
if (block?.kind === "mna") {
|
|
219
|
+
for (const stamp of block.stamps) {
|
|
220
|
+
if (stamp.kind === "dc-source" && stamp.sourceIndex === target.sourceIndex) {
|
|
221
|
+
stamp.volts = volts;
|
|
222
|
+
stamp.sourceOhms = sourceOhms;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
processSample(input) {
|
|
229
|
+
return this.mod._v2_engine_process_sample(this.handle, input);
|
|
230
|
+
}
|
|
231
|
+
processBlock(input, output) {
|
|
232
|
+
const frames = input.length;
|
|
233
|
+
// Views are built on HEAPU8.buffer: the Emscripten glue exports HEAP8/HEAPU8/HEAPF64
|
|
234
|
+
// but NOT HEAPF32, and this method's original `this.mod.HEAPF32.buffer` threw on the
|
|
235
|
+
// first block-mode caller (the WASM-console worklet path), which every prior
|
|
236
|
+
// instrument missed because they all use processSample. Buffer identity against
|
|
237
|
+
// HEAPU8.buffer also catches heap growth, same as before.
|
|
238
|
+
const heapBuffer = () => this.mod.HEAPU8.buffer;
|
|
239
|
+
if (frames > this.inBufferCapacity || this.inputFloatView?.buffer !== heapBuffer()) {
|
|
240
|
+
this.inPtr = this.mod._v2_engine_get_input_buffer(this.handle, frames);
|
|
241
|
+
this.outPtr = this.mod._v2_engine_get_output_buffer(this.handle, frames);
|
|
242
|
+
this.inBufferCapacity = Math.max(frames, this.inBufferCapacity);
|
|
243
|
+
this.outBufferCapacity = this.inBufferCapacity;
|
|
244
|
+
this.inputFloatView = new Float32Array(heapBuffer(), this.inPtr, this.inBufferCapacity);
|
|
245
|
+
this.outputFloatView = new Float32Array(heapBuffer(), this.outPtr, this.outBufferCapacity);
|
|
246
|
+
}
|
|
247
|
+
this.inputFloatView.set(input);
|
|
248
|
+
this.mod._v2_engine_process_internal(this.handle, frames);
|
|
249
|
+
output.set(this.outputFloatView.subarray(0, frames));
|
|
250
|
+
}
|
|
251
|
+
getLastIterationCount() {
|
|
252
|
+
return this.mod._v2_engine_get_last_iteration_count(this.handle);
|
|
253
|
+
}
|
|
254
|
+
getLastConverged() {
|
|
255
|
+
return this.mod._v2_engine_get_last_converged(this.handle) !== 0;
|
|
256
|
+
}
|
|
257
|
+
getMaxIterations() {
|
|
258
|
+
return this.mod._v2_engine_get_max_iterations(this.handle);
|
|
259
|
+
}
|
|
260
|
+
getOperatingPointNode(blockIdx, node) {
|
|
261
|
+
return this.mod._v2_engine_get_operating_point(this.handle, blockIdx, node);
|
|
262
|
+
}
|
|
263
|
+
getStateValue(blockIdx, stateIdx) {
|
|
264
|
+
return this.mod._v2_engine_get_state(this.handle, blockIdx, stateIdx);
|
|
265
|
+
}
|
|
266
|
+
getLastError() {
|
|
267
|
+
const errPtr = this.mod._v2_engine_get_last_error(this.handle);
|
|
268
|
+
return errPtr ? this.mod.UTF8ToString(errPtr) : "";
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Whether the compiled sparse schedules are actually running on this console.
|
|
272
|
+
*
|
|
273
|
+
* The mirror of `ReferenceRuntime.solverPlan()`'s `scheduleSolves`/`scheduleFallbacks`/
|
|
274
|
+
* `abandoned`/`dropped`, which existed on the TypeScript side and had no counterpart here — so the
|
|
275
|
+
* console that ships was the one that could not be asked. `solves` counts every solve that
|
|
276
|
+
* ran a schedule since `prepare()`/`reset()`, `fallbacks` how many of those collapsed on a
|
|
277
|
+
* pivot and were re-solved densely (paying for both), `abandonedBlocks` how many
|
|
278
|
+
* admitted blocks have given their schedule up for good, and `droppedBlocks` how many
|
|
279
|
+
* were moved to dense at `prepare()` because their shipped order disagreed with dense
|
|
280
|
+
* on the operating-point matrix.
|
|
281
|
+
*
|
|
282
|
+
* A healthy packet reads `fallbacks === 0` and `abandonedBlocks === 0`. Anything else is a
|
|
283
|
+
* cost defect even though the audio is correct.
|
|
284
|
+
*/
|
|
285
|
+
getScheduleTelemetry() {
|
|
286
|
+
return {
|
|
287
|
+
solves: this.mod._v2_engine_get_schedule_solves(this.handle),
|
|
288
|
+
fallbacks: this.mod._v2_engine_get_schedule_fallbacks(this.handle),
|
|
289
|
+
kernelSolves: this.mod._v2_engine_get_kernel_solves(this.handle),
|
|
290
|
+
repivotedBlocks: this.mod._v2_engine_get_repivoted_schedule_blocks(this.handle),
|
|
291
|
+
abandonedBlocks: this.mod._v2_engine_get_abandoned_schedule_blocks(this.handle),
|
|
292
|
+
droppedBlocks: this.mod._v2_engine_get_dropped_schedule_blocks(this.handle),
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
//# sourceMappingURL=v2-wasm-engine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v2-wasm-engine.js","sourceRoot":"","sources":["../src/v2-wasm-engine.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAG5D,OAAO,EAAE,6BAA6B,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGlF,8DAA8D;AAC9D,IAAI,eAAe,GAAwB,IAAI,CAAC;AAEhD,MAAM,CAAC,KAAK,UAAU,eAAe;IACpC,IAAI,CAAC,eAAe,EAAE,CAAC;QACtB,iEAAiE;QACjE,aAAa;QACb,MAAM,cAAc,GAAG,CAAC,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,OAAO,CAAC;QACnE,eAAe,GAAG,cAAc,EAAE,CAAC;IACpC,CAAC;IACD,OAAO,eAAe,CAAC;AACxB,CAAC;AAED,MAAM,OAAO,YAAY;IACxB,8DAA8D;IACtD,GAAG,CAAM;IACjB,8DAA8D;IACtD,MAAM,CAAM;IACZ,KAAK,GAAW,CAAC,CAAC;IAClB,MAAM,GAAW,CAAC,CAAC;IACnB,gBAAgB,GAAW,CAAC,CAAC;IAC7B,iBAAiB,GAAW,CAAC,CAAC;IAC9B,cAAc,GAAwB,IAAI,CAAC;IAC3C,eAAe,GAAwB,IAAI,CAAC;IACpD;;;;;OAKG;IACK,OAAO,GAAmB,IAAI,CAAC;IAEvC,YAAoB,GAAQ,EAAE,MAAW;QACxC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;IAED;;;;;OAKG;IACH,8DAA8D;IACvD,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAiB,EAAE,GAAS;QACtD,GAAG,KAAK,MAAM,eAAe,EAAE,CAAC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CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACpD,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACI,oBAAoB;QAQ1B,OAAO;YACN,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,8BAA8B,CAAC,IAAI,CAAC,MAAM,CAAC;YAC5D,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,iCAAiC,CAAC,IAAI,CAAC,MAAM,CAAC;YAClE,YAAY,EAAE,IAAI,CAAC,GAAG,CAAC,4BAA4B,CAAC,IAAI,CAAC,MAAM,CAAC;YAChE,eAAe,EAAE,IAAI,CAAC,GAAG,CAAC,wCAAwC,CAAC,IAAI,CAAC,MAAM,CAAC;YAC/E,eAAe,EAAE,IAAI,CAAC,GAAG,CAAC,wCAAwC,CAAC,IAAI,CAAC,MAAM,CAAC;YAC/E,aAAa,EAAE,IAAI,CAAC,GAAG,CAAC,sCAAsC,CAAC,IAAI,CAAC,MAAM,CAAC;SAC3E,CAAC;IACH,CAAC;CACD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
var createV2DspModule = (() => {
|
|
3
|
+
var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;
|
|
4
|
+
if (typeof __filename != 'undefined') _scriptName = _scriptName || __filename;
|
|
5
|
+
return (
|
|
6
|
+
function(moduleArg = {}) {
|
|
7
|
+
var moduleRtn;
|
|
8
|
+
|
|
9
|
+
var Module=moduleArg;var readyPromiseResolve,readyPromiseReject;var readyPromise=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject});var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope!="undefined";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";if(ENVIRONMENT_IS_NODE){}var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs");var nodePath=require("path");scriptDirectory=__dirname+"/";readBinary=filename=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename);return ret};readAsync=async(filename,binary=true)=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename,binary?undefined:"utf8");return ret};if(!Module["thisProgram"]&&process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}arguments_=process.argv.slice(2);quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptName){scriptDirectory=_scriptName}if(scriptDirectory.startsWith("blob:")){scriptDirectory=""}else{scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}{if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=async url=>{if(isFileURI(url)){return new Promise((resolve,reject)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){resolve(xhr.response);return}reject(xhr.status)};xhr.onerror=reject;xhr.send(null)})}var response=await fetch(url,{credentials:"same-origin"});if(response.ok){return response.arrayBuffer()}throw new Error(response.status+" : "+response.url)}}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.error.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];var wasmBinary=Module["wasmBinary"];var wasmMemory;var ABORT=false;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var b=wasmMemory.buffer;Module["HEAP8"]=HEAP8=new Int8Array(b);Module["HEAP16"]=HEAP16=new Int16Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);Module["HEAPU16"]=HEAPU16=new Uint16Array(b);Module["HEAP32"]=HEAP32=new Int32Array(b);Module["HEAPU32"]=HEAPU32=new Uint32Array(b);Module["HEAPF32"]=HEAPF32=new Float32Array(b);Module["HEAPF64"]=HEAPF64=new Float64Array(b)}var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;Module["monitorRunDependencies"]?.(runDependencies)}function removeRunDependency(id){runDependencies--;Module["monitorRunDependencies"]?.(runDependencies);if(runDependencies==0){if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){Module["onAbort"]?.(what);what="Aborted("+what+")";err(what);ABORT=true;what+=". Build with -sASSERTIONS for more info.";if(runtimeInitialized){___trap()}var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";var isDataURI=filename=>filename.startsWith(dataURIPrefix);var isFileURI=filename=>filename.startsWith("file://");function findWasmBinary(){var f="v2_dsp.wasm";if(!isDataURI(f)){return locateFile(f)}return f}var wasmBinaryFile;function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(binaryFile){if(!wasmBinary){try{var response=await readAsync(binaryFile);return new Uint8Array(response)}catch{}}return getBinarySync(binaryFile)}async function instantiateArrayBuffer(binaryFile,imports){try{var binary=await getWasmBinary(binaryFile);var instance=await WebAssembly.instantiate(binary,imports);return instance}catch(reason){err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)}}async function instantiateAsync(binary,binaryFile,imports){if(!binary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(binaryFile)&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){try{var response=fetch(binaryFile,{credentials:"same-origin"});var instantiationResult=await WebAssembly.instantiateStreaming(response,imports);return instantiationResult}catch(reason){err(`wasm streaming compile failed: ${reason}`);err("falling back to ArrayBuffer instantiation")}}return instantiateArrayBuffer(binaryFile,imports)}function getWasmImports(){return{a:wasmImports}}async function createWasm(){function receiveInstance(instance,module){wasmExports=instance.exports;wasmMemory=wasmExports["d"];updateMemoryViews();addOnInit(wasmExports["e"]);removeRunDependency("wasm-instantiate");return wasmExports}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}var info=getWasmImports();if(Module["instantiateWasm"]){try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){err(`Module.instantiateWasm callback failed with error: ${e}`);readyPromiseReject(e)}}wasmBinaryFile??=findWasmBinary();try{var result=await instantiateAsync(wasmBinary,wasmBinaryFile,info);receiveInstantiationResult(result);return result}catch(e){readyPromiseReject(e);return}}class ExitStatus{name="ExitStatus";constructor(status){this.message=`Program terminated with exit(${status})`;this.status=status}}var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};function getValue(ptr,type="i8"){if(type.endsWith("*"))type="*";switch(type){case"i1":return HEAP8[ptr];case"i8":return HEAP8[ptr];case"i16":return HEAP16[ptr>>1];case"i32":return HEAP32[ptr>>2];case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return HEAPF32[ptr>>2];case"double":return HEAPF64[ptr>>3];case"*":return HEAPU32[ptr>>2];default:abort(`invalid type for getValue: ${type}`)}}var noExitRuntime=Module["noExitRuntime"]||true;function setValue(ptr,value,type="i8"){if(type.endsWith("*"))type="*";switch(type){case"i1":HEAP8[ptr]=value;break;case"i8":HEAP8[ptr]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;case"*":HEAPU32[ptr>>2]=value;break;default:abort(`invalid type for setValue: ${type}`)}}var __abort_js=()=>abort("");var __emscripten_memcpy_js=(dest,src,num)=>HEAPU8.copyWithin(dest,src,src+num);var getHeapMax=()=>2147483648;var alignMemory=(size,alignment)=>Math.ceil(size/alignment)*alignment;var growMemory=size=>{var b=wasmMemory.buffer;var pages=(size-b.byteLength+65535)/65536|0;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignMemory(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false};var getCFunc=ident=>{var func=Module["_"+ident];return func};var writeArrayToMemory=(array,buffer)=>{HEAP8.set(array,buffer)};var lengthBytesUTF8=str=>{var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++}else if(c<=2047){len+=2}else if(c>=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx};var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);var stackAlloc=sz=>__emscripten_stack_alloc(sz);var stringToUTF8OnStack=str=>{var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8(str,ret,size);return ret};var stackSave=()=>_emscripten_stack_get_current();var stackRestore=val=>__emscripten_stack_restore(val);var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder:undefined;var UTF8ArrayToString=(heapOrArray,idx=0,maxBytesToRead=NaN)=>{var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str};var UTF8ToString=(ptr,maxBytesToRead)=>ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):"";var ccall=(ident,returnType,argTypes,args,opts)=>{var toC={string:str=>{var ret=0;if(str!==null&&str!==undefined&&str!==0){ret=stringToUTF8OnStack(str)}return ret},array:arr=>{var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string"){return UTF8ToString(ret)}if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=stackSave();cArgs[i]=converter(args[i])}else{cArgs[i]=args[i]}}}var ret=func(...cArgs);function onDone(ret){if(stack!==0)stackRestore(stack);return convertReturnValue(ret)}ret=onDone(ret);return ret};var cwrap=(ident,returnType,argTypes,opts)=>{var numericArgs=!argTypes||argTypes.every(type=>type==="number"||type==="boolean");var numericRet=returnType!=="string";if(numericRet&&numericArgs&&!opts){return getCFunc(ident)}return(...args)=>ccall(ident,returnType,argTypes,args,opts)};var wasmImports={a:__abort_js,c:__emscripten_memcpy_js,b:_emscripten_resize_heap};var wasmExports;createWasm();var ___wasm_call_ctors=()=>(___wasm_call_ctors=wasmExports["e"])();var _v2_engine_create=Module["_v2_engine_create"]=()=>(_v2_engine_create=Module["_v2_engine_create"]=wasmExports["g"])();var _v2_engine_destroy=Module["_v2_engine_destroy"]=a0=>(_v2_engine_destroy=Module["_v2_engine_destroy"]=wasmExports["h"])(a0);var _v2_engine_load_json=Module["_v2_engine_load_json"]=(a0,a1)=>(_v2_engine_load_json=Module["_v2_engine_load_json"]=wasmExports["i"])(a0,a1);var _v2_engine_prepare=Module["_v2_engine_prepare"]=(a0,a1,a2,a3)=>(_v2_engine_prepare=Module["_v2_engine_prepare"]=wasmExports["j"])(a0,a1,a2,a3);var _v2_engine_reset=Module["_v2_engine_reset"]=a0=>(_v2_engine_reset=Module["_v2_engine_reset"]=wasmExports["k"])(a0);var _v2_engine_set_control=Module["_v2_engine_set_control"]=(a0,a1,a2)=>(_v2_engine_set_control=Module["_v2_engine_set_control"]=wasmExports["l"])(a0,a1,a2);var _v2_engine_get_control=Module["_v2_engine_get_control"]=(a0,a1)=>(_v2_engine_get_control=Module["_v2_engine_get_control"]=wasmExports["m"])(a0,a1);var _v2_engine_set_supply=Module["_v2_engine_set_supply"]=(a0,a1,a2,a3,a4)=>(_v2_engine_set_supply=Module["_v2_engine_set_supply"]=wasmExports["n"])(a0,a1,a2,a3,a4);var _v2_engine_process_sample=Module["_v2_engine_process_sample"]=(a0,a1)=>(_v2_engine_process_sample=Module["_v2_engine_process_sample"]=wasmExports["o"])(a0,a1);var _v2_engine_process_block=Module["_v2_engine_process_block"]=(a0,a1,a2,a3)=>(_v2_engine_process_block=Module["_v2_engine_process_block"]=wasmExports["p"])(a0,a1,a2,a3);var _v2_engine_get_input_buffer=Module["_v2_engine_get_input_buffer"]=(a0,a1)=>(_v2_engine_get_input_buffer=Module["_v2_engine_get_input_buffer"]=wasmExports["q"])(a0,a1);var _v2_engine_get_output_buffer=Module["_v2_engine_get_output_buffer"]=(a0,a1)=>(_v2_engine_get_output_buffer=Module["_v2_engine_get_output_buffer"]=wasmExports["r"])(a0,a1);var _v2_engine_process_internal=Module["_v2_engine_process_internal"]=(a0,a1)=>(_v2_engine_process_internal=Module["_v2_engine_process_internal"]=wasmExports["s"])(a0,a1);var _v2_engine_get_last_iteration_count=Module["_v2_engine_get_last_iteration_count"]=a0=>(_v2_engine_get_last_iteration_count=Module["_v2_engine_get_last_iteration_count"]=wasmExports["t"])(a0);var _v2_engine_get_last_converged=Module["_v2_engine_get_last_converged"]=a0=>(_v2_engine_get_last_converged=Module["_v2_engine_get_last_converged"]=wasmExports["u"])(a0);var _v2_engine_get_max_iterations=Module["_v2_engine_get_max_iterations"]=a0=>(_v2_engine_get_max_iterations=Module["_v2_engine_get_max_iterations"]=wasmExports["v"])(a0);var _v2_engine_get_operating_point=Module["_v2_engine_get_operating_point"]=(a0,a1,a2)=>(_v2_engine_get_operating_point=Module["_v2_engine_get_operating_point"]=wasmExports["w"])(a0,a1,a2);var _v2_engine_get_state=Module["_v2_engine_get_state"]=(a0,a1,a2)=>(_v2_engine_get_state=Module["_v2_engine_get_state"]=wasmExports["x"])(a0,a1,a2);var _v2_engine_get_last_error=Module["_v2_engine_get_last_error"]=a0=>(_v2_engine_get_last_error=Module["_v2_engine_get_last_error"]=wasmExports["y"])(a0);var _v2_engine_get_schedule_solves=Module["_v2_engine_get_schedule_solves"]=a0=>(_v2_engine_get_schedule_solves=Module["_v2_engine_get_schedule_solves"]=wasmExports["z"])(a0);var _v2_engine_get_schedule_fallbacks=Module["_v2_engine_get_schedule_fallbacks"]=a0=>(_v2_engine_get_schedule_fallbacks=Module["_v2_engine_get_schedule_fallbacks"]=wasmExports["A"])(a0);var _v2_engine_get_kernel_solves=Module["_v2_engine_get_kernel_solves"]=a0=>(_v2_engine_get_kernel_solves=Module["_v2_engine_get_kernel_solves"]=wasmExports["B"])(a0);var _v2_engine_get_repivoted_schedule_blocks=Module["_v2_engine_get_repivoted_schedule_blocks"]=a0=>(_v2_engine_get_repivoted_schedule_blocks=Module["_v2_engine_get_repivoted_schedule_blocks"]=wasmExports["C"])(a0);var _v2_engine_get_abandoned_schedule_blocks=Module["_v2_engine_get_abandoned_schedule_blocks"]=a0=>(_v2_engine_get_abandoned_schedule_blocks=Module["_v2_engine_get_abandoned_schedule_blocks"]=wasmExports["D"])(a0);var _v2_engine_get_dropped_schedule_blocks=Module["_v2_engine_get_dropped_schedule_blocks"]=a0=>(_v2_engine_get_dropped_schedule_blocks=Module["_v2_engine_get_dropped_schedule_blocks"]=wasmExports["E"])(a0);var _malloc=Module["_malloc"]=a0=>(_malloc=Module["_malloc"]=wasmExports["F"])(a0);var _free=Module["_free"]=a0=>(_free=Module["_free"]=wasmExports["G"])(a0);var ___trap=()=>(___trap=wasmExports["H"])();var __emscripten_stack_restore=a0=>(__emscripten_stack_restore=wasmExports["I"])(a0);var __emscripten_stack_alloc=a0=>(__emscripten_stack_alloc=wasmExports["J"])(a0);var _emscripten_stack_get_current=()=>(_emscripten_stack_get_current=wasmExports["K"])();Module["ccall"]=ccall;Module["cwrap"]=cwrap;Module["setValue"]=setValue;Module["getValue"]=getValue;Module["UTF8ToString"]=UTF8ToString;Module["stringToUTF8"]=stringToUTF8;Module["lengthBytesUTF8"]=lengthBytesUTF8;var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(){if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);Module["onRuntimeInitialized"]?.();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(()=>{setTimeout(()=>Module["setStatus"](""),1);doRun()},1)}else{doRun()}}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();moduleRtn=readyPromise;
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
return moduleRtn;
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
})();
|
|
16
|
+
if (typeof exports === 'object' && typeof module === 'object') {
|
|
17
|
+
module.exports = createV2DspModule;
|
|
18
|
+
// This default export looks redundant, but it allows TS to import this
|
|
19
|
+
// commonjs style module.
|
|
20
|
+
module.exports.default = createV2DspModule;
|
|
21
|
+
} else if (typeof define === 'function' && define['amd'])
|
|
22
|
+
define([], () => createV2DspModule);
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vessel-dsp/runtime",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Real-time MNA simulation runtime and solver console for VesselDSP Program ROMs.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"guitar-pedal",
|
|
7
|
+
"electronics",
|
|
8
|
+
"simulation",
|
|
9
|
+
"dsp",
|
|
10
|
+
"runtime",
|
|
11
|
+
"solver",
|
|
12
|
+
"mna"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://vessel-dsp.github.io/core/",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/vessel-dsp/core/issues"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/vessel-dsp/core.git"
|
|
21
|
+
},
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"type": "module",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"bun": "./dist/index.js",
|
|
29
|
+
"import": "./dist/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./package.json": {
|
|
32
|
+
"default": "./package.json"
|
|
33
|
+
},
|
|
34
|
+
"./wasm/*": {
|
|
35
|
+
"default": "./dist/wasm/*"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"main": "./dist/index.js",
|
|
39
|
+
"module": "./dist/index.js",
|
|
40
|
+
"types": "./dist/index.d.ts",
|
|
41
|
+
"files": [
|
|
42
|
+
"dist",
|
|
43
|
+
"README.md",
|
|
44
|
+
"LICENSE.md"
|
|
45
|
+
],
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsc -p tsconfig.build.json && bun run ../../scripts/fix-dist-imports.ts dist && rm -rf dist/wasm && cp -r src/wasm dist/wasm",
|
|
48
|
+
"clean": "rm -rf dist",
|
|
49
|
+
"prepack": "bun run --cwd ../core build && bun run --cwd ../compiler build && bun run build:wasm && bun run build",
|
|
50
|
+
"pack:dry-run": "npm pack --dry-run",
|
|
51
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
52
|
+
"build:wasm": "bash scripts/build-wasm.sh",
|
|
53
|
+
"test": "bun test tests",
|
|
54
|
+
"generate-kernels": "bun scripts/generate-kernels.ts"
|
|
55
|
+
},
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"@vessel-dsp/compiler": "0.2.0"
|
|
58
|
+
},
|
|
59
|
+
"publishConfig": {
|
|
60
|
+
"access": "public"
|
|
61
|
+
}
|
|
62
|
+
}
|