@onda-lang/wasm-compiler 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/README.md +4 -8
- package/api.md +17 -7
- package/bin/onda-wasm.js +3 -3
- package/dist/build.json +3 -3
- package/dist/frontend/README.md +5 -7
- package/dist/frontend/onda_compiler_web.d.ts +10 -10
- package/dist/frontend/onda_compiler_web.js +10 -15
- package/dist/frontend/onda_compiler_web_bg.wasm +0 -0
- package/dist/frontend/onda_compiler_web_bg.wasm.d.ts +5 -5
- package/dist/frontend/package.json +1 -1
- package/dist/licenses/RUST-DEPENDENCIES.txt +8 -8
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/src/config.js +2 -0
- package/src/index.d.ts +0 -7
- package/src/index.js +2 -14
package/README.md
CHANGED
|
@@ -6,24 +6,20 @@ See [api.md](api.md) for the complete public Web API shared with the released pa
|
|
|
6
6
|
self-contained WebAssembly processor artifact. It runs in modern browsers and Node.js and does not
|
|
7
7
|
require LLVM, a Wasm linker, Rust, or `wasm-pack` after installation.
|
|
8
8
|
|
|
9
|
+
Compilation defaults to 48000 Hz and 512 frames per block.
|
|
10
|
+
|
|
9
11
|
```js
|
|
10
12
|
import { createCompiler } from "@onda-lang/wasm-compiler";
|
|
11
13
|
|
|
12
14
|
const compiler = await createCompiler();
|
|
13
15
|
const { artifact, sourceFiles } = await compiler.compileSource(source, {
|
|
14
16
|
sampleRate: 48_000,
|
|
15
|
-
blockSize:
|
|
16
|
-
defaultParamSmoothingSeconds: 0.02,
|
|
17
|
+
blockSize: 512,
|
|
17
18
|
});
|
|
18
19
|
|
|
19
20
|
console.log(artifact.wasm, artifact.metadata, sourceFiles);
|
|
20
21
|
```
|
|
21
22
|
|
|
22
|
-
`defaultParamSmoothingSeconds` is optional and defaults to `0`. A positive value applies compiled
|
|
23
|
-
block-rate linear ramps to floating-point top-level parameters that omit `smooth`; explicit source
|
|
24
|
-
metadata, including `smooth = 0`, takes precedence. Durations round up to at least one host sample;
|
|
25
|
-
values exceeding the supported signed 64-bit sample count are rejected.
|
|
26
|
-
|
|
27
23
|
Source may expose explicitly typed `config const` declarations. Supply optional partial overrides
|
|
28
24
|
on any source, workspace, or project-image compilation:
|
|
29
25
|
|
|
@@ -89,7 +85,7 @@ const { artifact, sourceFiles } = await compiler.compileWorkspace({
|
|
|
89
85
|
},
|
|
90
86
|
}, {
|
|
91
87
|
sampleRate: 48_000,
|
|
92
|
-
blockSize:
|
|
88
|
+
blockSize: 512,
|
|
93
89
|
});
|
|
94
90
|
|
|
95
91
|
// Entry first, then transitive imports/includes. Embedded stdlib is excluded.
|
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/bin/onda-wasm.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
createCompiler,
|
|
10
10
|
createProcessorArtifactFiles,
|
|
11
11
|
} from "../src/index.js";
|
|
12
|
-
import { MAX_BLOCK_SIZE } from "../src/config.js";
|
|
12
|
+
import { DEFAULT_BLOCK_SIZE, MAX_BLOCK_SIZE } from "../src/config.js";
|
|
13
13
|
|
|
14
14
|
const HELP = `Usage:
|
|
15
15
|
onda-wasm compile <input.onda> [options]
|
|
@@ -19,7 +19,7 @@ Options:
|
|
|
19
19
|
--output, -o <file> Output Wasm path (default: <input>.wasm)
|
|
20
20
|
--meta-out <file> Output descriptor path (default: <output>.onda.json)
|
|
21
21
|
--sample-rate <number> Compile-time sample rate (default: 48000)
|
|
22
|
-
--block-size <integer> Compile-time block size (default:
|
|
22
|
+
--block-size <integer> Compile-time block size (default: ${DEFAULT_BLOCK_SIZE})
|
|
23
23
|
--optimize-level <0..4> Binaryen optimization level (default: 4)
|
|
24
24
|
--shrink-level <0..2> Binaryen shrink level (default: 0)
|
|
25
25
|
--fast-math Enable relaxed floating-point rewrites
|
|
@@ -116,7 +116,7 @@ function parseCompileArguments(args) {
|
|
|
116
116
|
output: undefined,
|
|
117
117
|
metaOut: undefined,
|
|
118
118
|
sampleRate: 48_000,
|
|
119
|
-
blockSize:
|
|
119
|
+
blockSize: DEFAULT_BLOCK_SIZE,
|
|
120
120
|
optimizeLevel: 4,
|
|
121
121
|
shrinkLevel: 0,
|
|
122
122
|
fastMath: false,
|
package/dist/build.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"ondaVersion": "0.8.
|
|
2
|
+
"ondaVersion": "0.8.22",
|
|
3
3
|
"binaryenVersion": "130.0.0",
|
|
4
4
|
"frontendPackage": "onda_compiler_web",
|
|
5
5
|
"frontendOptimization": {
|
|
6
6
|
"tool": "wasm-opt",
|
|
7
7
|
"binaryenVersion": "130.0.0",
|
|
8
8
|
"optimizeLevel": 4,
|
|
9
|
-
"inputBytes":
|
|
10
|
-
"outputBytes":
|
|
9
|
+
"inputBytes": 10988474,
|
|
10
|
+
"outputBytes": 7977043
|
|
11
11
|
}
|
|
12
12
|
}
|
package/dist/frontend/README.md
CHANGED
|
@@ -15,10 +15,9 @@ The package build runs `wasm-pack --release` and then the workspace-pinned Binar
|
|
|
15
15
|
optimizer so every local, CI, website, and npm build uses the same Binaryen release.
|
|
16
16
|
|
|
17
17
|
The production exports
|
|
18
|
-
`compile_to_mir_messagepack(source, sampleRate, blockSize,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
`FrontendMessagePackCompilation` containing compact
|
|
18
|
+
`compile_to_mir_messagepack(source, sampleRate, blockSize, constantsJson)` and
|
|
19
|
+
`compile_source_workspace_to_mir_messagepack(entryPath, sourcesJson, sampleRate, blockSize,
|
|
20
|
+
constantsJson)`. They return a `FrontendMessagePackCompilation` containing compact
|
|
22
21
|
schema-versioned bytes plus the ordered contributing project paths. `constantsJson` is the typed,
|
|
23
22
|
lossless internal transport for immutable `config const` inputs supplied by the public npm package.
|
|
24
23
|
JSON variants return the equivalent `FrontendJsonCompilation` for inspection and tooling. Both
|
|
@@ -26,9 +25,8 @@ result types expose the source list and exact portable source image.
|
|
|
26
25
|
Workspace
|
|
27
26
|
compilation accepts a JSON object of project-relative paths to source strings, resolving imports and
|
|
28
27
|
includes entirely in memory. Paths cannot escape the virtual project root. Embedded
|
|
29
|
-
standard-library modules are omitted from the source manifest. `
|
|
30
|
-
|
|
31
|
-
checks. Compilation failures reject with a JSON-encoded object
|
|
28
|
+
standard-library modules are omitted from the source manifest. `mir_schema_version()` exposes the
|
|
29
|
+
producer version for integration checks. Compilation failures reject with a JSON-encoded object
|
|
32
30
|
containing structured diagnostics, the partially resolved source list, and unresolved
|
|
33
31
|
non-standard-library candidates which a host may watch for creation.
|
|
34
32
|
|
|
@@ -74,15 +74,15 @@ export class WebProjectMaterializationPlan {
|
|
|
74
74
|
|
|
75
75
|
export function buffer_asset_format_version(): number;
|
|
76
76
|
|
|
77
|
-
export function compile_project_image_to_mir_messagepack(image_bytes: Uint8Array, sample_rate: number, block_size: number,
|
|
77
|
+
export function compile_project_image_to_mir_messagepack(image_bytes: Uint8Array, sample_rate: number, block_size: number, constants_json: string): FrontendMessagePackCompilation;
|
|
78
78
|
|
|
79
|
-
export function compile_source_workspace_to_mir_json(entry_path: string, sources_json: string, sample_rate: number, block_size: number,
|
|
79
|
+
export function compile_source_workspace_to_mir_json(entry_path: string, sources_json: string, sample_rate: number, block_size: number, constants_json: string): FrontendJsonCompilation;
|
|
80
80
|
|
|
81
|
-
export function compile_source_workspace_to_mir_messagepack(entry_path: string, sources_json: string, sample_rate: number, block_size: number,
|
|
81
|
+
export function compile_source_workspace_to_mir_messagepack(entry_path: string, sources_json: string, sample_rate: number, block_size: number, constants_json: string): FrontendMessagePackCompilation;
|
|
82
82
|
|
|
83
|
-
export function compile_to_mir_json(source: string, sample_rate: number, block_size: number,
|
|
83
|
+
export function compile_to_mir_json(source: string, sample_rate: number, block_size: number, constants_json: string): FrontendJsonCompilation;
|
|
84
84
|
|
|
85
|
-
export function compile_to_mir_messagepack(source: string, sample_rate: number, block_size: number,
|
|
85
|
+
export function compile_to_mir_messagepack(source: string, sample_rate: number, block_size: number, constants_json: string): FrontendMessagePackCompilation;
|
|
86
86
|
|
|
87
87
|
export function current_stdlib_digest(): string;
|
|
88
88
|
|
|
@@ -123,11 +123,11 @@ export interface InitOutput {
|
|
|
123
123
|
readonly __wbg_webprojectimagebuilder_free: (a: number, b: number) => void;
|
|
124
124
|
readonly __wbg_webprojectmaterializationplan_free: (a: number, b: number) => void;
|
|
125
125
|
readonly buffer_asset_format_version: () => number;
|
|
126
|
-
readonly compile_project_image_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number
|
|
127
|
-
readonly compile_source_workspace_to_mir_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number
|
|
128
|
-
readonly compile_source_workspace_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number
|
|
129
|
-
readonly compile_to_mir_json: (a: number, b: number, c: number, d: number, e: number, f: number
|
|
130
|
-
readonly compile_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number
|
|
126
|
+
readonly compile_project_image_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
127
|
+
readonly compile_source_workspace_to_mir_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
|
|
128
|
+
readonly compile_source_workspace_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
|
|
129
|
+
readonly compile_to_mir_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
130
|
+
readonly compile_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
131
131
|
readonly current_stdlib_digest: () => [number, number];
|
|
132
132
|
readonly decode_buffer_asset: (a: number, b: number) => [number, number, number];
|
|
133
133
|
readonly decode_buffer_file: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
@@ -443,16 +443,15 @@ export function buffer_asset_format_version() {
|
|
|
443
443
|
* @param {Uint8Array} image_bytes
|
|
444
444
|
* @param {number} sample_rate
|
|
445
445
|
* @param {number} block_size
|
|
446
|
-
* @param {number} default_param_smoothing_seconds
|
|
447
446
|
* @param {string} constants_json
|
|
448
447
|
* @returns {FrontendMessagePackCompilation}
|
|
449
448
|
*/
|
|
450
|
-
export function compile_project_image_to_mir_messagepack(image_bytes, sample_rate, block_size,
|
|
449
|
+
export function compile_project_image_to_mir_messagepack(image_bytes, sample_rate, block_size, constants_json) {
|
|
451
450
|
const ptr0 = passArray8ToWasm0(image_bytes, wasm.__wbindgen_malloc);
|
|
452
451
|
const len0 = WASM_VECTOR_LEN;
|
|
453
452
|
const ptr1 = passStringToWasm0(constants_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
454
453
|
const len1 = WASM_VECTOR_LEN;
|
|
455
|
-
const ret = wasm.compile_project_image_to_mir_messagepack(ptr0, len0, sample_rate, block_size,
|
|
454
|
+
const ret = wasm.compile_project_image_to_mir_messagepack(ptr0, len0, sample_rate, block_size, ptr1, len1);
|
|
456
455
|
if (ret[2]) {
|
|
457
456
|
throw takeFromExternrefTable0(ret[1]);
|
|
458
457
|
}
|
|
@@ -464,18 +463,17 @@ export function compile_project_image_to_mir_messagepack(image_bytes, sample_rat
|
|
|
464
463
|
* @param {string} sources_json
|
|
465
464
|
* @param {number} sample_rate
|
|
466
465
|
* @param {number} block_size
|
|
467
|
-
* @param {number} default_param_smoothing_seconds
|
|
468
466
|
* @param {string} constants_json
|
|
469
467
|
* @returns {FrontendJsonCompilation}
|
|
470
468
|
*/
|
|
471
|
-
export function compile_source_workspace_to_mir_json(entry_path, sources_json, sample_rate, block_size,
|
|
469
|
+
export function compile_source_workspace_to_mir_json(entry_path, sources_json, sample_rate, block_size, constants_json) {
|
|
472
470
|
const ptr0 = passStringToWasm0(entry_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
473
471
|
const len0 = WASM_VECTOR_LEN;
|
|
474
472
|
const ptr1 = passStringToWasm0(sources_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
475
473
|
const len1 = WASM_VECTOR_LEN;
|
|
476
474
|
const ptr2 = passStringToWasm0(constants_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
477
475
|
const len2 = WASM_VECTOR_LEN;
|
|
478
|
-
const ret = wasm.compile_source_workspace_to_mir_json(ptr0, len0, ptr1, len1, sample_rate, block_size,
|
|
476
|
+
const ret = wasm.compile_source_workspace_to_mir_json(ptr0, len0, ptr1, len1, sample_rate, block_size, ptr2, len2);
|
|
479
477
|
if (ret[2]) {
|
|
480
478
|
throw takeFromExternrefTable0(ret[1]);
|
|
481
479
|
}
|
|
@@ -487,18 +485,17 @@ export function compile_source_workspace_to_mir_json(entry_path, sources_json, s
|
|
|
487
485
|
* @param {string} sources_json
|
|
488
486
|
* @param {number} sample_rate
|
|
489
487
|
* @param {number} block_size
|
|
490
|
-
* @param {number} default_param_smoothing_seconds
|
|
491
488
|
* @param {string} constants_json
|
|
492
489
|
* @returns {FrontendMessagePackCompilation}
|
|
493
490
|
*/
|
|
494
|
-
export function compile_source_workspace_to_mir_messagepack(entry_path, sources_json, sample_rate, block_size,
|
|
491
|
+
export function compile_source_workspace_to_mir_messagepack(entry_path, sources_json, sample_rate, block_size, constants_json) {
|
|
495
492
|
const ptr0 = passStringToWasm0(entry_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
496
493
|
const len0 = WASM_VECTOR_LEN;
|
|
497
494
|
const ptr1 = passStringToWasm0(sources_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
498
495
|
const len1 = WASM_VECTOR_LEN;
|
|
499
496
|
const ptr2 = passStringToWasm0(constants_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
500
497
|
const len2 = WASM_VECTOR_LEN;
|
|
501
|
-
const ret = wasm.compile_source_workspace_to_mir_messagepack(ptr0, len0, ptr1, len1, sample_rate, block_size,
|
|
498
|
+
const ret = wasm.compile_source_workspace_to_mir_messagepack(ptr0, len0, ptr1, len1, sample_rate, block_size, ptr2, len2);
|
|
502
499
|
if (ret[2]) {
|
|
503
500
|
throw takeFromExternrefTable0(ret[1]);
|
|
504
501
|
}
|
|
@@ -509,16 +506,15 @@ export function compile_source_workspace_to_mir_messagepack(entry_path, sources_
|
|
|
509
506
|
* @param {string} source
|
|
510
507
|
* @param {number} sample_rate
|
|
511
508
|
* @param {number} block_size
|
|
512
|
-
* @param {number} default_param_smoothing_seconds
|
|
513
509
|
* @param {string} constants_json
|
|
514
510
|
* @returns {FrontendJsonCompilation}
|
|
515
511
|
*/
|
|
516
|
-
export function compile_to_mir_json(source, sample_rate, block_size,
|
|
512
|
+
export function compile_to_mir_json(source, sample_rate, block_size, constants_json) {
|
|
517
513
|
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
518
514
|
const len0 = WASM_VECTOR_LEN;
|
|
519
515
|
const ptr1 = passStringToWasm0(constants_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
520
516
|
const len1 = WASM_VECTOR_LEN;
|
|
521
|
-
const ret = wasm.compile_to_mir_json(ptr0, len0, sample_rate, block_size,
|
|
517
|
+
const ret = wasm.compile_to_mir_json(ptr0, len0, sample_rate, block_size, ptr1, len1);
|
|
522
518
|
if (ret[2]) {
|
|
523
519
|
throw takeFromExternrefTable0(ret[1]);
|
|
524
520
|
}
|
|
@@ -529,16 +525,15 @@ export function compile_to_mir_json(source, sample_rate, block_size, default_par
|
|
|
529
525
|
* @param {string} source
|
|
530
526
|
* @param {number} sample_rate
|
|
531
527
|
* @param {number} block_size
|
|
532
|
-
* @param {number} default_param_smoothing_seconds
|
|
533
528
|
* @param {string} constants_json
|
|
534
529
|
* @returns {FrontendMessagePackCompilation}
|
|
535
530
|
*/
|
|
536
|
-
export function compile_to_mir_messagepack(source, sample_rate, block_size,
|
|
531
|
+
export function compile_to_mir_messagepack(source, sample_rate, block_size, constants_json) {
|
|
537
532
|
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
538
533
|
const len0 = WASM_VECTOR_LEN;
|
|
539
534
|
const ptr1 = passStringToWasm0(constants_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
540
535
|
const len1 = WASM_VECTOR_LEN;
|
|
541
|
-
const ret = wasm.compile_to_mir_messagepack(ptr0, len0, sample_rate, block_size,
|
|
536
|
+
const ret = wasm.compile_to_mir_messagepack(ptr0, len0, sample_rate, block_size, ptr1, len1);
|
|
542
537
|
if (ret[2]) {
|
|
543
538
|
throw takeFromExternrefTable0(ret[1]);
|
|
544
539
|
}
|
|
Binary file
|
|
@@ -9,11 +9,11 @@ export const __wbg_webmaterializedprojectbuilder_free: (a: number, b: number) =>
|
|
|
9
9
|
export const __wbg_webprojectimagebuilder_free: (a: number, b: number) => void;
|
|
10
10
|
export const __wbg_webprojectmaterializationplan_free: (a: number, b: number) => void;
|
|
11
11
|
export const buffer_asset_format_version: () => number;
|
|
12
|
-
export const compile_project_image_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number
|
|
13
|
-
export const compile_source_workspace_to_mir_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number
|
|
14
|
-
export const compile_source_workspace_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number
|
|
15
|
-
export const compile_to_mir_json: (a: number, b: number, c: number, d: number, e: number, f: number
|
|
16
|
-
export const compile_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number
|
|
12
|
+
export const compile_project_image_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
13
|
+
export const compile_source_workspace_to_mir_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
|
|
14
|
+
export const compile_source_workspace_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
|
|
15
|
+
export const compile_to_mir_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
16
|
+
export const compile_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
17
17
|
export const current_stdlib_digest: () => [number, number];
|
|
18
18
|
export const decode_buffer_asset: (a: number, b: number) => [number, number, number];
|
|
19
19
|
export const decode_buffer_file: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
@@ -675,7 +675,7 @@ SOFTWARE.
|
|
|
675
675
|
MIT License (MIT)
|
|
676
676
|
|
|
677
677
|
Used by:
|
|
678
|
-
- onda_compiler_web 0.8.
|
|
678
|
+
- onda_compiler_web 0.8.22 (https://github.com/onda-lang/onda)
|
|
679
679
|
|
|
680
680
|
MIT License
|
|
681
681
|
|
|
@@ -704,13 +704,13 @@ SOFTWARE.
|
|
|
704
704
|
MIT License (MIT)
|
|
705
705
|
|
|
706
706
|
Used by:
|
|
707
|
-
- onda_frontend 0.8.
|
|
708
|
-
- onda_host_protocol 0.8.
|
|
709
|
-
- onda_lsp 0.8.
|
|
710
|
-
- onda_mir 0.8.
|
|
711
|
-
- onda_processor_abi 0.8.
|
|
712
|
-
- onda_project 0.8.
|
|
713
|
-
- onda_semantics 0.8.
|
|
707
|
+
- onda_frontend 0.8.22
|
|
708
|
+
- onda_host_protocol 0.8.22
|
|
709
|
+
- onda_lsp 0.8.22
|
|
710
|
+
- onda_mir 0.8.22
|
|
711
|
+
- onda_processor_abi 0.8.22
|
|
712
|
+
- onda_project 0.8.22
|
|
713
|
+
- onda_semantics 0.8.22
|
|
714
714
|
|
|
715
715
|
MIT License
|
|
716
716
|
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ONDA_VERSION = "0.8.
|
|
1
|
+
export const ONDA_VERSION = "0.8.22";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onda-lang/wasm-compiler",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Onda source-to-WebAssembly compiler for browsers and Node.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"prepack": "npm run build && node ../../scripts/stage-web-api-docs.mjs"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@onda-lang/processor-abi": "0.8.
|
|
63
|
+
"@onda-lang/processor-abi": "0.8.22",
|
|
64
64
|
"binaryen": "130.0.0"
|
|
65
65
|
},
|
|
66
66
|
"publishConfig": {
|
package/src/config.js
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -54,13 +54,6 @@ export interface OndaCodegenOptions {
|
|
|
54
54
|
export interface OndaCompileOptions {
|
|
55
55
|
sampleRate?: number;
|
|
56
56
|
blockSize?: number;
|
|
57
|
-
/**
|
|
58
|
-
* Block-rate linear ramp duration in seconds for floating-point top-level
|
|
59
|
-
* parameters that omit `smooth`. Explicit metadata takes precedence. Positive
|
|
60
|
-
* durations round up to at least one host sample and must fit an i64 sample count.
|
|
61
|
-
* Defaults to zero.
|
|
62
|
-
*/
|
|
63
|
-
defaultParamSmoothingSeconds?: number;
|
|
64
57
|
constants?: Map<string, OndaCompileConstValue>
|
|
65
58
|
| Record<string, OndaCompileConstValue>;
|
|
66
59
|
codegen?: OndaCodegenOptions;
|
package/src/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import { SUPPORTED_MIR_SCHEMA_VERSION } from "../dist/backend/constants.js";
|
|
|
24
24
|
import { OndaBinaryenError } from "../dist/backend/errors.js";
|
|
25
25
|
import { defaultFrontendInput } from "#onda-frontend-loader";
|
|
26
26
|
import { ONDA_VERSION } from "../dist/version.js";
|
|
27
|
-
import { MAX_BLOCK_SIZE } from "./config.js";
|
|
27
|
+
import { DEFAULT_BLOCK_SIZE, MAX_BLOCK_SIZE } from "./config.js";
|
|
28
28
|
|
|
29
29
|
export const MIR_SCHEMA_VERSION = SUPPORTED_MIR_SCHEMA_VERSION;
|
|
30
30
|
export { ONDA_VERSION };
|
|
@@ -107,7 +107,6 @@ class OndaCompiler {
|
|
|
107
107
|
source,
|
|
108
108
|
compile.sampleRate,
|
|
109
109
|
compile.blockSize,
|
|
110
|
-
compile.defaultParamSmoothingSeconds,
|
|
111
110
|
compile.constantsJson,
|
|
112
111
|
);
|
|
113
112
|
} catch (error) {
|
|
@@ -154,7 +153,6 @@ class OndaCompiler {
|
|
|
154
153
|
JSON.stringify(workspace.sources),
|
|
155
154
|
compile.sampleRate,
|
|
156
155
|
compile.blockSize,
|
|
157
|
-
compile.defaultParamSmoothingSeconds,
|
|
158
156
|
compile.constantsJson,
|
|
159
157
|
);
|
|
160
158
|
} catch (error) {
|
|
@@ -199,7 +197,6 @@ class OndaCompiler {
|
|
|
199
197
|
bytes,
|
|
200
198
|
compile.sampleRate,
|
|
201
199
|
compile.blockSize,
|
|
202
|
-
compile.defaultParamSmoothingSeconds,
|
|
203
200
|
compile.constantsJson,
|
|
204
201
|
);
|
|
205
202
|
} catch (error) {
|
|
@@ -622,7 +619,6 @@ function normalizeCompileOptions(options) {
|
|
|
622
619
|
}
|
|
623
620
|
return {
|
|
624
621
|
...compile,
|
|
625
|
-
defaultParamSmoothingSeconds: normalizeDefaultParamSmoothingSeconds(options),
|
|
626
622
|
codegen: options.codegen ?? {},
|
|
627
623
|
};
|
|
628
624
|
}
|
|
@@ -642,14 +638,6 @@ function normalizeCompileInputOptions(options) {
|
|
|
642
638
|
};
|
|
643
639
|
}
|
|
644
640
|
|
|
645
|
-
function normalizeDefaultParamSmoothingSeconds(options) {
|
|
646
|
-
const value = options.defaultParamSmoothingSeconds ?? 0;
|
|
647
|
-
if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
|
|
648
|
-
throw configurationError("defaultParamSmoothingSeconds must be finite and non-negative");
|
|
649
|
-
}
|
|
650
|
-
return value;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
641
|
function normalizeLspAnalysisOptions(options) {
|
|
654
642
|
const context = normalizeContextOptions(options);
|
|
655
643
|
if (options.constants !== undefined) {
|
|
@@ -668,7 +656,7 @@ function normalizeContextOptions(options) {
|
|
|
668
656
|
throw configurationError("compiler options must be an object");
|
|
669
657
|
}
|
|
670
658
|
const sampleRate = options.sampleRate ?? 48_000;
|
|
671
|
-
const blockSize = options.blockSize ??
|
|
659
|
+
const blockSize = options.blockSize ?? DEFAULT_BLOCK_SIZE;
|
|
672
660
|
if (typeof sampleRate !== "number" || !Number.isFinite(sampleRate) || sampleRate <= 0) {
|
|
673
661
|
throw configurationError("sampleRate must be finite and greater than zero");
|
|
674
662
|
}
|