@onda-lang/binaryen-web 0.8.20 → 0.8.22
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/api.md +17 -7
- package/package.json +2 -2
package/api.md
CHANGED
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
const compiler = await createCompiler();
|
|
31
31
|
const { artifact } = await compiler.compileSource(source, {
|
|
32
32
|
sampleRate: audioContext.sampleRate,
|
|
33
|
-
blockSize:
|
|
33
|
+
blockSize: 512,
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
const print = ({ text }) => console.debug(text);
|
|
@@ -77,12 +77,8 @@ The returned instance provides:
|
|
|
77
77
|
- `sendLspMessage(message)` and `setLspAnalysisOptions(options?)` for the embedded language server.
|
|
78
78
|
- `dispose()`, an idempotent terminal release of compiler and worker resources.
|
|
79
79
|
|
|
80
|
-
Compile options accept `sampleRate`, `blockSize`, `
|
|
81
|
-
|
|
82
|
-
be finite and non-negative. It applies to floating-point top-level parameters that omit `smooth`;
|
|
83
|
-
explicit metadata, including `smooth = 0`, takes precedence. Positive values specify block-rate
|
|
84
|
-
linear ramp durations, rounded up to at least one host sample; the sample count must fit signed
|
|
85
|
-
64-bit storage.
|
|
80
|
+
Compile options accept `sampleRate`, `blockSize`, typed compile-constant overrides, and `codegen`.
|
|
81
|
+
The sample rate defaults to 48000 Hz and the block size to 512 frames.
|
|
86
82
|
Code generation can select optimization level `0..4`, shrink level `0..2`, strict or fast math,
|
|
87
83
|
SIMD, loop-containing inlining, and optional WAT emission. A successful compilation returns an
|
|
88
84
|
`OndaCompilationResult` containing the artifact, resolved source paths, and the exact source graph
|
|
@@ -211,12 +207,26 @@ the artifact metadata as the adapter constructor's second argument and
|
|
|
211
207
|
`processorOptions.executionOutputRing` as its fourth argument. Event encoding and numeric
|
|
212
208
|
unknown-index classification require that metadata.
|
|
213
209
|
|
|
210
|
+
`paramSmoothingSeconds` is an optional **host** setting on `OndaAudioProcessorOptions`, defaulting
|
|
211
|
+
to `0`. It applies finite linear ramps to continuous floating-point parameters and array elements;
|
|
212
|
+
integer, boolean, and stepped parameters update directly. Ramps publish once per logical compile
|
|
213
|
+
block, independent of Web Audio callback sizes. Durations round up to host samples and are bypassed
|
|
214
|
+
when they fit within one block. A changed target starts a fresh ramp from the published value;
|
|
215
|
+
repeated writes of the same target keep its deadline. Initial values and reinitialization settle
|
|
216
|
+
immediately, and processor snapshots do not contain the host ramps. The browser playground opts
|
|
217
|
+
into `0.03` seconds (30 ms). These block-level updates do not interpolate inside `sample:`.
|
|
218
|
+
|
|
214
219
|
### `OndaAudioProcessor`
|
|
215
220
|
|
|
216
221
|
The adapter exposes its `node` and validated `metadata`, plus these operations:
|
|
217
222
|
|
|
218
223
|
- `setParam(nameOrIndex, plain)` and `setParamNormalized(nameOrIndex, normalized)` for whole
|
|
219
224
|
parameters.
|
|
225
|
+
- `resetParams()` to restore parameter defaults immediately and cancel host ramps, retaining DSP state.
|
|
226
|
+
- `setParamSmoothingSeconds(seconds)` to change the host duration live without recompiling or
|
|
227
|
+
reinitializing DSP state. Finite, nonnegative durations are required. Active ramps restart from
|
|
228
|
+
their current values using the new duration; 0 (or a duration at most one block) settles their
|
|
229
|
+
targets immediately. Smoothing can be enabled after starting with 0.
|
|
220
230
|
- `setParamElement(nameOrIndex, element, plain)` and
|
|
221
231
|
`setParamElementNormalized(nameOrIndex, element, normalized)` for one scalar or fixed-array
|
|
222
232
|
element.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onda-lang/binaryen-web",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Binaryen backend for versioned Onda MIR in browsers and Node.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"verify-mir": "node ./scripts/verify-mir.mjs"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@onda-lang/processor-abi": "0.8.
|
|
49
|
+
"@onda-lang/processor-abi": "0.8.22",
|
|
50
50
|
"binaryen": "130.0.0"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|