@onda-lang/wasm-compiler 0.8.18 → 0.8.20
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 +6 -0
- package/api.md +6 -1
- package/dist/build.json +3 -3
- package/dist/frontend/README.md +7 -5
- package/dist/frontend/onda_compiler_web.d.ts +16 -10
- package/dist/frontend/onda_compiler_web.js +32 -10
- package/dist/frontend/onda_compiler_web_bg.wasm +0 -0
- package/dist/frontend/onda_compiler_web_bg.wasm.d.ts +6 -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/index.d.ts +7 -0
- package/src/index.js +12 -0
package/README.md
CHANGED
|
@@ -13,11 +13,17 @@ const compiler = await createCompiler();
|
|
|
13
13
|
const { artifact, sourceFiles } = await compiler.compileSource(source, {
|
|
14
14
|
sampleRate: 48_000,
|
|
15
15
|
blockSize: 128,
|
|
16
|
+
defaultParamSmoothingSeconds: 0.02,
|
|
16
17
|
});
|
|
17
18
|
|
|
18
19
|
console.log(artifact.wasm, artifact.metadata, sourceFiles);
|
|
19
20
|
```
|
|
20
21
|
|
|
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
|
+
|
|
21
27
|
Source may expose explicitly typed `config const` declarations. Supply optional partial overrides
|
|
22
28
|
on any source, workspace, or project-image compilation:
|
|
23
29
|
|
package/api.md
CHANGED
|
@@ -77,7 +77,12 @@ 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`, typed
|
|
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.
|
|
81
86
|
Code generation can select optimization level `0..4`, shrink level `0..2`, strict or fast math,
|
|
82
87
|
SIMD, loop-containing inlining, and optional WAT emission. A successful compilation returns an
|
|
83
88
|
`OndaCompilationResult` containing the artifact, resolved source paths, and the exact source graph
|
package/dist/build.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"ondaVersion": "0.8.
|
|
2
|
+
"ondaVersion": "0.8.20",
|
|
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": 11024870,
|
|
10
|
+
"outputBytes": 7994473
|
|
11
11
|
}
|
|
12
12
|
}
|
package/dist/frontend/README.md
CHANGED
|
@@ -15,9 +15,10 @@ 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
|
-
`compile_source_workspace_to_mir_messagepack(entryPath, sourcesJson,
|
|
20
|
-
constantsJson)`. They return a
|
|
18
|
+
`compile_to_mir_messagepack(source, sampleRate, blockSize, defaultParamSmoothingSeconds,
|
|
19
|
+
constantsJson)` and `compile_source_workspace_to_mir_messagepack(entryPath, sourcesJson,
|
|
20
|
+
sampleRate, blockSize, defaultParamSmoothingSeconds, constantsJson)`. They return a
|
|
21
|
+
`FrontendMessagePackCompilation` containing compact
|
|
21
22
|
schema-versioned bytes plus the ordered contributing project paths. `constantsJson` is the typed,
|
|
22
23
|
lossless internal transport for immutable `config const` inputs supplied by the public npm package.
|
|
23
24
|
JSON variants return the equivalent `FrontendJsonCompilation` for inspection and tooling. Both
|
|
@@ -25,8 +26,9 @@ result types expose the source list and exact portable source image.
|
|
|
25
26
|
Workspace
|
|
26
27
|
compilation accepts a JSON object of project-relative paths to source strings, resolving imports and
|
|
27
28
|
includes entirely in memory. Paths cannot escape the virtual project root. Embedded
|
|
28
|
-
standard-library modules are omitted from the source manifest. `
|
|
29
|
-
|
|
29
|
+
standard-library modules are omitted from the source manifest. `onda_version()` exposes the Onda
|
|
30
|
+
release version and `mir_schema_version()` exposes the producer schema version for integration
|
|
31
|
+
checks. Compilation failures reject with a JSON-encoded object
|
|
30
32
|
containing structured diagnostics, the partially resolved source list, and unresolved
|
|
31
33
|
non-standard-library candidates which a host may watch for creation.
|
|
32
34
|
|
|
@@ -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, constants_json: string): FrontendMessagePackCompilation;
|
|
77
|
+
export function compile_project_image_to_mir_messagepack(image_bytes: Uint8Array, sample_rate: number, block_size: number, default_param_smoothing_seconds: 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, constants_json: string): FrontendJsonCompilation;
|
|
79
|
+
export function compile_source_workspace_to_mir_json(entry_path: string, sources_json: string, sample_rate: number, block_size: number, default_param_smoothing_seconds: 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, constants_json: string): FrontendMessagePackCompilation;
|
|
81
|
+
export function compile_source_workspace_to_mir_messagepack(entry_path: string, sources_json: string, sample_rate: number, block_size: number, default_param_smoothing_seconds: number, constants_json: string): FrontendMessagePackCompilation;
|
|
82
82
|
|
|
83
|
-
export function compile_to_mir_json(source: string, sample_rate: number, block_size: number, constants_json: string): FrontendJsonCompilation;
|
|
83
|
+
export function compile_to_mir_json(source: string, sample_rate: number, block_size: number, default_param_smoothing_seconds: number, constants_json: string): FrontendJsonCompilation;
|
|
84
84
|
|
|
85
|
-
export function compile_to_mir_messagepack(source: string, sample_rate: number, block_size: number, constants_json: string): FrontendMessagePackCompilation;
|
|
85
|
+
export function compile_to_mir_messagepack(source: string, sample_rate: number, block_size: number, default_param_smoothing_seconds: number, constants_json: string): FrontendMessagePackCompilation;
|
|
86
86
|
|
|
87
87
|
export function current_stdlib_digest(): string;
|
|
88
88
|
|
|
@@ -104,6 +104,11 @@ export function materialize_project_image(image_bytes: Uint8Array, asset_file_na
|
|
|
104
104
|
|
|
105
105
|
export function mir_schema_version(): number;
|
|
106
106
|
|
|
107
|
+
/**
|
|
108
|
+
* Returns the Onda compiler release version.
|
|
109
|
+
*/
|
|
110
|
+
export function onda_version(): string;
|
|
111
|
+
|
|
107
112
|
export function project_image_format_version(): number;
|
|
108
113
|
|
|
109
114
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
@@ -118,11 +123,11 @@ export interface InitOutput {
|
|
|
118
123
|
readonly __wbg_webprojectimagebuilder_free: (a: number, b: number) => void;
|
|
119
124
|
readonly __wbg_webprojectmaterializationplan_free: (a: number, b: number) => void;
|
|
120
125
|
readonly buffer_asset_format_version: () => number;
|
|
121
|
-
readonly compile_project_image_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
122
|
-
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];
|
|
123
|
-
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];
|
|
124
|
-
readonly compile_to_mir_json: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
125
|
-
readonly compile_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
126
|
+
readonly compile_project_image_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number, g: 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, i: 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, i: number) => [number, number, number];
|
|
129
|
+
readonly compile_to_mir_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
|
|
130
|
+
readonly compile_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
|
|
126
131
|
readonly current_stdlib_digest: () => [number, number];
|
|
127
132
|
readonly decode_buffer_asset: (a: number, b: number) => [number, number, number];
|
|
128
133
|
readonly decode_buffer_file: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
@@ -138,6 +143,7 @@ export interface InitOutput {
|
|
|
138
143
|
readonly inspect_source_workspace_compile_constants: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
|
|
139
144
|
readonly materialize_project_image: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
140
145
|
readonly mir_schema_version: () => number;
|
|
146
|
+
readonly onda_version: () => [number, number];
|
|
141
147
|
readonly ondalsp_handle_message: (a: number, b: number, c: number) => [number, number, number, number];
|
|
142
148
|
readonly ondalsp_new: () => number;
|
|
143
149
|
readonly ondalsp_set_analysis_options: (a: number, b: number, c: number) => [number, number];
|
|
@@ -443,15 +443,16 @@ 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
|
|
446
447
|
* @param {string} constants_json
|
|
447
448
|
* @returns {FrontendMessagePackCompilation}
|
|
448
449
|
*/
|
|
449
|
-
export function compile_project_image_to_mir_messagepack(image_bytes, sample_rate, block_size, constants_json) {
|
|
450
|
+
export function compile_project_image_to_mir_messagepack(image_bytes, sample_rate, block_size, default_param_smoothing_seconds, constants_json) {
|
|
450
451
|
const ptr0 = passArray8ToWasm0(image_bytes, wasm.__wbindgen_malloc);
|
|
451
452
|
const len0 = WASM_VECTOR_LEN;
|
|
452
453
|
const ptr1 = passStringToWasm0(constants_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
453
454
|
const len1 = WASM_VECTOR_LEN;
|
|
454
|
-
const ret = wasm.compile_project_image_to_mir_messagepack(ptr0, len0, sample_rate, block_size, ptr1, len1);
|
|
455
|
+
const ret = wasm.compile_project_image_to_mir_messagepack(ptr0, len0, sample_rate, block_size, default_param_smoothing_seconds, ptr1, len1);
|
|
455
456
|
if (ret[2]) {
|
|
456
457
|
throw takeFromExternrefTable0(ret[1]);
|
|
457
458
|
}
|
|
@@ -463,17 +464,18 @@ export function compile_project_image_to_mir_messagepack(image_bytes, sample_rat
|
|
|
463
464
|
* @param {string} sources_json
|
|
464
465
|
* @param {number} sample_rate
|
|
465
466
|
* @param {number} block_size
|
|
467
|
+
* @param {number} default_param_smoothing_seconds
|
|
466
468
|
* @param {string} constants_json
|
|
467
469
|
* @returns {FrontendJsonCompilation}
|
|
468
470
|
*/
|
|
469
|
-
export function compile_source_workspace_to_mir_json(entry_path, sources_json, sample_rate, block_size, constants_json) {
|
|
471
|
+
export function compile_source_workspace_to_mir_json(entry_path, sources_json, sample_rate, block_size, default_param_smoothing_seconds, constants_json) {
|
|
470
472
|
const ptr0 = passStringToWasm0(entry_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
471
473
|
const len0 = WASM_VECTOR_LEN;
|
|
472
474
|
const ptr1 = passStringToWasm0(sources_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
473
475
|
const len1 = WASM_VECTOR_LEN;
|
|
474
476
|
const ptr2 = passStringToWasm0(constants_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
475
477
|
const len2 = WASM_VECTOR_LEN;
|
|
476
|
-
const ret = wasm.compile_source_workspace_to_mir_json(ptr0, len0, ptr1, len1, sample_rate, block_size, ptr2, len2);
|
|
478
|
+
const ret = wasm.compile_source_workspace_to_mir_json(ptr0, len0, ptr1, len1, sample_rate, block_size, default_param_smoothing_seconds, ptr2, len2);
|
|
477
479
|
if (ret[2]) {
|
|
478
480
|
throw takeFromExternrefTable0(ret[1]);
|
|
479
481
|
}
|
|
@@ -485,17 +487,18 @@ export function compile_source_workspace_to_mir_json(entry_path, sources_json, s
|
|
|
485
487
|
* @param {string} sources_json
|
|
486
488
|
* @param {number} sample_rate
|
|
487
489
|
* @param {number} block_size
|
|
490
|
+
* @param {number} default_param_smoothing_seconds
|
|
488
491
|
* @param {string} constants_json
|
|
489
492
|
* @returns {FrontendMessagePackCompilation}
|
|
490
493
|
*/
|
|
491
|
-
export function compile_source_workspace_to_mir_messagepack(entry_path, sources_json, sample_rate, block_size, constants_json) {
|
|
494
|
+
export function compile_source_workspace_to_mir_messagepack(entry_path, sources_json, sample_rate, block_size, default_param_smoothing_seconds, constants_json) {
|
|
492
495
|
const ptr0 = passStringToWasm0(entry_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
493
496
|
const len0 = WASM_VECTOR_LEN;
|
|
494
497
|
const ptr1 = passStringToWasm0(sources_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
495
498
|
const len1 = WASM_VECTOR_LEN;
|
|
496
499
|
const ptr2 = passStringToWasm0(constants_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
497
500
|
const len2 = WASM_VECTOR_LEN;
|
|
498
|
-
const ret = wasm.compile_source_workspace_to_mir_messagepack(ptr0, len0, ptr1, len1, sample_rate, block_size, ptr2, len2);
|
|
501
|
+
const ret = wasm.compile_source_workspace_to_mir_messagepack(ptr0, len0, ptr1, len1, sample_rate, block_size, default_param_smoothing_seconds, ptr2, len2);
|
|
499
502
|
if (ret[2]) {
|
|
500
503
|
throw takeFromExternrefTable0(ret[1]);
|
|
501
504
|
}
|
|
@@ -506,15 +509,16 @@ export function compile_source_workspace_to_mir_messagepack(entry_path, sources_
|
|
|
506
509
|
* @param {string} source
|
|
507
510
|
* @param {number} sample_rate
|
|
508
511
|
* @param {number} block_size
|
|
512
|
+
* @param {number} default_param_smoothing_seconds
|
|
509
513
|
* @param {string} constants_json
|
|
510
514
|
* @returns {FrontendJsonCompilation}
|
|
511
515
|
*/
|
|
512
|
-
export function compile_to_mir_json(source, sample_rate, block_size, constants_json) {
|
|
516
|
+
export function compile_to_mir_json(source, sample_rate, block_size, default_param_smoothing_seconds, constants_json) {
|
|
513
517
|
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
514
518
|
const len0 = WASM_VECTOR_LEN;
|
|
515
519
|
const ptr1 = passStringToWasm0(constants_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
516
520
|
const len1 = WASM_VECTOR_LEN;
|
|
517
|
-
const ret = wasm.compile_to_mir_json(ptr0, len0, sample_rate, block_size, ptr1, len1);
|
|
521
|
+
const ret = wasm.compile_to_mir_json(ptr0, len0, sample_rate, block_size, default_param_smoothing_seconds, ptr1, len1);
|
|
518
522
|
if (ret[2]) {
|
|
519
523
|
throw takeFromExternrefTable0(ret[1]);
|
|
520
524
|
}
|
|
@@ -525,15 +529,16 @@ export function compile_to_mir_json(source, sample_rate, block_size, constants_j
|
|
|
525
529
|
* @param {string} source
|
|
526
530
|
* @param {number} sample_rate
|
|
527
531
|
* @param {number} block_size
|
|
532
|
+
* @param {number} default_param_smoothing_seconds
|
|
528
533
|
* @param {string} constants_json
|
|
529
534
|
* @returns {FrontendMessagePackCompilation}
|
|
530
535
|
*/
|
|
531
|
-
export function compile_to_mir_messagepack(source, sample_rate, block_size, constants_json) {
|
|
536
|
+
export function compile_to_mir_messagepack(source, sample_rate, block_size, default_param_smoothing_seconds, constants_json) {
|
|
532
537
|
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
533
538
|
const len0 = WASM_VECTOR_LEN;
|
|
534
539
|
const ptr1 = passStringToWasm0(constants_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
535
540
|
const len1 = WASM_VECTOR_LEN;
|
|
536
|
-
const ret = wasm.compile_to_mir_messagepack(ptr0, len0, sample_rate, block_size, ptr1, len1);
|
|
541
|
+
const ret = wasm.compile_to_mir_messagepack(ptr0, len0, sample_rate, block_size, default_param_smoothing_seconds, ptr1, len1);
|
|
537
542
|
if (ret[2]) {
|
|
538
543
|
throw takeFromExternrefTable0(ret[1]);
|
|
539
544
|
}
|
|
@@ -752,6 +757,23 @@ export function mir_schema_version() {
|
|
|
752
757
|
return ret >>> 0;
|
|
753
758
|
}
|
|
754
759
|
|
|
760
|
+
/**
|
|
761
|
+
* Returns the Onda compiler release version.
|
|
762
|
+
* @returns {string}
|
|
763
|
+
*/
|
|
764
|
+
export function onda_version() {
|
|
765
|
+
let deferred1_0;
|
|
766
|
+
let deferred1_1;
|
|
767
|
+
try {
|
|
768
|
+
const ret = wasm.onda_version();
|
|
769
|
+
deferred1_0 = ret[0];
|
|
770
|
+
deferred1_1 = ret[1];
|
|
771
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
772
|
+
} finally {
|
|
773
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
|
|
755
777
|
/**
|
|
756
778
|
* @returns {number}
|
|
757
779
|
*/
|
|
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) => [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];
|
|
12
|
+
export const compile_project_image_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number, g: 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, i: 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, i: number) => [number, number, number];
|
|
15
|
+
export const compile_to_mir_json: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
|
|
16
|
+
export const compile_to_mir_messagepack: (a: number, b: number, c: number, d: number, e: number, f: number, g: 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];
|
|
@@ -29,6 +29,7 @@ export const inspect_source_compile_constants: (a: number, b: number, c: number,
|
|
|
29
29
|
export const inspect_source_workspace_compile_constants: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
|
|
30
30
|
export const materialize_project_image: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
31
31
|
export const mir_schema_version: () => number;
|
|
32
|
+
export const onda_version: () => [number, number];
|
|
32
33
|
export const ondalsp_handle_message: (a: number, b: number, c: number) => [number, number, number, number];
|
|
33
34
|
export const ondalsp_new: () => number;
|
|
34
35
|
export const ondalsp_set_analysis_options: (a: number, b: number, c: 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.20 (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.20
|
|
708
|
+
- onda_host_protocol 0.8.20
|
|
709
|
+
- onda_lsp 0.8.20
|
|
710
|
+
- onda_mir 0.8.20
|
|
711
|
+
- onda_processor_abi 0.8.20
|
|
712
|
+
- onda_project 0.8.20
|
|
713
|
+
- onda_semantics 0.8.20
|
|
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.20";
|
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.20",
|
|
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.20",
|
|
64
64
|
"binaryen": "130.0.0"
|
|
65
65
|
},
|
|
66
66
|
"publishConfig": {
|
package/src/index.d.ts
CHANGED
|
@@ -54,6 +54,13 @@ 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;
|
|
57
64
|
constants?: Map<string, OndaCompileConstValue>
|
|
58
65
|
| Record<string, OndaCompileConstValue>;
|
|
59
66
|
codegen?: OndaCodegenOptions;
|
package/src/index.js
CHANGED
|
@@ -107,6 +107,7 @@ class OndaCompiler {
|
|
|
107
107
|
source,
|
|
108
108
|
compile.sampleRate,
|
|
109
109
|
compile.blockSize,
|
|
110
|
+
compile.defaultParamSmoothingSeconds,
|
|
110
111
|
compile.constantsJson,
|
|
111
112
|
);
|
|
112
113
|
} catch (error) {
|
|
@@ -153,6 +154,7 @@ class OndaCompiler {
|
|
|
153
154
|
JSON.stringify(workspace.sources),
|
|
154
155
|
compile.sampleRate,
|
|
155
156
|
compile.blockSize,
|
|
157
|
+
compile.defaultParamSmoothingSeconds,
|
|
156
158
|
compile.constantsJson,
|
|
157
159
|
);
|
|
158
160
|
} catch (error) {
|
|
@@ -197,6 +199,7 @@ class OndaCompiler {
|
|
|
197
199
|
bytes,
|
|
198
200
|
compile.sampleRate,
|
|
199
201
|
compile.blockSize,
|
|
202
|
+
compile.defaultParamSmoothingSeconds,
|
|
200
203
|
compile.constantsJson,
|
|
201
204
|
);
|
|
202
205
|
} catch (error) {
|
|
@@ -619,6 +622,7 @@ function normalizeCompileOptions(options) {
|
|
|
619
622
|
}
|
|
620
623
|
return {
|
|
621
624
|
...compile,
|
|
625
|
+
defaultParamSmoothingSeconds: normalizeDefaultParamSmoothingSeconds(options),
|
|
622
626
|
codegen: options.codegen ?? {},
|
|
623
627
|
};
|
|
624
628
|
}
|
|
@@ -638,6 +642,14 @@ function normalizeCompileInputOptions(options) {
|
|
|
638
642
|
};
|
|
639
643
|
}
|
|
640
644
|
|
|
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
|
+
|
|
641
653
|
function normalizeLspAnalysisOptions(options) {
|
|
642
654
|
const context = normalizeContextOptions(options);
|
|
643
655
|
if (options.constants !== undefined) {
|