@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,105 @@
|
|
|
1
|
+
// A chain slot that is not a compiled circuit.
|
|
2
|
+
//
|
|
3
|
+
// The chain used to be `Program[]`, which made every slot an MNA circuit and left the signal's final
|
|
4
|
+
// destination outside the runtime entirely. `chain-advisories.ts` said so in as many words: the rule
|
|
5
|
+
// that a miked signal must not be sent through a cabinet again "is **not expressible here**, because
|
|
6
|
+
// the coloration stage is not a chain slot". Making it one is what this file is for.
|
|
7
|
+
//
|
|
8
|
+
// **The runtime does not implement NAM or IR, and must not.** Two rules forbid it, and they agree:
|
|
9
|
+
// the v2 runtime may import the program contract and nothing else, so `src/dsp`'s convolvers and the
|
|
10
|
+
// cab simulator are out of reach; and the console/ROM rule says adding a device must never require a
|
|
11
|
+
// runtime change. A NAM profile is another kind of ROM. So the runtime owns the **seams** -- scaling,
|
|
12
|
+
// ordering, advisories, telemetry -- and the host supplies the engine.
|
|
13
|
+
//
|
|
14
|
+
// What a slot must state is therefore small, and it is the same in both directions:
|
|
15
|
+
//
|
|
16
|
+
// - **what it produces**, as a `stageCoverage`, so the chain knows how far down the amplification
|
|
17
|
+
// path its output already sits;
|
|
18
|
+
// - **what it expects**, so a speaker terminal feeding an instrument input is separable from a
|
|
19
|
+
// speaker terminal feeding a cabinet, which is a legitimate and very common connection;
|
|
20
|
+
// - **its full scale at each port**, or `null`, so seams scale where both sides know and are
|
|
21
|
+
// reported where they do not.
|
|
22
|
+
//
|
|
23
|
+
// A compiled `Program` already carries the first and third. It does not carry the second because it
|
|
24
|
+
// does not need to: a compiled circuit's input is a jack, and a jack expects an instrument-level
|
|
25
|
+
// signal. That is why `slotContract` supplies `instrument` for a program rather than the compiler
|
|
26
|
+
// growing a field.
|
|
27
|
+
/**
|
|
28
|
+
* Row 8 tail step 1 — host mapping: bypass state → chain mode, per `program.bypass.kind`.
|
|
29
|
+
*
|
|
30
|
+
* The Studio's slot toggle already reads ENGAGED/BYPASSED, but the worklet chain omitted
|
|
31
|
+
* bypassed slots, so a bypassed buffered pedal ran no buffer and the mode plumbing
|
|
32
|
+
* (`setBypassMode`, `effectiveBypassMode`) never engaged in product. The host now keeps
|
|
33
|
+
* the slot and states the mode instead of dropping it.
|
|
34
|
+
*
|
|
35
|
+
* Returns `null` when no honest mode exists yet: `buffered` bypass needs the compiler's
|
|
36
|
+
* `bufferProgram` derivation (row 8 step 2), and requesting `buffer` without one falls back
|
|
37
|
+
* to the full program — which would play the effect under bypass. The caller omits those
|
|
38
|
+
* slots exactly as before, until step 2 lands. Everything else maps:
|
|
39
|
+
* engaged → `effect`; bypassed `true-bypass` → `wire`; `hardwire` → `wire`, with the input
|
|
40
|
+
* loading a hardwired output switch leaves behind still unmodelled (23 pedals by census —
|
|
41
|
+
* named here, not silent); `none` / `not-in-audio-path` → `wire`, agreeing with the
|
|
42
|
+
* runtime's own demotion guard.
|
|
43
|
+
*/
|
|
44
|
+
export function resolveBypassMode(bypass, engaged) {
|
|
45
|
+
if (engaged) {
|
|
46
|
+
return "effect";
|
|
47
|
+
}
|
|
48
|
+
if (bypass.declared === "none") {
|
|
49
|
+
return "wire";
|
|
50
|
+
}
|
|
51
|
+
switch (bypass.kind) {
|
|
52
|
+
case "true-bypass":
|
|
53
|
+
return "wire";
|
|
54
|
+
case "hardwire":
|
|
55
|
+
return "wire";
|
|
56
|
+
case "buffered":
|
|
57
|
+
case "buffered-mechanical":
|
|
58
|
+
// Both carry the pedal's own buffers in the bypass path; neither has a chain mode
|
|
59
|
+
// until the buffer program exists (row 8 step 3), so the host must decide.
|
|
60
|
+
return null;
|
|
61
|
+
case "not-in-audio-path":
|
|
62
|
+
return "wire";
|
|
63
|
+
default:
|
|
64
|
+
return "wire";
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/** A compiled circuit as a slot. `bufferProgram` is the buffer-only stages for buffered bypass. */
|
|
68
|
+
export function programSlot(program, bufferProgram) {
|
|
69
|
+
return bufferProgram !== undefined ? { kind: "program", program, bufferProgram } : { kind: "program", program };
|
|
70
|
+
}
|
|
71
|
+
/** A compiled circuit as a slot with explicit buffer processor (WASM). */
|
|
72
|
+
export function programSlotWithBufferProcessor(program, bufferProcessor, bufferProgram) {
|
|
73
|
+
return { kind: "program", program, bufferProgram, bufferProcessor, bypassMode: "effect" };
|
|
74
|
+
}
|
|
75
|
+
/** An injected processor as a slot. */
|
|
76
|
+
export function processorSlot(processor) {
|
|
77
|
+
return { kind: "processor", processor };
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The contract a slot presents to the seam arithmetic.
|
|
81
|
+
*
|
|
82
|
+
* A program's `expects` is `instrument` by construction -- its input is a jack. Nothing infers it,
|
|
83
|
+
* and no compiler field is needed for it.
|
|
84
|
+
*/
|
|
85
|
+
export function slotContract(slot) {
|
|
86
|
+
if (slot.kind === "processor") {
|
|
87
|
+
return slot.processor;
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
produces: slot.program.stageCoverage,
|
|
91
|
+
expects: "instrument",
|
|
92
|
+
portFullScaleVolts: slot.program.portFullScaleVolts,
|
|
93
|
+
portReferenceVolts: slot.program.portReferenceVolts,
|
|
94
|
+
// A compiled circuit always has electrical ports, so this is the object form even when both
|
|
95
|
+
// impedances are unstated. A processor supplies `null` instead -- see `SlotContract`.
|
|
96
|
+
portImpedanceOhms: slot.program.portImpedanceOhms,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/** How a slot names itself in a message. */
|
|
100
|
+
export function slotLabel(slot, index) {
|
|
101
|
+
return slot.kind === "processor"
|
|
102
|
+
? `slot ${index} (${slot.processor.id})`
|
|
103
|
+
: `slot ${index}`;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=chain-slot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain-slot.js","sourceRoot":"","sources":["../src/chain-slot.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,EAAE;AACF,qGAAqG;AACrG,qGAAqG;AACrG,qGAAqG;AACrG,qFAAqF;AACrF,EAAE;AACF,mGAAmG;AACnG,qGAAqG;AACrG,qGAAqG;AACrG,sGAAsG;AACtG,uEAAuE;AACvE,EAAE;AACF,oFAAoF;AACpF,EAAE;AACF,oGAAoG;AACpG,oCAAoC;AACpC,iGAAiG;AACjG,4FAA4F;AAC5F,+FAA+F;AAC/F,kCAAkC;AAClC,EAAE;AACF,oGAAoG;AACpG,iGAAiG;AACjG,kGAAkG;AAClG,mBAAmB;AA2FnB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,iBAAiB,CAChC,MAAyB,EACzB,OAAgB;IAEhB,IAAI,OAAO,EAAE,CAAC;QACb,OAAO,QAAQ,CAAC;IACjB,CAAC;IACD,IAAI,MAAM,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC;IACf,CAAC;IACD,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACrB,KAAK,aAAa;YACjB,OAAO,MAAM,CAAC;QACf,KAAK,UAAU;YACd,OAAO,MAAM,CAAC;QACf,KAAK,UAAU,CAAC;QAChB,KAAK,qBAAqB;YACzB,kFAAkF;YAClF,2EAA2E;YAC3E,OAAO,IAAI,CAAC;QACb,KAAK,mBAAmB;YACvB,OAAO,MAAM,CAAC;QACf;YACC,OAAO,MAAM,CAAC;IAChB,CAAC;AACF,CAAC;AAiBD,mGAAmG;AACnG,MAAM,UAAU,WAAW,C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.d.ts
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type { ControlId } from "@vessel-dsp/compiler";
|
|
2
|
+
import { type RealtimeBudget } from "./admission";
|
|
3
|
+
import { type ChainSlot } from "./chain-slot";
|
|
4
|
+
import type { SupplyAddress } from "./supply";
|
|
5
|
+
import { type RuntimeTelemetry } from "./reference-runtime";
|
|
6
|
+
/** One slot's own telemetry, labelled by position. See `ChainRuntime.telemetry()`. */
|
|
7
|
+
export type ChainSlotTelemetry = RuntimeTelemetry & {
|
|
8
|
+
readonly slot: number;
|
|
9
|
+
};
|
|
10
|
+
export type BypassMode = "wire" | "buffer" | "effect";
|
|
11
|
+
export declare class ChainRuntime {
|
|
12
|
+
private readonly slots;
|
|
13
|
+
private readonly contracts;
|
|
14
|
+
/** One per slot: a runtime for a program, the injected processor otherwise. */
|
|
15
|
+
private readonly engines;
|
|
16
|
+
/** Parallel buffer engines; ExternalProcessor for WASM buffer, ReferenceRuntime for TS buffer. */
|
|
17
|
+
private readonly bufferEngines;
|
|
18
|
+
/**
|
|
19
|
+
* Output DC blocker state, carried across `process` calls.
|
|
20
|
+
*
|
|
21
|
+
* **A chain ends in something, and that something is AC-coupled.** A runtime reads the
|
|
22
|
+
* output jack unloaded and DC-coupled, which no real signal chain is: the next device
|
|
23
|
+
* always presents a coupling cap and an input resistance. Without this the jack's
|
|
24
|
+
* operating point reaches the converter, and a packet whose output sits a few volts off
|
|
25
|
+
* ground clamps every sample to full scale -- audible offline, digitally silent here.
|
|
26
|
+
* Measured 2026-09-22: four corpus packets were in that state, `boss-dd-5` at 3.561 V
|
|
27
|
+
* against a 1.0 V full scale.
|
|
28
|
+
*
|
|
29
|
+
* Stateful across calls because a worklet hands over 128 samples at a time; a per-buffer
|
|
30
|
+
* mean-subtract would put a step at every quantum boundary.
|
|
31
|
+
*/
|
|
32
|
+
private dcPole;
|
|
33
|
+
private dcPreviousIn;
|
|
34
|
+
private dcPreviousOut;
|
|
35
|
+
constructor(slots: readonly ChainSlot[]);
|
|
36
|
+
private effectiveBypassMode;
|
|
37
|
+
private effectiveContract;
|
|
38
|
+
/** How many slots this chain has. */
|
|
39
|
+
get length(): number;
|
|
40
|
+
/**
|
|
41
|
+
* Gates the whole chain once (see this module's header), then prepares every slot,
|
|
42
|
+
* ungated, at the same rate and iteration cap. A slot's own refusal -- an operator or
|
|
43
|
+
* DSP model this runtime cannot execute -- is rethrown naming its slot, since
|
|
44
|
+
* `ReferenceRuntime`'s `RuntimeError` cannot know which slot it ran in.
|
|
45
|
+
*/
|
|
46
|
+
prepare(sampleRate: number, options?: {
|
|
47
|
+
readonly maxNewtonIterations?: number;
|
|
48
|
+
readonly realtimeBudget?: RealtimeBudget;
|
|
49
|
+
}): void;
|
|
50
|
+
/**
|
|
51
|
+
* Slot 0 runs on `input`; its output buffer becomes slot 1's input, and so on -- the
|
|
52
|
+
* last slot's output is the chain's output.
|
|
53
|
+
*
|
|
54
|
+
* Whole buffers pass between slots rather than sample-by-sample calls between them.
|
|
55
|
+
* That is safe, not merely convenient: this is a feedforward chain (no slot reads a
|
|
56
|
+
* later slot's output), `ReferenceRuntime.process` has no lookahead -- each sample is a
|
|
57
|
+
* causal function of that slot's own past reactive state and the sample handed to it --
|
|
58
|
+
* so slot 1 sees the identical sample sequence in the identical order whether the chain
|
|
59
|
+
* hands it one sample at a time or the whole buffer at once. Each slot still advances
|
|
60
|
+
* its own sample-by-sample loop internally exactly as it always has.
|
|
61
|
+
*
|
|
62
|
+
* Allocates one `Float64Array` per slot per call (each `ReferenceRuntime.process` call
|
|
63
|
+
* allocates its own output buffer) -- for a worklet driven at a small quantum this is an
|
|
64
|
+
* allocation on the audio thread every callback, once per slot in the chain. Left as is:
|
|
65
|
+
* reusing scratch buffers across slots is a separate change, noted rather than made here.
|
|
66
|
+
*
|
|
67
|
+
* **Bypass modes:**
|
|
68
|
+
* - `wire` (true-bypass): no seam scaling, no solver — a wire.
|
|
69
|
+
* - `buffer` (buffered bypass): runs the bufferProgram (a handful of nodes), with seam
|
|
70
|
+
* scaling against the buffer's output (a real stage). If no bufferProgram is present,
|
|
71
|
+
* falls back to full program (slower, never wrong).
|
|
72
|
+
* - `effect` (default): full program.
|
|
73
|
+
* The seam into a bypassed slot is not scaled (a wire has no port), and the seam into
|
|
74
|
+
* the next non-wire slot is computed against the last non-wire upstream.
|
|
75
|
+
*/
|
|
76
|
+
process(input: Float64Array): Float64Array;
|
|
77
|
+
/**
|
|
78
|
+
* The coupling every real downstream device presents, as a first-order high pass.
|
|
79
|
+
*
|
|
80
|
+
* Identical pole to the offline renderer's, deliberately. A plain mean-subtract would
|
|
81
|
+
* leave the operating-point settling ramp in the signal and would step at every buffer
|
|
82
|
+
* boundary; this removes both and carries its state across calls.
|
|
83
|
+
*/
|
|
84
|
+
private blockDc;
|
|
85
|
+
setBypassMode(slot: number, mode: BypassMode): void;
|
|
86
|
+
/** Slots where bypass was requested but the packet declares `audio.bypass: "none"` — wired through, flagged. */
|
|
87
|
+
bypassNotModelledSlots(): readonly number[];
|
|
88
|
+
/**
|
|
89
|
+
* Addresses a control by (slot, id). Slot index is the only disambiguator: two identical
|
|
90
|
+
* pedals in the chain declare the same control ids, but each slot owns an independent
|
|
91
|
+
* `ReferenceRuntime` with its own control-position map, so the shared id never collides
|
|
92
|
+
* with the other slot's.
|
|
93
|
+
*/
|
|
94
|
+
setControl(slot: number, id: ControlId, position: number): void;
|
|
95
|
+
/**
|
|
96
|
+
* Addresses a supply by (slot, addresses), mirroring `setControl`'s routing.
|
|
97
|
+
* Each slot owns an independent `ReferenceRuntime` with its own supply
|
|
98
|
+
* stamps, so the shared `sourceIndex` never collides with another slot's.
|
|
99
|
+
* A processor slot (NAM or IR) is refused by name: it has no compiled
|
|
100
|
+
* `dc-source` stamps, and a silently ignored rail would be the failure this
|
|
101
|
+
* file's telemetry exists to avoid.
|
|
102
|
+
*/
|
|
103
|
+
setSupply(slot: number, addresses: readonly SupplyAddress[], volts: number, sourceOhms: number): void;
|
|
104
|
+
/**
|
|
105
|
+
* Every slot's own telemetry, labelled by position -- never blended into one set of
|
|
106
|
+
* totals. A chain's `samples`/`heldSamples`/etc. are per-slot facts (a nonlinear block
|
|
107
|
+
* failing to converge in slot 2 says nothing about slot 0), so summing or averaging them
|
|
108
|
+
* would silently under-report whichever slot is actually struggling; see this module's
|
|
109
|
+
* header and `RuntimeTelemetry` in `reference-runtime.ts`.
|
|
110
|
+
*/
|
|
111
|
+
telemetry(): readonly ChainSlotTelemetry[];
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=chain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../src/chain.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,SAAS,EAAW,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAEpE,OAAO,EACN,KAAK,SAAS,EAKd,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAIN,KAAK,gBAAgB,EACrB,MAAM,qBAAqB,CAAC;AAE7B,sFAAsF;AACtF,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9E,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAWtD,qBAAa,YAAY;IACxB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA0B;IACpD,+EAA+E;IAC/E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoD;IAC5E,kGAAkG;IAClG,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA2D;IACzF;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,aAAa,CAAK;gBAEd,KAAK,EAAE,SAAS,SAAS,EAAE;IAkBvC,OAAO,CAAC,mBAAmB;IAgB3B,OAAO,CAAC,iBAAiB;IAmBzB,qCAAqC;IACrC,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;;;OAKG;IACH,OAAO,CACN,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE;QACR,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;QACtC,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;KACpC,GACJ,IAAI;IAmDP;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY;IAkD1C;;;;;;OAMG;IACH,OAAO,CAAC,OAAO;IAcf,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI;IAkBnD,gHAAgH;IAChH,sBAAsB,IAAI,SAAS,MAAM,EAAE;IAY3C;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAmB/D;;;;;;;OAOG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,aAAa,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAgBrG;;;;;;OAMG;IACH,SAAS,IAAI,SAAS,kBAAkB,EAAE;CAW1C"}
|
package/dist/chain.js
ADDED
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
// A chain: an ordered list of compiled Programs the v2 console runs in series -- slot 0's
|
|
2
|
+
// output sample feeds slot 1's input sample, and so on, and the last slot's output is the
|
|
3
|
+
// chain's output. This is what makes "pedal A into pedal B" a runtime concern rather than a
|
|
4
|
+
// compiler one.
|
|
5
|
+
//
|
|
6
|
+
// **A chain is a property of the runtime, never of a Program.** No field here describes a
|
|
7
|
+
// program's position in a chain, no program is fused with another at any point, and no
|
|
8
|
+
// pedal's compiled bytes change depending on which slot it occupies. `ChainRuntime` is
|
|
9
|
+
// nothing more than N independent `ReferenceRuntime` instances, each with its own state and
|
|
10
|
+
// its own `prepare(rate)`, wired output-to-input. A single pedal is the one-element case of
|
|
11
|
+
// this, not a separate code path -- see `admission.ts`'s own header, which already says so:
|
|
12
|
+
// "there is no single-program entry point left ... a caller with one program passes a
|
|
13
|
+
// one-element list and gets an identical answer." `admission.ts` and
|
|
14
|
+
// `reference-runtime.ts`'s `prepare()` both already name this file in comments written
|
|
15
|
+
// before it existed; this is that file.
|
|
16
|
+
//
|
|
17
|
+
// **Gate once, prepare ungated.** `admissionVerdict` takes the whole ordered list and sums
|
|
18
|
+
// worst-case cost across every slot -- gating each slot separately against the whole budget
|
|
19
|
+
// is exactly the permissive failure admission.ts's header warns about (three pedals at 0.9x
|
|
20
|
+
// each, admitted individually, need 2.7x together). So `prepare()` here calls
|
|
21
|
+
// `admissionVerdict` once over `this.programs`, then prepares every slot's own
|
|
22
|
+
// `ReferenceRuntime` with no `realtimeBudget` at all -- passing the budget down a second
|
|
23
|
+
// time would charge each slot against the *whole* chain's budget again.
|
|
24
|
+
//
|
|
25
|
+
// The operator/model lockout is untouched and still runs per slot: it is a question about
|
|
26
|
+
// whether a runtime can execute a program at all, independent of any budget, and it lives
|
|
27
|
+
// inside `ReferenceRuntime.prepare()` before that method ever looks at `realtimeBudget` --
|
|
28
|
+
// see its own comment. A slot that fails it here is refused with the slot named, because
|
|
29
|
+
// `ReferenceRuntime`'s own `RuntimeError` has no way to know which slot it was running in.
|
|
30
|
+
import { admissionVerdict } from "./admission.js";
|
|
31
|
+
import { seamScale } from "./chain-advisories.js";
|
|
32
|
+
import { slotContract, slotLabel, } from "./chain-slot.js";
|
|
33
|
+
import { DEFAULT_NEWTON_MAX_ITERATIONS, ReferenceRuntime, RuntimeError, } from "./reference-runtime.js";
|
|
34
|
+
/**
|
|
35
|
+
* Corner of the chain's output DC blocker, in hertz.
|
|
36
|
+
*
|
|
37
|
+
* The same 10 Hz first-order pole `scripts/render-v2-audio.ts` has used since the
|
|
38
|
+
* `marshall-blues-breaker` finding. The two paths must agree: a packet that is listenable
|
|
39
|
+
* offline and silent in the browser is precisely the defect this constant exists to close.
|
|
40
|
+
*/
|
|
41
|
+
const DC_BLOCK_HZ = 10;
|
|
42
|
+
export class ChainRuntime {
|
|
43
|
+
slots;
|
|
44
|
+
contracts;
|
|
45
|
+
/** One per slot: a runtime for a program, the injected processor otherwise. */
|
|
46
|
+
engines;
|
|
47
|
+
/** Parallel buffer engines; ExternalProcessor for WASM buffer, ReferenceRuntime for TS buffer. */
|
|
48
|
+
bufferEngines;
|
|
49
|
+
/**
|
|
50
|
+
* Output DC blocker state, carried across `process` calls.
|
|
51
|
+
*
|
|
52
|
+
* **A chain ends in something, and that something is AC-coupled.** A runtime reads the
|
|
53
|
+
* output jack unloaded and DC-coupled, which no real signal chain is: the next device
|
|
54
|
+
* always presents a coupling cap and an input resistance. Without this the jack's
|
|
55
|
+
* operating point reaches the converter, and a packet whose output sits a few volts off
|
|
56
|
+
* ground clamps every sample to full scale -- audible offline, digitally silent here.
|
|
57
|
+
* Measured 2026-09-22: four corpus packets were in that state, `boss-dd-5` at 3.561 V
|
|
58
|
+
* against a 1.0 V full scale.
|
|
59
|
+
*
|
|
60
|
+
* Stateful across calls because a worklet hands over 128 samples at a time; a per-buffer
|
|
61
|
+
* mean-subtract would put a step at every quantum boundary.
|
|
62
|
+
*/
|
|
63
|
+
dcPole = 0;
|
|
64
|
+
dcPreviousIn = 0;
|
|
65
|
+
dcPreviousOut = 0;
|
|
66
|
+
constructor(slots) {
|
|
67
|
+
if (slots.length === 0) {
|
|
68
|
+
throw new RuntimeError("a chain needs at least one slot, got 0");
|
|
69
|
+
}
|
|
70
|
+
this.slots = slots.map((s) => ({ ...s }));
|
|
71
|
+
this.contracts = this.slots.map((slot) => slotContract(slot));
|
|
72
|
+
this.engines = this.slots.map((slot) => slot.kind === "program"
|
|
73
|
+
? new ReferenceRuntime(slot.program)
|
|
74
|
+
: slot.processor);
|
|
75
|
+
this.bufferEngines = this.slots.map((slot) => {
|
|
76
|
+
if (slot.bufferProcessor !== undefined)
|
|
77
|
+
return slot.bufferProcessor;
|
|
78
|
+
if (slot.kind === "program" && slot.bufferProgram !== undefined)
|
|
79
|
+
return new ReferenceRuntime(slot.bufferProgram);
|
|
80
|
+
return null;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
effectiveBypassMode(slot) {
|
|
84
|
+
const s = this.slots[slot];
|
|
85
|
+
const raw = s?.bypassMode ?? "effect";
|
|
86
|
+
// Declared absence or switch not in audio path: wire is the only honest choice.
|
|
87
|
+
// Surface via advisory, not log.
|
|
88
|
+
if (raw !== "effect" && s?.kind === "program") {
|
|
89
|
+
if (s.program.bypass.declared === "none" ||
|
|
90
|
+
s.program.bypass.kind === "not-in-audio-path") {
|
|
91
|
+
return "wire";
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return raw;
|
|
95
|
+
}
|
|
96
|
+
effectiveContract(slot) {
|
|
97
|
+
const s = this.slots[slot];
|
|
98
|
+
if (s === undefined)
|
|
99
|
+
return null;
|
|
100
|
+
const mode = this.effectiveBypassMode(slot);
|
|
101
|
+
if (mode === "wire")
|
|
102
|
+
return null;
|
|
103
|
+
if (mode === "buffer") {
|
|
104
|
+
if (s.bufferProcessor !== undefined)
|
|
105
|
+
return s.bufferProcessor;
|
|
106
|
+
if (s.kind === "program" && s.bufferProgram !== undefined) {
|
|
107
|
+
return {
|
|
108
|
+
produces: s.bufferProgram.stageCoverage,
|
|
109
|
+
expects: "instrument",
|
|
110
|
+
portFullScaleVolts: s.bufferProgram.portFullScaleVolts,
|
|
111
|
+
portImpedanceOhms: s.bufferProgram.portImpedanceOhms,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return slotContract(s);
|
|
116
|
+
}
|
|
117
|
+
/** How many slots this chain has. */
|
|
118
|
+
get length() {
|
|
119
|
+
return this.engines.length;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Gates the whole chain once (see this module's header), then prepares every slot,
|
|
123
|
+
* ungated, at the same rate and iteration cap. A slot's own refusal -- an operator or
|
|
124
|
+
* DSP model this runtime cannot execute -- is rethrown naming its slot, since
|
|
125
|
+
* `ReferenceRuntime`'s `RuntimeError` cannot know which slot it ran in.
|
|
126
|
+
*/
|
|
127
|
+
prepare(sampleRate, options = {}) {
|
|
128
|
+
// Resolved here, once, so the iteration count the admission gate charges is exactly
|
|
129
|
+
// the iteration count every slot will actually be prepared with -- `ReferenceRuntime`
|
|
130
|
+
// resolves the identical default the identical way, from the identical constant.
|
|
131
|
+
const maxNewtonIterations = Math.max(1, Math.floor(options.maxNewtonIterations ?? DEFAULT_NEWTON_MAX_ITERATIONS));
|
|
132
|
+
this.dcPole = sampleRate > 0 ? 1 - (2 * Math.PI * DC_BLOCK_HZ) / sampleRate : 0;
|
|
133
|
+
this.dcPreviousIn = 0;
|
|
134
|
+
this.dcPreviousOut = 0;
|
|
135
|
+
if (options.realtimeBudget !== undefined) {
|
|
136
|
+
// **Only the compiled slots are charged.** The admission model costs Newton iterations
|
|
137
|
+
// against a matrix it can size from the program; an injected NAM or IR has neither, and
|
|
138
|
+
// guessing a cost for it would make the verdict a fiction. A chain whose processors are
|
|
139
|
+
// expensive can still overrun, and that is the host's to know -- so a `fits` verdict here
|
|
140
|
+
// means the circuit slots fit, not that the whole chain does.
|
|
141
|
+
const verdict = admissionVerdict(this.slots.flatMap((slot) => slot.kind === "program" ? [slot.program] : []), sampleRate, options.realtimeBudget);
|
|
142
|
+
if (!verdict.fits) {
|
|
143
|
+
throw new RuntimeError(verdict.reason);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
for (const [slot, engine] of this.engines.entries()) {
|
|
147
|
+
try {
|
|
148
|
+
// Ungated: `realtimeBudget` is deliberately not forwarded here. The whole
|
|
149
|
+
// chain was already charged against it above; forwarding it per slot would
|
|
150
|
+
// charge every slot against the whole chain's budget a second time.
|
|
151
|
+
if (engine instanceof ReferenceRuntime) {
|
|
152
|
+
engine.prepare(sampleRate, { maxNewtonIterations });
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
engine.prepare(sampleRate);
|
|
156
|
+
}
|
|
157
|
+
const bufEngine = this.bufferEngines[slot];
|
|
158
|
+
if (bufEngine !== null) {
|
|
159
|
+
bufEngine.prepare(sampleRate, { maxNewtonIterations });
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
if (error instanceof RuntimeError) {
|
|
164
|
+
throw new RuntimeError(`slot ${slot}: ${error.message}`);
|
|
165
|
+
}
|
|
166
|
+
throw error;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Slot 0 runs on `input`; its output buffer becomes slot 1's input, and so on -- the
|
|
172
|
+
* last slot's output is the chain's output.
|
|
173
|
+
*
|
|
174
|
+
* Whole buffers pass between slots rather than sample-by-sample calls between them.
|
|
175
|
+
* That is safe, not merely convenient: this is a feedforward chain (no slot reads a
|
|
176
|
+
* later slot's output), `ReferenceRuntime.process` has no lookahead -- each sample is a
|
|
177
|
+
* causal function of that slot's own past reactive state and the sample handed to it --
|
|
178
|
+
* so slot 1 sees the identical sample sequence in the identical order whether the chain
|
|
179
|
+
* hands it one sample at a time or the whole buffer at once. Each slot still advances
|
|
180
|
+
* its own sample-by-sample loop internally exactly as it always has.
|
|
181
|
+
*
|
|
182
|
+
* Allocates one `Float64Array` per slot per call (each `ReferenceRuntime.process` call
|
|
183
|
+
* allocates its own output buffer) -- for a worklet driven at a small quantum this is an
|
|
184
|
+
* allocation on the audio thread every callback, once per slot in the chain. Left as is:
|
|
185
|
+
* reusing scratch buffers across slots is a separate change, noted rather than made here.
|
|
186
|
+
*
|
|
187
|
+
* **Bypass modes:**
|
|
188
|
+
* - `wire` (true-bypass): no seam scaling, no solver — a wire.
|
|
189
|
+
* - `buffer` (buffered bypass): runs the bufferProgram (a handful of nodes), with seam
|
|
190
|
+
* scaling against the buffer's output (a real stage). If no bufferProgram is present,
|
|
191
|
+
* falls back to full program (slower, never wrong).
|
|
192
|
+
* - `effect` (default): full program.
|
|
193
|
+
* The seam into a bypassed slot is not scaled (a wire has no port), and the seam into
|
|
194
|
+
* the next non-wire slot is computed against the last non-wire upstream.
|
|
195
|
+
*/
|
|
196
|
+
process(input) {
|
|
197
|
+
let buffer = input;
|
|
198
|
+
let lastNonWire = -1;
|
|
199
|
+
for (const [slot, engine] of this.engines.entries()) {
|
|
200
|
+
const mode = this.effectiveBypassMode(slot);
|
|
201
|
+
if (mode === "wire") {
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
const isBuffer = mode === "buffer";
|
|
205
|
+
const effectiveContract = this.effectiveContract(slot);
|
|
206
|
+
const upstreamContract = lastNonWire >= 0 ? this.effectiveContract(lastNonWire) : null;
|
|
207
|
+
if (lastNonWire >= 0 && effectiveContract !== null && upstreamContract !== null) {
|
|
208
|
+
const upstream = upstreamContract.portFullScaleVolts.output;
|
|
209
|
+
const downstream = effectiveContract.portFullScaleVolts.input;
|
|
210
|
+
const scale = upstream === null || downstream === null || downstream === 0 ? 1 : upstream / downstream;
|
|
211
|
+
const source = upstreamContract.portImpedanceOhms;
|
|
212
|
+
const load = effectiveContract.portImpedanceOhms;
|
|
213
|
+
const out = source?.output ?? null;
|
|
214
|
+
const inn = load?.input ?? null;
|
|
215
|
+
let divider = 1;
|
|
216
|
+
if (out !== null && inn !== null) {
|
|
217
|
+
const total = out + inn;
|
|
218
|
+
divider = total <= 0 ? 1 : inn / total;
|
|
219
|
+
}
|
|
220
|
+
const effectiveScale = scale * divider;
|
|
221
|
+
if (effectiveScale !== 1) {
|
|
222
|
+
const scaled = new Float64Array(buffer.length);
|
|
223
|
+
for (let index = 0; index < buffer.length; index += 1) {
|
|
224
|
+
scaled[index] = (buffer[index] ?? 0) * effectiveScale;
|
|
225
|
+
}
|
|
226
|
+
buffer = scaled;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
else if (slot > 0 && lastNonWire === -1) {
|
|
230
|
+
// Leading wire slots: no upstream to scale against.
|
|
231
|
+
}
|
|
232
|
+
if (isBuffer) {
|
|
233
|
+
const bufEngine = this.bufferEngines[slot];
|
|
234
|
+
if (bufEngine !== null) {
|
|
235
|
+
buffer = bufEngine.process(buffer);
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
buffer = engine.process(buffer);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
buffer = engine.process(buffer);
|
|
243
|
+
}
|
|
244
|
+
lastNonWire = slot;
|
|
245
|
+
}
|
|
246
|
+
return this.blockDc(buffer);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* The coupling every real downstream device presents, as a first-order high pass.
|
|
250
|
+
*
|
|
251
|
+
* Identical pole to the offline renderer's, deliberately. A plain mean-subtract would
|
|
252
|
+
* leave the operating-point settling ramp in the signal and would step at every buffer
|
|
253
|
+
* boundary; this removes both and carries its state across calls.
|
|
254
|
+
*/
|
|
255
|
+
blockDc(buffer) {
|
|
256
|
+
if (!(this.dcPole > 0) || buffer.length === 0) {
|
|
257
|
+
return buffer;
|
|
258
|
+
}
|
|
259
|
+
const out = new Float64Array(buffer.length);
|
|
260
|
+
for (let index = 0; index < buffer.length; index += 1) {
|
|
261
|
+
const sample = buffer[index] ?? 0;
|
|
262
|
+
this.dcPreviousOut = sample - this.dcPreviousIn + this.dcPole * this.dcPreviousOut;
|
|
263
|
+
this.dcPreviousIn = sample;
|
|
264
|
+
out[index] = this.dcPreviousOut;
|
|
265
|
+
}
|
|
266
|
+
return out;
|
|
267
|
+
}
|
|
268
|
+
setBypassMode(slot, mode) {
|
|
269
|
+
const current = this.slots[slot];
|
|
270
|
+
if (current === undefined) {
|
|
271
|
+
throw new RuntimeError(`chain has no slot ${slot} (chain length is ${this.engines.length})`);
|
|
272
|
+
}
|
|
273
|
+
const next = current.kind === "program"
|
|
274
|
+
? {
|
|
275
|
+
kind: "program",
|
|
276
|
+
program: current.program,
|
|
277
|
+
bufferProgram: current.bufferProgram,
|
|
278
|
+
bufferProcessor: current.bufferProcessor,
|
|
279
|
+
bypassMode: mode,
|
|
280
|
+
}
|
|
281
|
+
: { kind: "processor", processor: current.processor, bypassMode: mode };
|
|
282
|
+
this.slots[slot] = next;
|
|
283
|
+
}
|
|
284
|
+
/** Slots where bypass was requested but the packet declares `audio.bypass: "none"` — wired through, flagged. */
|
|
285
|
+
bypassNotModelledSlots() {
|
|
286
|
+
const out = [];
|
|
287
|
+
for (let i = 0; i < this.slots.length; i++) {
|
|
288
|
+
const s = this.slots[i];
|
|
289
|
+
if (s === undefined || s.kind !== "program")
|
|
290
|
+
continue;
|
|
291
|
+
const mode = s.bypassMode ?? "effect";
|
|
292
|
+
if (mode !== "wire" && mode !== "buffer")
|
|
293
|
+
continue;
|
|
294
|
+
if (s.program.bypass.declared === "none")
|
|
295
|
+
out.push(i);
|
|
296
|
+
}
|
|
297
|
+
return out;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Addresses a control by (slot, id). Slot index is the only disambiguator: two identical
|
|
301
|
+
* pedals in the chain declare the same control ids, but each slot owns an independent
|
|
302
|
+
* `ReferenceRuntime` with its own control-position map, so the shared id never collides
|
|
303
|
+
* with the other slot's.
|
|
304
|
+
*/
|
|
305
|
+
setControl(slot, id, position) {
|
|
306
|
+
const engine = this.engines[slot];
|
|
307
|
+
if (engine === undefined) {
|
|
308
|
+
throw new RuntimeError(`chain has no slot ${slot} (chain length is ${this.engines.length})`);
|
|
309
|
+
}
|
|
310
|
+
// A processor has no compiled controls. Its parameters are the host's to set on the object
|
|
311
|
+
// it supplied, which is why refusing here names the slot rather than inventing a no-op: a
|
|
312
|
+
// silently ignored knob is the failure this whole file's telemetry exists to avoid.
|
|
313
|
+
if (!(engine instanceof ReferenceRuntime)) {
|
|
314
|
+
throw new RuntimeError(`slot ${slot} is an injected processor (${slotLabel(this.slots[slot], slot)}) ` +
|
|
315
|
+
`and carries no compiled control "${id}": set it on the processor the host supplied`);
|
|
316
|
+
}
|
|
317
|
+
engine.setControl(id, position);
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Addresses a supply by (slot, addresses), mirroring `setControl`'s routing.
|
|
321
|
+
* Each slot owns an independent `ReferenceRuntime` with its own supply
|
|
322
|
+
* stamps, so the shared `sourceIndex` never collides with another slot's.
|
|
323
|
+
* A processor slot (NAM or IR) is refused by name: it has no compiled
|
|
324
|
+
* `dc-source` stamps, and a silently ignored rail would be the failure this
|
|
325
|
+
* file's telemetry exists to avoid.
|
|
326
|
+
*/
|
|
327
|
+
setSupply(slot, addresses, volts, sourceOhms) {
|
|
328
|
+
const engine = this.engines[slot];
|
|
329
|
+
if (engine === undefined) {
|
|
330
|
+
throw new RuntimeError(`chain has no slot ${slot} (chain length is ${this.engines.length})`);
|
|
331
|
+
}
|
|
332
|
+
if (!(engine instanceof ReferenceRuntime)) {
|
|
333
|
+
throw new RuntimeError(`slot ${slot} is an injected processor (${slotLabel(this.slots[slot], slot)}) ` +
|
|
334
|
+
`and carries no compiled supply: set it on the processor the host supplied`);
|
|
335
|
+
}
|
|
336
|
+
engine.setSupply(addresses, volts, sourceOhms);
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Every slot's own telemetry, labelled by position -- never blended into one set of
|
|
340
|
+
* totals. A chain's `samples`/`heldSamples`/etc. are per-slot facts (a nonlinear block
|
|
341
|
+
* failing to converge in slot 2 says nothing about slot 0), so summing or averaging them
|
|
342
|
+
* would silently under-report whichever slot is actually struggling; see this module's
|
|
343
|
+
* header and `RuntimeTelemetry` in `reference-runtime.ts`.
|
|
344
|
+
*/
|
|
345
|
+
telemetry() {
|
|
346
|
+
// Only the compiled slots have telemetry to give -- `samples`, `heldSamples`, Newton counts
|
|
347
|
+
// are all properties of an MNA solve. A processor slot is absent rather than reported as
|
|
348
|
+
// zeroes, because a zero held-sample count would read as "converged fine" for something that
|
|
349
|
+
// never ran a solve at all.
|
|
350
|
+
return this.engines.flatMap((engine, slot) => engine instanceof ReferenceRuntime
|
|
351
|
+
? [{ ...engine.telemetry(), slot }]
|
|
352
|
+
: []);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
//# sourceMappingURL=chain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../src/chain.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,0FAA0F;AAC1F,4FAA4F;AAC5F,gBAAgB;AAChB,EAAE;AACF,0FAA0F;AAC1F,uFAAuF;AACvF,uFAAuF;AACvF,4FAA4F;AAC5F,4FAA4F;AAC5F,4FAA4F;AAC5F,sFAAsF;AACtF,qEAAqE;AACrE,uFAAuF;AACvF,wCAAwC;AACxC,EAAE;AACF,2FAA2F;AAC3F,4FAA4F;AAC5F,4FAA4F;AAC5F,8EAA8E;AAC9E,+EAA+E;AAC/E,yFAAyF;AACzF,wEAAwE;AACxE,EAAE;AACF,0FAA0F;AAC1F,0FAA0F;AAC1F,2FAA2F;AAC3F,yFAAyF;AACzF,2FAA2F;AAG3F,OAAO,EAAE,gBAAgB,EAAuB,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAIN,YAAY,EACZ,SAAS,GACT,MAAM,cAAc,CAAC;AAEtB,OAAO,EACN,6BAA6B,EAC7B,gBAAgB,EAChB,YAAY,GAEZ,MAAM,qBAAqB,CAAC;AAO7B;;;;;;GAMG;AACH,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB,MAAM,OAAO,YAAY;IACP,KAAK,CAAc;IACnB,SAAS,CAA0B;IACpD,+EAA+E;IAC9D,OAAO,CAAoD;IAC5E,kGA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E,CAAC;QACH,CAAC;QACD,IAAI,CAAC,CAAC,MAAM,YAAY,gBAAgB,CAAC,EAAE,CAAC;YAC3C,MAAM,IAAI,YAAY,CACrB,QAAQ,IAAI,8BAA8B,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAc,EAAE,IAAI,CAAC,IAAI;gBAC3F,2EAA2E,CAC5E,CAAC;QACH,CAAC;QACD,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;IAChD,CAAC;IAED;;;;;;OAMG;IACH,SAAS;QACR,4FAA4F;QAC5F,yFAAyF;QACzF,6FAA6F;QAC7F,4BAA4B;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAC5C,MAAM,YAAY,gBAAgB;YACjC,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC;YACnC,CAAC,CAAC,EAAE,CACL,CAAC;IACH,CAAC;CACD"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { ChainRuntime } from "./chain";
|
|
2
|
+
export { bypassNotModelledAdvisories, chainAdvisories, seamScale, type ChainAdvisory, } from "./chain-advisories";
|
|
3
|
+
export { dacScaleFactor, outputConversionFullScale, outputDbfs } from "./chain-scale";
|
|
4
|
+
export { processorSlot, programSlot, resolveBypassMode, slotContract, type ChainSlot, type ExternalProcessor, type SlotContract, type StageCoverage, } from "./chain-slot";
|
|
5
|
+
export { DEFAULT_NEWTON_MAX_ITERATIONS, ReferenceRuntime, RuntimeError, type RuntimeNodeVoltageSnapshot, } from "./reference-runtime";
|
|
6
|
+
export type { SupplyAddress, SupplyInfo } from "./supply";
|
|
7
|
+
export { SETTLE_DEFAULTS, measureInputAttributable, measureSharedWindow, settledRender, settledSweepVerified, type SettleOptions, } from "./settle";
|
|
8
|
+
export { supplyGroundConflicts, type SupplyGroundConflict } from "./supply-ground";
|
|
9
|
+
export { taperFraction } from "./taper";
|
|
10
|
+
export { V2WasmEngine } from "./v2-wasm-engine";
|
|
11
|
+
export * from "./calibrate";
|
|
12
|
+
export { admissionVerdict, predictedWorstCaseNs } from "./admission";
|
|
13
|
+
export type { AdmissionVerdict, RealtimeBudget } from "./admission";
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EACN,2BAA2B,EAC3B,eAAe,EACf,SAAS,EACT,KAAK,aAAa,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACtF,OAAO,EACN,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,aAAa,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,6BAA6B,EAC7B,gBAAgB,EAChB,YAAY,EACZ,KAAK,0BAA0B,GAC/B,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EACN,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,KAAK,aAAa,GAClB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACrE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Public surface of the v2 runtime: a compiled Program to audio.
|
|
2
|
+
//
|
|
3
|
+
// The runtime is a generic console and a compiled pedal is a ROM; the only thing it
|
|
4
|
+
// shares with the compiler is the Program contract, imported as types. Everything the
|
|
5
|
+
// browser surface and the report scripts use is exported here, and nothing outside
|
|
6
|
+
// `src/runtime/` reaches a console file directly.
|
|
7
|
+
export { ChainRuntime } from "./chain.js";
|
|
8
|
+
export { bypassNotModelledAdvisories, chainAdvisories, seamScale, } from "./chain-advisories.js";
|
|
9
|
+
export { dacScaleFactor, outputConversionFullScale, outputDbfs } from "./chain-scale.js";
|
|
10
|
+
export { processorSlot, programSlot, resolveBypassMode, slotContract, } from "./chain-slot.js";
|
|
11
|
+
export { DEFAULT_NEWTON_MAX_ITERATIONS, ReferenceRuntime, RuntimeError, } from "./reference-runtime.js";
|
|
12
|
+
export { SETTLE_DEFAULTS, measureInputAttributable, measureSharedWindow, settledRender, settledSweepVerified, } from "./settle.js";
|
|
13
|
+
export { supplyGroundConflicts } from "./supply-ground.js";
|
|
14
|
+
export { taperFraction } from "./taper.js";
|
|
15
|
+
export { V2WasmEngine } from "./v2-wasm-engine.js";
|
|
16
|
+
export * from "./calibrate.js";
|
|
17
|
+
export { admissionVerdict, predictedWorstCaseNs } from "./admission.js";
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,oFAAoF;AACpF,sFAAsF;AACtF,mFAAmF;AACnF,kDAAkD;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EACN,2BAA2B,EAC3B,eAAe,EACf,SAAS,GAET,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACtF,OAAO,EACN,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,YAAY,GAKZ,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,6BAA6B,EAC7B,gBAAgB,EAChB,YAAY,GAEZ,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EACnB,aAAa,EACb,oBAAoB,GAEpB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,qBAAqB,EAA6B,MAAM,iBAAiB,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC"}
|