@onda-lang/processor-abi 0.8.20 → 0.8.21

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.
Files changed (2) hide show
  1. package/api.md +13 -7
  2. package/package.json +1 -1
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: 128,
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`, `defaultParamSmoothingSeconds`, typed
81
- compile-constant overrides, and `codegen`. `defaultParamSmoothingSeconds` defaults to `0` and must
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,22 @@ 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.
220
226
  - `setParamElement(nameOrIndex, element, plain)` and
221
227
  `setParamElementNormalized(nameOrIndex, element, normalized)` for one scalar or fixed-array
222
228
  element.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onda-lang/processor-abi",
3
- "version": "0.8.20",
3
+ "version": "0.8.21",
4
4
  "type": "module",
5
5
  "description": "Shared Onda processor artifact schema, validation, and integrity helpers",
6
6
  "license": "MIT",