@hyperframes/core 0.7.107 → 0.7.109
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/dist/audio/audioFxAutomation.d.ts +63 -0
- package/dist/audio/audioFxAutomation.d.ts.map +1 -0
- package/dist/audio/audioFxAutomation.js +219 -0
- package/dist/audio/audioFxAutomation.js.map +1 -0
- package/dist/audio/audioFxGraph.d.ts +73 -0
- package/dist/audio/audioFxGraph.d.ts.map +1 -0
- package/dist/audio/audioFxGraph.js +649 -0
- package/dist/audio/audioFxGraph.js.map +1 -0
- package/dist/audio/audioFxTail.d.ts +28 -0
- package/dist/audio/audioFxTail.d.ts.map +1 -0
- package/dist/audio/audioFxTail.js +95 -0
- package/dist/audio/audioFxTail.js.map +1 -0
- package/dist/audio/audioFxWorklets.d.ts +8 -0
- package/dist/audio/audioFxWorklets.d.ts.map +1 -0
- package/dist/audio/audioFxWorklets.js +263 -0
- package/dist/audio/audioFxWorklets.js.map +1 -0
- package/dist/audioAutomation.d.ts +191 -0
- package/dist/audioAutomation.d.ts.map +1 -0
- package/dist/audioAutomation.js +488 -0
- package/dist/audioAutomation.js.map +1 -0
- package/dist/audioCarve.d.ts +216 -0
- package/dist/audioCarve.d.ts.map +1 -0
- package/dist/audioCarve.js +608 -0
- package/dist/audioCarve.js.map +1 -0
- package/dist/audioFx.d.ts +182 -0
- package/dist/audioFx.d.ts.map +1 -0
- package/dist/audioFx.js +813 -0
- package/dist/audioFx.js.map +1 -0
- package/dist/audioFxCopy.d.ts +89 -0
- package/dist/audioFxCopy.d.ts.map +1 -0
- package/dist/audioFxCopy.js +340 -0
- package/dist/audioFxCopy.js.map +1 -0
- package/dist/audioFxEq.d.ts +75 -0
- package/dist/audioFxEq.d.ts.map +1 -0
- package/dist/audioFxEq.js +153 -0
- package/dist/audioFxEq.js.map +1 -0
- package/dist/audioFxJobs.d.ts +52 -0
- package/dist/audioFxJobs.d.ts.map +1 -0
- package/dist/audioFxJobs.js +92 -0
- package/dist/audioFxJobs.js.map +1 -0
- package/dist/audioFxPresets.d.ts +91 -0
- package/dist/audioFxPresets.d.ts.map +1 -0
- package/dist/audioFxPresets.js +320 -0
- package/dist/audioFxPresets.js.map +1 -0
- package/dist/audioFxProfiles.d.ts +65 -0
- package/dist/audioFxProfiles.d.ts.map +1 -0
- package/dist/audioFxProfiles.js +209 -0
- package/dist/audioFxProfiles.js.map +1 -0
- package/dist/audioLeveller.d.ts +62 -0
- package/dist/audioLeveller.d.ts.map +1 -0
- package/dist/audioLeveller.js +208 -0
- package/dist/audioLeveller.js.map +1 -0
- package/dist/canaryRegistry.d.ts.map +1 -1
- package/dist/canaryRegistry.js +8 -0
- package/dist/canaryRegistry.js.map +1 -1
- package/dist/compiler/compositionScoping.d.ts +3 -0
- package/dist/compiler/compositionScoping.d.ts.map +1 -1
- package/dist/compiler/compositionScoping.js +34 -11
- package/dist/compiler/compositionScoping.js.map +1 -1
- package/dist/compiler/htmlBundler.d.ts.map +1 -1
- package/dist/compiler/htmlBundler.js +42 -2
- package/dist/compiler/htmlBundler.js.map +1 -1
- package/dist/editing/affordances.d.ts +3 -0
- package/dist/editing/affordances.d.ts.map +1 -1
- package/dist/editing/affordances.js +1 -0
- package/dist/editing/affordances.js.map +1 -1
- package/dist/generated/audio-fx-runtime-inline.d.ts +3 -0
- package/dist/generated/audio-fx-runtime-inline.d.ts.map +1 -0
- package/dist/generated/audio-fx-runtime-inline.js +7 -0
- package/dist/generated/audio-fx-runtime-inline.js.map +1 -0
- package/dist/generated/runtime-inline.js +1 -1
- package/dist/generated/runtime-inline.js.map +1 -1
- package/dist/hyperframe.runtime.iife.js +238 -28
- package/dist/runtime/applyVariableBindings.d.ts +45 -0
- package/dist/runtime/applyVariableBindings.d.ts.map +1 -0
- package/dist/runtime/applyVariableBindings.js +194 -0
- package/dist/runtime/applyVariableBindings.js.map +1 -0
- package/dist/runtime/audioAutomationVolume.d.ts +17 -0
- package/dist/runtime/audioAutomationVolume.d.ts.map +1 -0
- package/dist/runtime/audioAutomationVolume.js +49 -0
- package/dist/runtime/audioAutomationVolume.js.map +1 -0
- package/dist/runtime/media.d.ts.map +1 -1
- package/dist/runtime/media.js +17 -1
- package/dist/runtime/media.js.map +1 -1
- package/dist/runtime/variableScope.d.ts +9 -0
- package/dist/runtime/variableScope.d.ts.map +1 -0
- package/dist/runtime/variableScope.js +21 -0
- package/dist/runtime/variableScope.js.map +1 -0
- package/package.json +51 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audioFxGraph.js","sourceRoot":"","sources":["../../src/audio/audioFxGraph.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,sBAAsB,GAIvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACrC,UAAkB,EAClB,IAAY,EACZ,OAAe;IAEf,MAAM,OAAO,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC;IAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC;IAC7D,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;IACrC,oEAAoE;IACpE,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IAC7F,MAAM,IAAI,GAAG,GAAW,EAAE;QACxB,IAAI,GAAG,CAAC,IAAI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K,GAAG,GAAG,CAAC,MAAM,CAAC;gBACjC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;YACvC,CAAC;YACD,wEAAwE;YACxE,yEAAyE;YACzE,0EAA0E;YAC1E,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO;YACL,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,OAAO;gBAAE,MAAM,CAAC,OAAO,EAAE,CAAC;YACnD,yEAAyE;YACzE,qEAAqE;YACrE,4DAA4D;YAC5D,KAAK,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,OAAO,EAAE,CAAC;gBAChD,KAAK,CAAC,UAAU,EAAE,CAAC;gBACnB,GAAG,CAAC,UAAU,EAAE,CAAC;gBACjB,GAAG,CAAC,UAAU,EAAE,CAAC;gBACjB,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,CAAC;YACD,KAAK,CAAC,UAAU,EAAE,CAAC;YACnB,MAAM,CAAC,UAAU,EAAE,CAAC;QACtB,CAAC;KACF,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How long a chain keeps ringing after its input stops.
|
|
3
|
+
*
|
|
4
|
+
* The render used to end the offline context at the last input sample, so a
|
|
5
|
+
* reverb or a delay was cut mid-tail — the one place the render did not match
|
|
6
|
+
* preview. The length is not a guess: every tail-producing effect here has a
|
|
7
|
+
* decay that follows from its own settings, so the render can ask for exactly
|
|
8
|
+
* the room it needs.
|
|
9
|
+
*/
|
|
10
|
+
import { type HfAutomation } from "../audioAutomation.js";
|
|
11
|
+
import { type HfAudioFxChain } from "../audioFx.js";
|
|
12
|
+
/**
|
|
13
|
+
* Ceiling on the extension, in seconds.
|
|
14
|
+
*
|
|
15
|
+
* Delay is unbounded in principle: 5 s between repeats at 0.95 feedback decays
|
|
16
|
+
* for eleven minutes, and the panel can dial exactly that. A tail that outruns
|
|
17
|
+
* the composition costs render time and mixes into everything after it, so the
|
|
18
|
+
* chain gets the room it asks for up to here and is cut beyond it.
|
|
19
|
+
*/
|
|
20
|
+
export declare const MAX_FX_TAIL_SECONDS = 5;
|
|
21
|
+
/**
|
|
22
|
+
* The whole chain's tail, in seconds.
|
|
23
|
+
*
|
|
24
|
+
* Summed, not maxed: the chain is serial, so a delay in front of a reverb hands
|
|
25
|
+
* each of its repeats to the room and the last one still gets a full tail.
|
|
26
|
+
*/
|
|
27
|
+
export declare function chainTailSeconds(chain: HfAudioFxChain, automation?: HfAutomation): number;
|
|
28
|
+
//# sourceMappingURL=audioFxTail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audioFxTail.d.ts","sourceRoot":"","sources":["../../src/audio/audioFxTail.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAA0B,KAAK,cAAc,EAAsB,MAAM,eAAe,CAAC;AAEhG;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAiErC;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,YAAY,GAAG,MAAM,CAGzF"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How long a chain keeps ringing after its input stops.
|
|
3
|
+
*
|
|
4
|
+
* The render used to end the offline context at the last input sample, so a
|
|
5
|
+
* reverb or a delay was cut mid-tail — the one place the render did not match
|
|
6
|
+
* preview. The length is not a guess: every tail-producing effect here has a
|
|
7
|
+
* decay that follows from its own settings, so the render can ask for exactly
|
|
8
|
+
* the room it needs.
|
|
9
|
+
*/
|
|
10
|
+
import { fxAutomationTarget } from "../audioAutomation.js";
|
|
11
|
+
import { normalizeAudioFxParams } from "../audioFx.js";
|
|
12
|
+
/**
|
|
13
|
+
* Ceiling on the extension, in seconds.
|
|
14
|
+
*
|
|
15
|
+
* Delay is unbounded in principle: 5 s between repeats at 0.95 feedback decays
|
|
16
|
+
* for eleven minutes, and the panel can dial exactly that. A tail that outruns
|
|
17
|
+
* the composition costs render time and mixes into everything after it, so the
|
|
18
|
+
* chain gets the room it asks for up to here and is cut beyond it.
|
|
19
|
+
*/
|
|
20
|
+
export const MAX_FX_TAIL_SECONDS = 5;
|
|
21
|
+
/**
|
|
22
|
+
* Where a tail stops counting as audible: -60 dB below the signal that fed it,
|
|
23
|
+
* the usual convention for a reverb time. Anything quieter is under the noise
|
|
24
|
+
* floor of every codec this renders to.
|
|
25
|
+
*/
|
|
26
|
+
const TAIL_FLOOR = 0.001;
|
|
27
|
+
/**
|
|
28
|
+
* The largest value a knob reaches, over the whole clip.
|
|
29
|
+
*
|
|
30
|
+
* A lane's `curve` is an exponent, so a segment is monotone between its two
|
|
31
|
+
* points and cannot overshoot either — the maximum point value is the maximum
|
|
32
|
+
* of the lane, no sampling needed. Room size has to be sized for the loudest
|
|
33
|
+
* moment regardless of where in the clip it falls.
|
|
34
|
+
*/
|
|
35
|
+
function knobMax(node, key, automation) {
|
|
36
|
+
// Normalised, so a knob missing from the attribute reads as its default and
|
|
37
|
+
// an out-of-range one is clamped the way the graph builder would clamp it.
|
|
38
|
+
const fallback = Number(normalizeAudioFxParams(node.type, node.params)[key] ?? 0);
|
|
39
|
+
if (!node.id || !automation)
|
|
40
|
+
return Number.isFinite(fallback) ? fallback : 0;
|
|
41
|
+
const lane = automation.lanes.find((l) => l.target === fxAutomationTarget(node.id ?? "", key));
|
|
42
|
+
if (!lane || lane.points.length === 0)
|
|
43
|
+
return Number.isFinite(fallback) ? fallback : 0;
|
|
44
|
+
return lane.points.reduce((max, p) => Math.max(max, p.v), -Infinity);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Repeats until a feedback loop falls under the floor, times the gap between
|
|
48
|
+
* them. `feedback` is capped below 1 by the registry, so this terminates.
|
|
49
|
+
*/
|
|
50
|
+
function delayTail(time, feedback) {
|
|
51
|
+
const gap = Math.min(5, time / 1000);
|
|
52
|
+
if (gap <= 0)
|
|
53
|
+
return 0;
|
|
54
|
+
const fb = Math.max(0, Math.min(0.999, feedback));
|
|
55
|
+
if (fb <= 0)
|
|
56
|
+
return gap;
|
|
57
|
+
return Math.ceil(Math.log(TAIL_FLOOR) / Math.log(fb)) * gap;
|
|
58
|
+
}
|
|
59
|
+
/** One node's tail. Zero when it has none, or when it is mixed out entirely. */
|
|
60
|
+
function nodeTail(node, automation) {
|
|
61
|
+
if (node.enabled === false)
|
|
62
|
+
return 0;
|
|
63
|
+
switch (node.type) {
|
|
64
|
+
case "reverb":
|
|
65
|
+
// Exactly the generated impulse's length — see synthesizeReverbImpulse,
|
|
66
|
+
// which is the same expression. A convolution is as long as its impulse.
|
|
67
|
+
return knobMax(node, "wet", automation) > 0
|
|
68
|
+
? 0.6 + Math.max(0, Math.min(1, knobMax(node, "size", automation))) * 2.6
|
|
69
|
+
: 0;
|
|
70
|
+
case "delay":
|
|
71
|
+
return knobMax(node, "mix", automation) > 0
|
|
72
|
+
? delayTail(knobMax(node, "time", automation), knobMax(node, "feedback", automation))
|
|
73
|
+
: 0;
|
|
74
|
+
case "chorus":
|
|
75
|
+
// A single delay line, no feedback: it rings for one delay (≤100 ms).
|
|
76
|
+
return knobMax(node, "mix", automation) > 0 ? knobMax(node, "delay", automation) / 1000 : 0;
|
|
77
|
+
default:
|
|
78
|
+
// Everything else settles with its input. The phaser is an all-pass chain
|
|
79
|
+
// with no recirculation (group delay, not a tail); the dynamics nodes have
|
|
80
|
+
// long releases but no signal to release — silence in, silence out; a
|
|
81
|
+
// biquad rings for ~Q/f, which is microseconds.
|
|
82
|
+
return 0;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The whole chain's tail, in seconds.
|
|
87
|
+
*
|
|
88
|
+
* Summed, not maxed: the chain is serial, so a delay in front of a reverb hands
|
|
89
|
+
* each of its repeats to the room and the last one still gets a full tail.
|
|
90
|
+
*/
|
|
91
|
+
export function chainTailSeconds(chain, automation) {
|
|
92
|
+
const total = chain.nodes.reduce((sum, node) => sum + nodeTail(node, automation), 0);
|
|
93
|
+
return Math.min(MAX_FX_TAIL_SECONDS, total);
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=audioFxTail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audioFxTail.js","sourceRoot":"","sources":["../../src/audio/audioFxTail.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,kBAAkB,EAAqB,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAA2C,MAAM,eAAe,CAAC;AAEhG;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAErC;;;;GAIG;AACH,MAAM,UAAU,GAAG,KAAK,CAAC;AAEzB;;;;;;;GAOG;AACH,SAAS,OAAO,CAAC,IAAmB,EAAE,GAAW,EAAE,UAAyB;IAC1E,4EAA4E;IAC5E,2EAA2E;IAC3E,MAAM,QAAQ,GAAG,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAClF,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,UAAU;QAAE,OAAO,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,kBAAkB,CAAC,IAAI,CAAC,EAAE,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gBACzC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,GAAG;gBACzE,CAAC,CAAC,CAAC,CAAC;QACR,KAAK,OAAO;YACV,OAAO,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC;gBACzC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;gBACrF,CAAC,CAAC,CAAC,CAAC;QACR,KAAK,QAAQ;YACX,sEAAsE;YACtE,OAAO,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9F;YACE,0EAA0E;YAC1E,2EAA2E;YAC3E,sEAAsE;YACtE,gDAAgD;YAChD,OAAO,CAAC,CAAC;IACb,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAqB,EAAE,UAAyB;IAC/E,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;IACrF,OAAO,IAAI,CAAC,GAAG,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** True once the processors are usable on this context. */
|
|
2
|
+
export declare function audioFxWorkletsReady(ctx: BaseAudioContext): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Register the processors on a context. Idempotent per context, since
|
|
5
|
+
* addModule throws if the same processor name is registered twice.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ensureAudioFxWorklets(ctx: BaseAudioContext): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=audioFxWorklets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audioFxWorklets.d.ts","sourceRoot":"","sources":["../../src/audio/audioFxWorklets.ts"],"names":[],"mappings":"AAoOA,2DAA2D;AAC3D,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAEnE;AAGD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8B1E"}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AudioWorklet processors for the effects Web Audio has no native node for.
|
|
3
|
+
*
|
|
4
|
+
* Each one targets the behaviour of its FFmpeg counterpart rather than of any
|
|
5
|
+
* particular plugin, because the render is FFmpeg and preview only earns its
|
|
6
|
+
* keep by predicting the render. How closely each lands is measured, not
|
|
7
|
+
* assumed — see the preview/render parity harness.
|
|
8
|
+
*
|
|
9
|
+
* Kept as a source string so it can be registered from a Blob URL without a
|
|
10
|
+
* separate bundled asset, which keeps the studio's build unchanged.
|
|
11
|
+
*/
|
|
12
|
+
const AUDIO_FX_WORKLET_SOURCE = `
|
|
13
|
+
const dbToLin = (db) => Math.pow(10, db / 20);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* One-pole envelope followers, one per channel.
|
|
17
|
+
*
|
|
18
|
+
* Per channel matters: the followers advance once per sample, so a single shared
|
|
19
|
+
* follower stepped once per channel per sample. On stereo that ran a 20 ms attack
|
|
20
|
+
* as 10 ms, and gave the right channel a gain computed from an envelope that had
|
|
21
|
+
* already traversed the left — so the two channels ducked by different amounts
|
|
22
|
+
* from the same input and the image pumped.
|
|
23
|
+
*/
|
|
24
|
+
class EnvBank {
|
|
25
|
+
constructor(attackMs, releaseMs) { this.set(attackMs, releaseMs); this.values = []; }
|
|
26
|
+
set(attackMs, releaseMs) {
|
|
27
|
+
this.a = Math.exp(-1 / (sampleRate * Math.max(1e-5, attackMs / 1000)));
|
|
28
|
+
this.r = Math.exp(-1 / (sampleRate * Math.max(1e-5, releaseMs / 1000)));
|
|
29
|
+
}
|
|
30
|
+
push(ch, x) {
|
|
31
|
+
const prev = this.values[ch] ?? 0;
|
|
32
|
+
const m = Math.abs(x);
|
|
33
|
+
const c = m > prev ? this.a : this.r;
|
|
34
|
+
const next = m + c * (prev - m);
|
|
35
|
+
this.values[ch] = next;
|
|
36
|
+
return next;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Soft-knee gain computer in dB, matching acompressor's shape. */
|
|
41
|
+
function kneeGain(envDb, thresholdDb, ratio, kneeDb) {
|
|
42
|
+
const over = envDb - thresholdDb;
|
|
43
|
+
if (kneeDb > 0 && over > -kneeDb && over < kneeDb) {
|
|
44
|
+
const t = (over + kneeDb) / (2 * kneeDb);
|
|
45
|
+
return -((1 - 1 / ratio) * kneeDb * t * t);
|
|
46
|
+
}
|
|
47
|
+
return over > 0 ? -(over * (1 - 1 / ratio)) : 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// log10/exp per sample is the single most expensive thing a dynamics processor
|
|
51
|
+
// can do on the audio thread, and every sample below the knee needs neither:
|
|
52
|
+
// its gain is exactly unity. Comparing envelopes in the linear domain lets the
|
|
53
|
+
// quiet majority of samples skip the transcendentals entirely.
|
|
54
|
+
const LN10_OVER_20 = Math.LN10 / 20;
|
|
55
|
+
const dbToLinFast = (db) => Math.exp(db * LN10_OVER_20);
|
|
56
|
+
|
|
57
|
+
class HfCompressor extends AudioWorkletProcessor {
|
|
58
|
+
constructor(o) {
|
|
59
|
+
super();
|
|
60
|
+
this.p = o.processorOptions || {};
|
|
61
|
+
this.env = new EnvBank(this.p.attack ?? 20, this.p.release ?? 250);
|
|
62
|
+
this.port.onmessage = (e) => {
|
|
63
|
+
if (e.data && e.data.__hfDispose) { this.dead = true; return; }
|
|
64
|
+
this.p = { ...this.p, ...e.data };
|
|
65
|
+
this.env.set(this.p.attack ?? 20, this.p.release ?? 250);
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
process(inputs, outputs) {
|
|
69
|
+
if (this.dead) return false;
|
|
70
|
+
const i = inputs[0], o = outputs[0];
|
|
71
|
+
if (!i || !i.length) return true;
|
|
72
|
+
const p = this.p;
|
|
73
|
+
const makeup = dbToLin(p.makeup ?? 0);
|
|
74
|
+
const mix = p.mix ?? 1;
|
|
75
|
+
// Knee is expressed as a ratio in FFmpeg; convert to dB width.
|
|
76
|
+
const kneeDb = 20 * Math.log10(Math.max(1.0001, p.knee ?? 2.83));
|
|
77
|
+
const thresholdDb = p.threshold ?? -24;
|
|
78
|
+
const ratio = p.ratio ?? 4;
|
|
79
|
+
// Below this the gain computer returns unity, so the sample needs no
|
|
80
|
+
// logarithm at all.
|
|
81
|
+
const kneeStartLin = dbToLin(thresholdDb - kneeDb);
|
|
82
|
+
const dry = 1 - mix;
|
|
83
|
+
for (let ch = 0; ch < i.length; ch++) {
|
|
84
|
+
const inp = i[ch], out = o[ch];
|
|
85
|
+
for (let n = 0; n < inp.length; n++) {
|
|
86
|
+
const x = inp[n];
|
|
87
|
+
// Per-channel follower, and the sub-knee shortcut: below the knee the
|
|
88
|
+
// gain is exactly unity, so the sample needs no logarithm at all.
|
|
89
|
+
const env = this.env.push(ch, x);
|
|
90
|
+
if (env <= kneeStartLin) {
|
|
91
|
+
out[n] = x * makeup * mix + x * dry;
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
const envDb = 20 * Math.log10(env);
|
|
95
|
+
const g = dbToLinFast(kneeGain(envDb, thresholdDb, ratio, kneeDb));
|
|
96
|
+
out[n] = x * g * makeup * mix + x * dry;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
registerProcessor("hf-compressor", HfCompressor);
|
|
103
|
+
|
|
104
|
+
class HfLimiter extends AudioWorkletProcessor {
|
|
105
|
+
constructor(o) {
|
|
106
|
+
super();
|
|
107
|
+
this.p = o.processorOptions || {};
|
|
108
|
+
this.env = new EnvBank(this.p.attack ?? 5, this.p.release ?? 50);
|
|
109
|
+
this.port.onmessage = (e) => {
|
|
110
|
+
if (e.data && e.data.__hfDispose) { this.dead = true; return; }
|
|
111
|
+
this.p = { ...this.p, ...e.data };
|
|
112
|
+
this.env.set(this.p.attack ?? 5, this.p.release ?? 50);
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
process(inputs, outputs) {
|
|
116
|
+
if (this.dead) return false;
|
|
117
|
+
const i = inputs[0], o = outputs[0];
|
|
118
|
+
if (!i || !i.length) return true;
|
|
119
|
+
const ceiling = dbToLin(this.p.limit ?? -1);
|
|
120
|
+
const outGain = dbToLin(this.p.level_out ?? 0);
|
|
121
|
+
for (let ch = 0; ch < i.length; ch++) {
|
|
122
|
+
const inp = i[ch], out = o[ch];
|
|
123
|
+
for (let n = 0; n < inp.length; n++) {
|
|
124
|
+
const x = inp[n];
|
|
125
|
+
const env = this.env.push(ch, x);
|
|
126
|
+
// Only ever attenuate: a limiter that can raise level is a compressor.
|
|
127
|
+
const g = env > ceiling ? ceiling / env : 1;
|
|
128
|
+
out[n] = x * g * outGain;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
registerProcessor("hf-limiter", HfLimiter);
|
|
135
|
+
|
|
136
|
+
class HfGate extends AudioWorkletProcessor {
|
|
137
|
+
constructor(o) {
|
|
138
|
+
super();
|
|
139
|
+
this.p = o.processorOptions || {};
|
|
140
|
+
this.env = new EnvBank(this.p.attack ?? 1, this.p.release ?? 100);
|
|
141
|
+
this.gains = [];
|
|
142
|
+
this.port.onmessage = (e) => {
|
|
143
|
+
if (e.data && e.data.__hfDispose) { this.dead = true; return; }
|
|
144
|
+
this.p = { ...this.p, ...e.data };
|
|
145
|
+
this.env.set(this.p.attack ?? 1, this.p.release ?? 100);
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
process(inputs, outputs) {
|
|
149
|
+
if (this.dead) return false;
|
|
150
|
+
const i = inputs[0], o = outputs[0];
|
|
151
|
+
if (!i || !i.length) return true;
|
|
152
|
+
const p = this.p;
|
|
153
|
+
const threshold = dbToLin(p.threshold ?? -35);
|
|
154
|
+
const floor = dbToLin(p.range ?? -24);
|
|
155
|
+
const ratio = p.ratio ?? 10;
|
|
156
|
+
// Knee is declared in the registry as a ratio, like the compressor's; a
|
|
157
|
+
// hard threshold ignored it and chattered on material sitting right at the
|
|
158
|
+
// gate point.
|
|
159
|
+
const kneeDb = 20 * Math.log10(Math.max(1.0001, p.knee ?? 2.83));
|
|
160
|
+
const kneeLin = dbToLin((p.threshold ?? -35) + kneeDb);
|
|
161
|
+
for (let ch = 0; ch < i.length; ch++) {
|
|
162
|
+
const inp = i[ch], out = o[ch];
|
|
163
|
+
for (let n = 0; n < inp.length; n++) {
|
|
164
|
+
const x = inp[n];
|
|
165
|
+
const env = this.env.push(ch, x);
|
|
166
|
+
let target = 1;
|
|
167
|
+
// Above the threshold the gate is fully open; skip the pow entirely.
|
|
168
|
+
if (env < threshold) {
|
|
169
|
+
const under = env > 1e-9 ? threshold / env : 1e9;
|
|
170
|
+
target = Math.max(floor, 1 / Math.pow(under, ratio - 1));
|
|
171
|
+
if (!isFinite(target)) target = floor;
|
|
172
|
+
}
|
|
173
|
+
// Smooth toward the target so the gate does not click on every sample.
|
|
174
|
+
const held = this.gains[ch] ?? 1;
|
|
175
|
+
const c = target < held ? this.env.r : this.env.a;
|
|
176
|
+
const smoothed = target + c * (held - target);
|
|
177
|
+
this.gains[ch] = smoothed;
|
|
178
|
+
out[n] = x * smoothed;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return true;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
registerProcessor("hf-gate", HfGate);
|
|
185
|
+
|
|
186
|
+
class HfBitcrush extends AudioWorkletProcessor {
|
|
187
|
+
constructor(o) {
|
|
188
|
+
super();
|
|
189
|
+
this.p = o.processorOptions || {};
|
|
190
|
+
this.holds = [];
|
|
191
|
+
this.held = [];
|
|
192
|
+
this.port.onmessage = (e) => {
|
|
193
|
+
if (e.data && e.data.__hfDispose) { this.dead = true; return; }
|
|
194
|
+
this.p = { ...this.p, ...e.data };
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
process(inputs, outputs) {
|
|
198
|
+
if (this.dead) return false;
|
|
199
|
+
const i = inputs[0], o = outputs[0];
|
|
200
|
+
if (!i || !i.length) return true;
|
|
201
|
+
const p = this.p;
|
|
202
|
+
const levels = Math.pow(2, (p.bits ?? 8) - 1);
|
|
203
|
+
const step = Math.max(1, Math.round(p.samples ?? 1));
|
|
204
|
+
const mix = p.mix ?? 1;
|
|
205
|
+
for (let ch = 0; ch < i.length; ch++) {
|
|
206
|
+
const inp = i[ch], out = o[ch];
|
|
207
|
+
if (this.held[ch] === undefined) this.held[ch] = 0;
|
|
208
|
+
if (this.holds[ch] === undefined) this.holds[ch] = 0;
|
|
209
|
+
for (let n = 0; n < inp.length; n++) {
|
|
210
|
+
// Per channel: advancing one shared counter only on the last channel
|
|
211
|
+
// left every earlier channel either unheld or frozen for a whole
|
|
212
|
+
// 128-sample quantum, clicking once a block.
|
|
213
|
+
if (this.holds[ch] === 0) this.held[ch] = Math.round(inp[n] * levels) / levels;
|
|
214
|
+
out[n] = this.held[ch] * mix + inp[n] * (1 - mix);
|
|
215
|
+
this.holds[ch] = (this.holds[ch] + 1) % step;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return true;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
registerProcessor("hf-bitcrush", HfBitcrush);
|
|
222
|
+
`;
|
|
223
|
+
// Registration is per context, not per module: a processor registered on one
|
|
224
|
+
// AudioContext does not exist on another, so caching a single promise made
|
|
225
|
+
// every context after the first believe it was ready when it was not.
|
|
226
|
+
const registered = new WeakMap();
|
|
227
|
+
/** True once the processors are usable on this context. */
|
|
228
|
+
export function audioFxWorkletsReady(ctx) {
|
|
229
|
+
return readyContexts.has(ctx);
|
|
230
|
+
}
|
|
231
|
+
const readyContexts = new WeakSet();
|
|
232
|
+
/**
|
|
233
|
+
* Register the processors on a context. Idempotent per context, since
|
|
234
|
+
* addModule throws if the same processor name is registered twice.
|
|
235
|
+
*/
|
|
236
|
+
export function ensureAudioFxWorklets(ctx) {
|
|
237
|
+
let modulePromise = registered.get(ctx);
|
|
238
|
+
if (!modulePromise) {
|
|
239
|
+
modulePromise = (async () => {
|
|
240
|
+
if (!ctx.audioWorklet) {
|
|
241
|
+
throw new Error("AudioWorklet is unavailable — the page needs a secure context (https, localhost or file://)");
|
|
242
|
+
}
|
|
243
|
+
// A data: URL rather than a blob:, because a blob inherits the page origin
|
|
244
|
+
// and is treated as opaque on a file:// page, where the module then fails
|
|
245
|
+
// to load with an unhelpful AbortError.
|
|
246
|
+
const url = `data:text/javascript;base64,${btoa(String.fromCharCode(...new TextEncoder().encode(AUDIO_FX_WORKLET_SOURCE)))}`;
|
|
247
|
+
await ctx.audioWorklet.addModule(url);
|
|
248
|
+
readyContexts.add(ctx);
|
|
249
|
+
})().catch((err) => {
|
|
250
|
+
// A failed registration must not be remembered. `readyContexts` is only
|
|
251
|
+
// written on success, so callers correctly keep asking — and every ask
|
|
252
|
+
// replayed this same rejected promise, leaving the limiter, compressor,
|
|
253
|
+
// gate and bitcrush silent for the life of the context with no way back.
|
|
254
|
+
// One transient failure (a slow module load, a context still warming up)
|
|
255
|
+
// permanently disabled half the rack.
|
|
256
|
+
registered.delete(ctx);
|
|
257
|
+
throw err;
|
|
258
|
+
});
|
|
259
|
+
registered.set(ctx, modulePromise);
|
|
260
|
+
}
|
|
261
|
+
return modulePromise;
|
|
262
|
+
}
|
|
263
|
+
//# sourceMappingURL=audioFxWorklets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audioFxWorklets.js","sourceRoot":"","sources":["../../src/audio/audioFxWorklets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkN/B,CAAC;AAEF,6EAA6E;AAC7E,2EAA2E;AAC3E,sEAAsE;AACtE,MAAM,UAAU,GAAG,IAAI,OAAO,EAAmC,CAAC;AAElE,2DAA2D;AAC3D,MAAM,UAAU,oBAAoB,CAAC,GAAqB;IACxD,OAAO,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC;AACD,MAAM,aAAa,GAAG,IAAI,OAAO,EAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAqB;IACzD,IAAI,aAAa,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxC,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,aAAa,GAAG,CAAC,KAAK,IAAI,EAAE;YAC1B,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;gBACtB,MAAM,IAAI,KAAK,CACb,6FAA6F,CAC9F,CAAC;YACJ,CAAC;YACD,2EAA2E;YAC3E,0EAA0E;YAC1E,wCAAwC;YACxC,MAAM,GAAG,GAAG,+BAA+B,IAAI,CAC7C,MAAM,CAAC,YAAY,CAAC,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAC1E,EAAE,CAAC;YACJ,MAAM,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;YACtC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACzB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;YAC1B,wEAAwE;YACxE,uEAAuE;YACvE,wEAAwE;YACxE,yEAAyE;YACzE,yEAAyE;YACzE,sCAAsC;YACtC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACvB,MAAM,GAAG,CAAC;QACZ,CAAC,CAAC,CAAC;QACH,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Automation envelopes for audio tracks.
|
|
3
|
+
*
|
|
4
|
+
* A lane is a list of breakpoints over one parameter — track volume, or one
|
|
5
|
+
* knob of one effect in the track's FX chain. Ableton's clip-envelope model:
|
|
6
|
+
* times are clip-local, so an envelope travels with the clip when it moves.
|
|
7
|
+
*
|
|
8
|
+
* Nothing here touches Web Audio. This module owns the format and the
|
|
9
|
+
* interpolation, and the same `sampleAutomationLane` is used to draw the lane
|
|
10
|
+
* in the timeline, to schedule it in preview, and to bake it at render — one
|
|
11
|
+
* curve, three consumers, or the picture and the sound disagree.
|
|
12
|
+
*/
|
|
13
|
+
import { type HfAudioFxChain } from "./audioFx.js";
|
|
14
|
+
export declare const HF_AUDIO_AUTOMATION_ATTR = "data-automation";
|
|
15
|
+
/** The same attribute as a `dataset` / `dataAttributes` key. See `HF_AUDIO_FX_DATA_KEY`. */
|
|
16
|
+
export declare const HF_AUDIO_AUTOMATION_DATA_KEY: string;
|
|
17
|
+
/** Automation files are versioned; a reader must refuse a version it doesn't know. */
|
|
18
|
+
export declare const HF_AUDIO_AUTOMATION_VERSION = 1;
|
|
19
|
+
/**
|
|
20
|
+
* A pathological document should not be able to hang the scheduler, which
|
|
21
|
+
* expands every segment into scheduled ramps. Well past any hand-drawn
|
|
22
|
+
* envelope; a lane is dense at 100 points.
|
|
23
|
+
*/
|
|
24
|
+
export declare const MAX_AUTOMATION_POINTS = 512;
|
|
25
|
+
export interface HfAutomationPoint {
|
|
26
|
+
/** Seconds from the start of the clip, not the composition. */
|
|
27
|
+
t: number;
|
|
28
|
+
/** Value in the parameter's own unit — dB for a threshold, Hz for a cutoff. */
|
|
29
|
+
v: number;
|
|
30
|
+
/**
|
|
31
|
+
* Curvature of the segment *leaving* this point, -1..1. Absent or 0 is a
|
|
32
|
+
* straight line; positive holds low then rises late, negative rises early.
|
|
33
|
+
*/
|
|
34
|
+
curve?: number;
|
|
35
|
+
/**
|
|
36
|
+
* An interior point the segment *leaving* this point passes through, in
|
|
37
|
+
* normalised segment space: `viaX` is progress 0..1 between the two
|
|
38
|
+
* breakpoints, `viaY` is how far the value has travelled by then. Both are
|
|
39
|
+
* needed for either to mean anything; without them the segment falls back to
|
|
40
|
+
* `curve` above, so everything authored before this existed reads unchanged.
|
|
41
|
+
*
|
|
42
|
+
* Two numbers rather than one because `curve` answers only "how hard", and an
|
|
43
|
+
* exponent cannot say "and where". Every upward bend a single exponent can
|
|
44
|
+
* draw has its deepest deviation in the first fifth of the segment, whatever
|
|
45
|
+
* the author aimed at, and an exponent steep enough to reach a point near
|
|
46
|
+
* either end runs past the ±1 the model accepts — so a bend dragged near the
|
|
47
|
+
* right-hand breakpoint bulged on the left and then stopped following the
|
|
48
|
+
* pointer at all. Naming the point the curve goes through makes both the
|
|
49
|
+
* height and the position of the bend the author's to choose, and takes the
|
|
50
|
+
* saturation with it: any interior point is reachable exactly.
|
|
51
|
+
*/
|
|
52
|
+
viaX?: number;
|
|
53
|
+
viaY?: number;
|
|
54
|
+
}
|
|
55
|
+
export interface HfAutomationLane {
|
|
56
|
+
/** `volume`, or `fx.<nodeId>.<paramKey>`. */
|
|
57
|
+
target: string;
|
|
58
|
+
points: HfAutomationPoint[];
|
|
59
|
+
}
|
|
60
|
+
export interface HfAutomation {
|
|
61
|
+
version: number;
|
|
62
|
+
lanes: HfAutomationLane[];
|
|
63
|
+
}
|
|
64
|
+
export declare class AudioAutomationError extends Error {
|
|
65
|
+
constructor(message: string);
|
|
66
|
+
}
|
|
67
|
+
export declare const VOLUME_TARGET = "volume";
|
|
68
|
+
export type HfAutomationTarget = {
|
|
69
|
+
kind: "volume";
|
|
70
|
+
} | {
|
|
71
|
+
kind: "fx";
|
|
72
|
+
nodeId: string;
|
|
73
|
+
param: string;
|
|
74
|
+
} | {
|
|
75
|
+
kind: "preset";
|
|
76
|
+
presetId: string;
|
|
77
|
+
};
|
|
78
|
+
/** Split a target string. Returns null for anything unrecognised. */
|
|
79
|
+
export declare function parseAutomationTarget(target: string): HfAutomationTarget | null;
|
|
80
|
+
export declare function fxAutomationTarget(nodeId: string, param: string): string;
|
|
81
|
+
/**
|
|
82
|
+
* How much of a preset is applied, 0..1.
|
|
83
|
+
*
|
|
84
|
+
* A preset's nodes share no automatable parameter — and its worklet effects
|
|
85
|
+
* expose no AudioParams at all — so there is nothing to aim a lane at
|
|
86
|
+
* node-by-node. The graph wraps a preset's run in a wet/dry pair instead, and
|
|
87
|
+
* this drives the blend: 0 is the dry signal untouched, 1 is the preset fully
|
|
88
|
+
* applied, and between them it crossfades.
|
|
89
|
+
*/
|
|
90
|
+
export declare function presetAutomationTarget(presetId: string): string;
|
|
91
|
+
/** 0..1 blend, the same shape as a wet/dry mix knob. */
|
|
92
|
+
export declare const PRESET_RANGE: AutomationRange;
|
|
93
|
+
/**
|
|
94
|
+
* The value range a lane is drawn and clamped against.
|
|
95
|
+
*
|
|
96
|
+
* Volume is linear 0..1, matching `data-volume` and the existing volume
|
|
97
|
+
* envelope machinery — no dB conversion enters the volume path. Everything
|
|
98
|
+
* else is read from the effect registry, so a lane can never offer a value the
|
|
99
|
+
* renderer would reject, and the log-scaled knobs sweep the way a DAW's do.
|
|
100
|
+
*/
|
|
101
|
+
export interface AutomationRange {
|
|
102
|
+
min: number;
|
|
103
|
+
max: number;
|
|
104
|
+
step: number;
|
|
105
|
+
unit: string;
|
|
106
|
+
label: string;
|
|
107
|
+
scale: "linear" | "log";
|
|
108
|
+
/** Where an empty lane draws its flat line, and what a new point starts at. */
|
|
109
|
+
default: number;
|
|
110
|
+
}
|
|
111
|
+
export declare const VOLUME_RANGE: AutomationRange;
|
|
112
|
+
/**
|
|
113
|
+
* Resolve a lane's target against a chain. Returns null when the target names
|
|
114
|
+
* a node or parameter that is not there — the effect was deleted, or the
|
|
115
|
+
* parameter is an enum, which has no envelope between its values.
|
|
116
|
+
*/
|
|
117
|
+
export declare function resolveAutomationRange(target: string, chain: HfAudioFxChain | undefined): AutomationRange | null;
|
|
118
|
+
/**
|
|
119
|
+
* The via point a segment will actually be drawn with, given one that was asked
|
|
120
|
+
* for — pulled into the steady region, or null when it describes no bend.
|
|
121
|
+
*
|
|
122
|
+
* Exported so an editor can write what the model will honour rather than what the
|
|
123
|
+
* pointer happened to ask for. Without it a lane's attribute claims a shape the
|
|
124
|
+
* renderer quietly declines to draw, and the two only agree once the file makes a
|
|
125
|
+
* round trip.
|
|
126
|
+
*/
|
|
127
|
+
export declare function steadyViaPoint(viaX: number | undefined, viaY: number | undefined): {
|
|
128
|
+
viaX: number;
|
|
129
|
+
viaY: number;
|
|
130
|
+
} | null;
|
|
131
|
+
/**
|
|
132
|
+
* Structural normalisation, with no knowledge of the chain: sort and clean the
|
|
133
|
+
* points of every lane and drop lanes that carry none. Range clamping and
|
|
134
|
+
* orphan removal need the chain and happen in `resolveAutomation`.
|
|
135
|
+
*/
|
|
136
|
+
export declare function normalizeAutomation(automation: HfAutomation): HfAutomation;
|
|
137
|
+
/**
|
|
138
|
+
* Bind automation to a chain: clamp each lane into its parameter's declared
|
|
139
|
+
* range and drop lanes whose target no longer exists.
|
|
140
|
+
*
|
|
141
|
+
* Dropping is deliberate. An envelope on a deleted effect has nothing to
|
|
142
|
+
* drive, and keeping it would silently reattach if an unrelated effect later
|
|
143
|
+
* took the same node id.
|
|
144
|
+
*/
|
|
145
|
+
export declare function resolveAutomation(automation: HfAutomation, chain: HfAudioFxChain | undefined): HfAutomation;
|
|
146
|
+
/**
|
|
147
|
+
* Parse an automation attribute.
|
|
148
|
+
*
|
|
149
|
+
* Malformed input throws rather than being skipped, matching the chain reader:
|
|
150
|
+
* a track that quietly loses its envelope renders differently from the project
|
|
151
|
+
* the author saved, which is worse than refusing.
|
|
152
|
+
*/
|
|
153
|
+
export declare function parseAutomation(json: string): HfAutomation;
|
|
154
|
+
/** Serialise for the `data-automation` attribute. */
|
|
155
|
+
export declare function serializeAutomation(automation: HfAutomation): string;
|
|
156
|
+
/**
|
|
157
|
+
* Shape the 0..1 progress across a segment.
|
|
158
|
+
*
|
|
159
|
+
* `curve` is an exponent in disguise: 0 is linear, and the ends reach a
|
|
160
|
+
* quarter-power and a fourth-power bend, which is about the range a DAW's
|
|
161
|
+
* envelope handle covers before the segment stops reading as a curve.
|
|
162
|
+
*/
|
|
163
|
+
export declare function applyCurve(x: number, curve: number | undefined): number;
|
|
164
|
+
/**
|
|
165
|
+
* The progress a segment leaving `point` has reached at normalised `x`.
|
|
166
|
+
*
|
|
167
|
+
* A via point wins when it is there, since it says strictly more than an
|
|
168
|
+
* exponent can. Everything authored before via points existed carries only
|
|
169
|
+
* `curve` and takes the exponent path unchanged.
|
|
170
|
+
*/
|
|
171
|
+
export declare function shapeProgress(x: number, point: {
|
|
172
|
+
curve?: number | undefined;
|
|
173
|
+
viaX?: number | undefined;
|
|
174
|
+
viaY?: number | undefined;
|
|
175
|
+
}): number;
|
|
176
|
+
/**
|
|
177
|
+
* Value of a lane at a clip-local time.
|
|
178
|
+
*
|
|
179
|
+
* Outside the points, the envelope holds — the first value before it starts
|
|
180
|
+
* and the last value after it ends, so a lane never snaps to zero at the edges.
|
|
181
|
+
*/
|
|
182
|
+
export declare function sampleAutomationLane(lane: HfAutomationLane, t: number, scale?: "linear" | "log"): number;
|
|
183
|
+
/** True when the lane is a single value, i.e. worth setting once and not scheduling. */
|
|
184
|
+
export declare function isConstantLane(lane: HfAutomationLane): boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Sample a lane onto evenly spaced times, for consumers that want a plain
|
|
187
|
+
* curve rather than a breakpoint list: `setValueCurveAtTime`, the render-side
|
|
188
|
+
* volume envelope, and the lane's own drawing code.
|
|
189
|
+
*/
|
|
190
|
+
export declare function sampleAutomationCurve(lane: HfAutomationLane, from: number, to: number, count: number, scale?: "linear" | "log"): Float32Array;
|
|
191
|
+
//# sourceMappingURL=audioAutomation.d.ts.map
|