@scalable-vector-audio/sva-wasm 0.7.8 → 0.7.11
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/package.json +1 -1
- package/sva_wasm.d.ts +20 -15
- package/sva_wasm.js +57 -46
- package/sva_wasm_bg.wasm +0 -0
package/package.json
CHANGED
package/sva_wasm.d.ts
CHANGED
|
@@ -5,15 +5,19 @@ export class Composition {
|
|
|
5
5
|
free(): void;
|
|
6
6
|
[Symbol.dispose](): void;
|
|
7
7
|
clear_cache(): void;
|
|
8
|
+
/**
|
|
9
|
+
* Memory's disk traffic since it opened.
|
|
10
|
+
*/
|
|
11
|
+
counters(): any;
|
|
8
12
|
insert(path: string, text: string): void;
|
|
9
13
|
constructor(name?: string | null);
|
|
10
14
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
15
|
+
* Memory over the store in `dir`, an origin-private file system directory; alone where
|
|
16
|
+
* none opens.
|
|
13
17
|
*/
|
|
14
18
|
static open(name?: string | null, dir?: FileSystemDirectoryHandle | null): Promise<Composition>;
|
|
15
19
|
/**
|
|
16
|
-
* The only
|
|
20
|
+
* The only commit to the directory `open` was handed.
|
|
17
21
|
*/
|
|
18
22
|
persist(): Promise<number>;
|
|
19
23
|
/**
|
|
@@ -24,21 +28,20 @@ export class Composition {
|
|
|
24
28
|
/**
|
|
25
29
|
* `target` as `sva-cli render` takes it, `@piano([0, 2b], f0=C4)`; `representations`
|
|
26
30
|
* what `representations()` answers, `samples` where unset, each a call as
|
|
27
|
-
* `--representation` writes it. `options` sets `rate`, `bits`, `flop_budget`, `until
|
|
28
|
-
* `volatile
|
|
31
|
+
* `--representation` writes it. `options` sets `rate`, `bits`, `flop_budget`, `until` and
|
|
32
|
+
* `volatile`.
|
|
29
33
|
*/
|
|
30
34
|
render(target: string, representations: string[] | null | undefined, options: any): Promise<Rendering>;
|
|
31
35
|
set_cache_policy(policy: string): void;
|
|
32
36
|
set_prune_policy(policy: string): void;
|
|
33
37
|
/**
|
|
34
|
-
* `target` block by block
|
|
35
|
-
* `live`, `channels`.
|
|
38
|
+
* `target` block by block. `options`: `rate`, `bits`, `until`, `live`, `channels`.
|
|
36
39
|
*/
|
|
37
40
|
stream(target: string, block: number, options: any): Promise<Stream>;
|
|
38
41
|
/**
|
|
39
|
-
* `target`
|
|
40
|
-
*
|
|
41
|
-
* `
|
|
42
|
+
* `target` computed into memory as `render` would; `{ stats, representations }`, the
|
|
43
|
+
* latter `representations()` for `readings`. Options: `rate`, `bits`, `flop_budget`,
|
|
44
|
+
* `readings`.
|
|
42
45
|
*/
|
|
43
46
|
warm(target: string, options: any): Promise<any>;
|
|
44
47
|
readonly cache_bytes: number;
|
|
@@ -60,7 +63,7 @@ export class Rendering {
|
|
|
60
63
|
representations(): any;
|
|
61
64
|
samples(channel: number): Float32Array;
|
|
62
65
|
/**
|
|
63
|
-
* Every lookup this render made of
|
|
66
|
+
* Every lookup this render made of memory, and what each came to.
|
|
64
67
|
*/
|
|
65
68
|
stats(): any;
|
|
66
69
|
work(): any;
|
|
@@ -75,7 +78,7 @@ export class Rendering {
|
|
|
75
78
|
* A target block by block, reading `@notes` as the sum of its terms, as `@hall(t, x=@notes)`.
|
|
76
79
|
* A key-up replaces a term with one whose release is a number. A term leaves with its handle
|
|
77
80
|
* once the stream passes its support. An edit lands at the first block boundary
|
|
78
|
-
* once
|
|
81
|
+
* once memory answered it; `read` and getters answer meanwhile.
|
|
79
82
|
*/
|
|
80
83
|
export class Stream {
|
|
81
84
|
private constructor();
|
|
@@ -87,7 +90,8 @@ export class Stream {
|
|
|
87
90
|
*/
|
|
88
91
|
add(term: string, options?: any | null): Promise<number>;
|
|
89
92
|
/**
|
|
90
|
-
* `late`: edits landed
|
|
93
|
+
* `late`: edits landed late; `demands`: reads working out the note sum's asks; `built`:
|
|
94
|
+
* what the latest change did anew; `tier`: memory's disk traffic since it opened.
|
|
91
95
|
*/
|
|
92
96
|
counts(): any;
|
|
93
97
|
/**
|
|
@@ -96,7 +100,7 @@ export class Stream {
|
|
|
96
100
|
*/
|
|
97
101
|
edit(expr: string): Promise<void>;
|
|
98
102
|
/**
|
|
99
|
-
* Reads
|
|
103
|
+
* Reads what the next second plays, a few disk reads a call at most.
|
|
100
104
|
*/
|
|
101
105
|
fetch(): Promise<void>;
|
|
102
106
|
landed(handle: number): number | undefined;
|
|
@@ -150,6 +154,7 @@ export interface InitOutput {
|
|
|
150
154
|
readonly composition_cache_max_bytes: (a: number) => number;
|
|
151
155
|
readonly composition_cache_policy: (a: number) => [number, number];
|
|
152
156
|
readonly composition_clear_cache: (a: number) => void;
|
|
157
|
+
readonly composition_counters: (a: number) => [number, number, number];
|
|
153
158
|
readonly composition_insert: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
154
159
|
readonly composition_new: (a: number, b: number) => number;
|
|
155
160
|
readonly composition_open: (a: number, b: number, c: number) => any;
|
|
@@ -190,7 +195,7 @@ export interface InitOutput {
|
|
|
190
195
|
readonly stream_work: (a: number) => [number, number, number];
|
|
191
196
|
readonly wasm_bindgen__convert__closures_____invoke__h76bd71bceeca2b95: (a: number, b: number, c: any, d: any) => void;
|
|
192
197
|
readonly wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150: (a: number, b: number, c: any) => [number, number];
|
|
193
|
-
readonly
|
|
198
|
+
readonly wasm_bindgen__convert__closures_____invoke__h79de5e4e9fa3346a: (a: number, b: number) => any;
|
|
194
199
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
195
200
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
196
201
|
readonly __wbindgen_exn_store: (a: number) => void;
|
package/sva_wasm.js
CHANGED
|
@@ -63,6 +63,17 @@ export class Composition {
|
|
|
63
63
|
clear_cache() {
|
|
64
64
|
wasm.composition_clear_cache(this.__wbg_ptr);
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Memory's disk traffic since it opened.
|
|
68
|
+
* @returns {any}
|
|
69
|
+
*/
|
|
70
|
+
counters() {
|
|
71
|
+
const ret = wasm.composition_counters(this.__wbg_ptr);
|
|
72
|
+
if (ret[2]) {
|
|
73
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
74
|
+
}
|
|
75
|
+
return takeFromExternrefTable0(ret[0]);
|
|
76
|
+
}
|
|
66
77
|
/**
|
|
67
78
|
* @param {string} path
|
|
68
79
|
* @param {string} text
|
|
@@ -86,8 +97,8 @@ export class Composition {
|
|
|
86
97
|
return this;
|
|
87
98
|
}
|
|
88
99
|
/**
|
|
89
|
-
*
|
|
90
|
-
*
|
|
100
|
+
* Memory over the store in `dir`, an origin-private file system directory; alone where
|
|
101
|
+
* none opens.
|
|
91
102
|
* @param {string | null} [name]
|
|
92
103
|
* @param {FileSystemDirectoryHandle | null} [dir]
|
|
93
104
|
* @returns {Promise<Composition>}
|
|
@@ -99,7 +110,7 @@ export class Composition {
|
|
|
99
110
|
return ret;
|
|
100
111
|
}
|
|
101
112
|
/**
|
|
102
|
-
* The only
|
|
113
|
+
* The only commit to the directory `open` was handed.
|
|
103
114
|
* @returns {Promise<number>}
|
|
104
115
|
*/
|
|
105
116
|
persist() {
|
|
@@ -137,8 +148,8 @@ export class Composition {
|
|
|
137
148
|
/**
|
|
138
149
|
* `target` as `sva-cli render` takes it, `@piano([0, 2b], f0=C4)`; `representations`
|
|
139
150
|
* what `representations()` answers, `samples` where unset, each a call as
|
|
140
|
-
* `--representation` writes it. `options` sets `rate`, `bits`, `flop_budget`, `until
|
|
141
|
-
* `volatile
|
|
151
|
+
* `--representation` writes it. `options` sets `rate`, `bits`, `flop_budget`, `until` and
|
|
152
|
+
* `volatile`.
|
|
142
153
|
* @param {string} target
|
|
143
154
|
* @param {string[] | null | undefined} representations
|
|
144
155
|
* @param {any} options
|
|
@@ -181,8 +192,7 @@ export class Composition {
|
|
|
181
192
|
}
|
|
182
193
|
}
|
|
183
194
|
/**
|
|
184
|
-
* `target` block by block
|
|
185
|
-
* `live`, `channels`.
|
|
195
|
+
* `target` block by block. `options`: `rate`, `bits`, `until`, `live`, `channels`.
|
|
186
196
|
* @param {string} target
|
|
187
197
|
* @param {number} block
|
|
188
198
|
* @param {any} options
|
|
@@ -195,9 +205,9 @@ export class Composition {
|
|
|
195
205
|
return ret;
|
|
196
206
|
}
|
|
197
207
|
/**
|
|
198
|
-
* `target`
|
|
199
|
-
*
|
|
200
|
-
* `
|
|
208
|
+
* `target` computed into memory as `render` would; `{ stats, representations }`, the
|
|
209
|
+
* latter `representations()` for `readings`. Options: `rate`, `bits`, `flop_budget`,
|
|
210
|
+
* `readings`.
|
|
201
211
|
* @param {string} target
|
|
202
212
|
* @param {any} options
|
|
203
213
|
* @returns {Promise<any>}
|
|
@@ -282,7 +292,7 @@ export class Rendering {
|
|
|
282
292
|
return ret;
|
|
283
293
|
}
|
|
284
294
|
/**
|
|
285
|
-
* Every lookup this render made of
|
|
295
|
+
* Every lookup this render made of memory, and what each came to.
|
|
286
296
|
* @returns {any}
|
|
287
297
|
*/
|
|
288
298
|
stats() {
|
|
@@ -324,7 +334,7 @@ if (Symbol.dispose) Rendering.prototype[Symbol.dispose] = Rendering.prototype.fr
|
|
|
324
334
|
* A target block by block, reading `@notes` as the sum of its terms, as `@hall(t, x=@notes)`.
|
|
325
335
|
* A key-up replaces a term with one whose release is a number. A term leaves with its handle
|
|
326
336
|
* once the stream passes its support. An edit lands at the first block boundary
|
|
327
|
-
* once
|
|
337
|
+
* once memory answered it; `read` and getters answer meanwhile.
|
|
328
338
|
*/
|
|
329
339
|
export class Stream {
|
|
330
340
|
static __wrap(ptr) {
|
|
@@ -371,7 +381,8 @@ export class Stream {
|
|
|
371
381
|
return ret >>> 0;
|
|
372
382
|
}
|
|
373
383
|
/**
|
|
374
|
-
* `late`: edits landed
|
|
384
|
+
* `late`: edits landed late; `demands`: reads working out the note sum's asks; `built`:
|
|
385
|
+
* what the latest change did anew; `tier`: memory's disk traffic since it opened.
|
|
375
386
|
* @returns {any}
|
|
376
387
|
*/
|
|
377
388
|
counts() {
|
|
@@ -401,7 +412,7 @@ export class Stream {
|
|
|
401
412
|
return ret[0] === 0 ? undefined : ret[1];
|
|
402
413
|
}
|
|
403
414
|
/**
|
|
404
|
-
* Reads
|
|
415
|
+
* Reads what the next second plays, a few disk reads a call at most.
|
|
405
416
|
* @returns {Promise<void>}
|
|
406
417
|
*/
|
|
407
418
|
fetch() {
|
|
@@ -576,7 +587,7 @@ function __wbg_get_imports() {
|
|
|
576
587
|
__wbg__wbg_cb_unref_997e73d32238e655: function(arg0) {
|
|
577
588
|
arg0._wbg_cb_unref();
|
|
578
589
|
},
|
|
579
|
-
|
|
590
|
+
__wbg_arrayBuffer_f07c2e90cd52db62: function(arg0) {
|
|
580
591
|
const ret = arg0.arrayBuffer();
|
|
581
592
|
return ret;
|
|
582
593
|
},
|
|
@@ -588,7 +599,7 @@ function __wbg_get_imports() {
|
|
|
588
599
|
const ret = arg0.call(arg1, arg2);
|
|
589
600
|
return ret;
|
|
590
601
|
}, arguments); },
|
|
591
|
-
|
|
602
|
+
__wbg_close_18d7e291293c297d: function(arg0) {
|
|
592
603
|
const ret = arg0.close();
|
|
593
604
|
return ret;
|
|
594
605
|
},
|
|
@@ -596,7 +607,7 @@ function __wbg_get_imports() {
|
|
|
596
607
|
const ret = Composition.__wrap(arg0);
|
|
597
608
|
return ret;
|
|
598
609
|
},
|
|
599
|
-
|
|
610
|
+
__wbg_createWritable_96ad69f25b5e0aa3: function(arg0) {
|
|
600
611
|
const ret = arg0.createWritable();
|
|
601
612
|
return ret;
|
|
602
613
|
},
|
|
@@ -608,15 +619,15 @@ function __wbg_get_imports() {
|
|
|
608
619
|
const ret = Array.from(arg0);
|
|
609
620
|
return ret;
|
|
610
621
|
},
|
|
611
|
-
|
|
622
|
+
__wbg_getDirectoryHandle_4cf01a0ef8dc8838: function(arg0, arg1, arg2, arg3) {
|
|
612
623
|
const ret = arg0.getDirectoryHandle(getStringFromWasm0(arg1, arg2), arg3);
|
|
613
624
|
return ret;
|
|
614
625
|
},
|
|
615
|
-
|
|
626
|
+
__wbg_getFileHandle_0a0196d063101c06: function(arg0, arg1, arg2, arg3) {
|
|
616
627
|
const ret = arg0.getFileHandle(getStringFromWasm0(arg1, arg2), arg3);
|
|
617
628
|
return ret;
|
|
618
629
|
},
|
|
619
|
-
|
|
630
|
+
__wbg_getFile_87457664a94e628d: function(arg0) {
|
|
620
631
|
const ret = arg0.getFile();
|
|
621
632
|
return ret;
|
|
622
633
|
},
|
|
@@ -646,7 +657,7 @@ function __wbg_get_imports() {
|
|
|
646
657
|
const ret = Array.isArray(arg0);
|
|
647
658
|
return ret;
|
|
648
659
|
},
|
|
649
|
-
|
|
660
|
+
__wbg_keys_8838facd131c6680: function(arg0) {
|
|
650
661
|
const ret = arg0.keys();
|
|
651
662
|
return ret;
|
|
652
663
|
},
|
|
@@ -662,11 +673,11 @@ function __wbg_get_imports() {
|
|
|
662
673
|
const ret = arg0.length;
|
|
663
674
|
return ret;
|
|
664
675
|
},
|
|
665
|
-
|
|
676
|
+
__wbg_move_e9f3888afdee5378: function(arg0, arg1, arg2, arg3) {
|
|
666
677
|
const ret = arg0.move(arg1, getStringFromWasm0(arg2, arg3));
|
|
667
678
|
return ret;
|
|
668
679
|
},
|
|
669
|
-
|
|
680
|
+
__wbg_name_b2a0e8fa7dc9f795: function(arg0, arg1) {
|
|
670
681
|
const ret = arg1.name;
|
|
671
682
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
672
683
|
const len1 = WASM_VECTOR_LEN;
|
|
@@ -695,12 +706,12 @@ function __wbg_get_imports() {
|
|
|
695
706
|
state0.a = 0;
|
|
696
707
|
}
|
|
697
708
|
},
|
|
698
|
-
|
|
699
|
-
const ret = new
|
|
709
|
+
__wbg_new_94977a6bac8d2087: function(arg0, arg1) {
|
|
710
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
700
711
|
return ret;
|
|
701
712
|
},
|
|
702
|
-
|
|
703
|
-
const ret = new
|
|
713
|
+
__wbg_new_bebc3f4757acf305: function() {
|
|
714
|
+
const ret = new Object();
|
|
704
715
|
return ret;
|
|
705
716
|
},
|
|
706
717
|
__wbg_new_from_slice_4ee02165f9de919e: function(arg0, arg1) {
|
|
@@ -725,18 +736,18 @@ function __wbg_get_imports() {
|
|
|
725
736
|
state0.a = 0;
|
|
726
737
|
}
|
|
727
738
|
},
|
|
728
|
-
|
|
739
|
+
__wbg_next_6ce8c52a5e93c951: function(arg0) {
|
|
729
740
|
const ret = arg0.next();
|
|
730
741
|
return ret;
|
|
731
742
|
},
|
|
732
|
-
|
|
743
|
+
__wbg_parse_137470364fb37b46: function() { return handleError(function (arg0, arg1) {
|
|
733
744
|
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
734
745
|
return ret;
|
|
735
746
|
}, arguments); },
|
|
736
747
|
__wbg_prototypesetcall_ae9f5e7459250748: function(arg0, arg1, arg2) {
|
|
737
748
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
738
749
|
},
|
|
739
|
-
|
|
750
|
+
__wbg_query_5c7287509234c779: function(arg0) {
|
|
740
751
|
const ret = arg0.query();
|
|
741
752
|
return ret;
|
|
742
753
|
},
|
|
@@ -751,19 +762,19 @@ function __wbg_get_imports() {
|
|
|
751
762
|
const ret = Math.random();
|
|
752
763
|
return ret;
|
|
753
764
|
},
|
|
754
|
-
|
|
755
|
-
const ret = arg0.removeEntry(getStringFromWasm0(arg1, arg2));
|
|
765
|
+
__wbg_removeEntry_08e6fab1462cddc0: function(arg0, arg1, arg2, arg3) {
|
|
766
|
+
const ret = arg0.removeEntry(getStringFromWasm0(arg1, arg2), arg3);
|
|
756
767
|
return ret;
|
|
757
768
|
},
|
|
758
|
-
|
|
759
|
-
const ret = arg0.removeEntry(getStringFromWasm0(arg1, arg2)
|
|
769
|
+
__wbg_removeEntry_b76635b0f1b39807: function(arg0, arg1, arg2) {
|
|
770
|
+
const ret = arg0.removeEntry(getStringFromWasm0(arg1, arg2));
|
|
760
771
|
return ret;
|
|
761
772
|
},
|
|
762
773
|
__wbg_rendering_new: function(arg0) {
|
|
763
774
|
const ret = Rendering.__wrap(arg0);
|
|
764
775
|
return ret;
|
|
765
776
|
},
|
|
766
|
-
|
|
777
|
+
__wbg_request_4b258bd4e8d59718: function(arg0, arg1, arg2, arg3) {
|
|
767
778
|
const ret = arg0.request(getStringFromWasm0(arg1, arg2), arg3);
|
|
768
779
|
return ret;
|
|
769
780
|
},
|
|
@@ -778,17 +789,17 @@ function __wbg_get_imports() {
|
|
|
778
789
|
__wbg_set_c41f8dbc07a2190f: function(arg0, arg1, arg2) {
|
|
779
790
|
arg0.set(getArrayF32FromWasm0(arg1, arg2));
|
|
780
791
|
},
|
|
781
|
-
|
|
792
|
+
__wbg_set_name_ad160d0021c74277: function(arg0, arg1, arg2) {
|
|
782
793
|
arg0.name = getStringFromWasm0(arg1, arg2);
|
|
783
794
|
},
|
|
784
|
-
|
|
795
|
+
__wbg_set_refusal_6e56234e4d6c3daf: function(arg0, arg1) {
|
|
785
796
|
arg0.refusal = arg1;
|
|
786
797
|
},
|
|
787
|
-
|
|
798
|
+
__wbg_size_2e4cce3f7e2afea9: function(arg0) {
|
|
788
799
|
const ret = arg0.size;
|
|
789
800
|
return ret;
|
|
790
801
|
},
|
|
791
|
-
|
|
802
|
+
__wbg_slice_7e86f72fd9fb87c2: function(arg0, arg1, arg2) {
|
|
792
803
|
const ret = arg0.slice(arg1, arg2);
|
|
793
804
|
return ret;
|
|
794
805
|
},
|
|
@@ -824,21 +835,21 @@ function __wbg_get_imports() {
|
|
|
824
835
|
const ret = arg0.then(arg1);
|
|
825
836
|
return ret;
|
|
826
837
|
},
|
|
827
|
-
|
|
838
|
+
__wbg_warn_fd5541c02e4e31a7: function(arg0, arg1) {
|
|
828
839
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
829
840
|
},
|
|
830
|
-
|
|
841
|
+
__wbg_write_92f3f2f851dd835e: function(arg0, arg1) {
|
|
831
842
|
const ret = arg0.write(arg1);
|
|
832
843
|
return ret;
|
|
833
844
|
},
|
|
834
845
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
835
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
846
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 541, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
836
847
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hd55bb211d6a08150);
|
|
837
848
|
return ret;
|
|
838
849
|
},
|
|
839
850
|
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
840
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
841
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
851
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 101, ret: NamedExternref("Promise<any>"), inner_ret: Some(NamedExternref("Promise<any>")) }, mutable: true }) -> Externref`.
|
|
852
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h79de5e4e9fa3346a);
|
|
842
853
|
return ret;
|
|
843
854
|
},
|
|
844
855
|
__wbindgen_generic_0000000000000003: function(arg0) {
|
|
@@ -867,8 +878,8 @@ function __wbg_get_imports() {
|
|
|
867
878
|
};
|
|
868
879
|
}
|
|
869
880
|
|
|
870
|
-
function
|
|
871
|
-
const ret = wasm.
|
|
881
|
+
function wasm_bindgen__convert__closures_____invoke__h79de5e4e9fa3346a(arg0, arg1) {
|
|
882
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h79de5e4e9fa3346a(arg0, arg1);
|
|
872
883
|
return ret;
|
|
873
884
|
}
|
|
874
885
|
|
package/sva_wasm_bg.wasm
CHANGED
|
Binary file
|