@scalable-vector-audio/sva-wasm 0.14.19 → 0.14.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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@scalable-vector-audio/sva-wasm",
3
3
  "type": "module",
4
4
  "description": "JS bindings: a composition a page fills node by node, rendered in the browser",
5
- "version": "0.14.19",
5
+ "version": "0.14.20",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
package/sva_wasm.d.ts CHANGED
@@ -166,6 +166,10 @@ export class Composition {
166
166
  * Memory's disk traffic since it opened.
167
167
  */
168
168
  counters(): any;
169
+ /**
170
+ * What `sample("<path>")` reads: one decoded Float32Array per channel, at `rate`.
171
+ */
172
+ insertRecording(path: string, rate: number, channels: Array<any>): void;
169
173
  insert(path: string, text: string): void;
170
174
  constructor(name?: string | null);
171
175
  /**
@@ -185,6 +189,10 @@ export class Composition {
185
189
  * `AbortError` before its next block.
186
190
  */
187
191
  render(target: string, representations: string[] | null | undefined, options: any): Promise<Rendering>;
192
+ /**
193
+ * `sva-cli solve`'s envelope; `options` as its flags, `signal` and `progress(line)`.
194
+ */
195
+ solve(cost: string, vary: string[], options: any): Promise<any>;
188
196
  /**
189
197
  * `target`'s placed notes as `sva-cli outline @score/song` lists them, under
190
198
  * `options.set` as `render` takes it: `{ song, events }`, each with `at`, `sounds`,
@@ -347,11 +355,13 @@ export interface InitOutput {
347
355
  readonly composition_cache_max_bytes: (a: number) => number;
348
356
  readonly composition_counters: (a: number) => [number, number, number];
349
357
  readonly composition_insert: (a: number, b: number, c: number, d: number, e: number) => void;
358
+ readonly composition_insertRecording: (a: number, b: number, c: number, d: number, e: any) => [number, number];
350
359
  readonly composition_new: (a: number, b: number) => number;
351
360
  readonly composition_open: (a: number, b: number, c: number, d: any) => any;
352
361
  readonly composition_persist: (a: number) => any;
353
362
  readonly composition_render: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
354
363
  readonly composition_set_cache_max_bytes: (a: number, b: number) => void;
364
+ readonly composition_solve: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
355
365
  readonly composition_song: (a: number, b: number, c: number, d: any) => [number, number, number];
356
366
  readonly composition_store_bytes: (a: number) => [number, number];
357
367
  readonly composition_store_max_bytes: (a: number) => [number, number];
package/sva_wasm.js CHANGED
@@ -58,6 +58,20 @@ export class Composition {
58
58
  }
59
59
  return takeFromExternrefTable0(ret[0]);
60
60
  }
61
+ /**
62
+ * What `sample("<path>")` reads: one decoded Float32Array per channel, at `rate`.
63
+ * @param {string} path
64
+ * @param {number} rate
65
+ * @param {Array<any>} channels
66
+ */
67
+ insertRecording(path, rate, channels) {
68
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
69
+ const len0 = WASM_VECTOR_LEN;
70
+ const ret = wasm.composition_insertRecording(this.__wbg_ptr, ptr0, len0, rate, channels);
71
+ if (ret[1]) {
72
+ throw takeFromExternrefTable0(ret[0]);
73
+ }
74
+ }
61
75
  /**
62
76
  * @param {string} path
63
77
  * @param {string} text
@@ -127,6 +141,21 @@ export class Composition {
127
141
  set cache_max_bytes(max_bytes) {
128
142
  wasm.composition_set_cache_max_bytes(this.__wbg_ptr, max_bytes);
129
143
  }
144
+ /**
145
+ * `sva-cli solve`'s envelope; `options` as its flags, `signal` and `progress(line)`.
146
+ * @param {string} cost
147
+ * @param {string[]} vary
148
+ * @param {any} options
149
+ * @returns {Promise<any>}
150
+ */
151
+ solve(cost, vary, options) {
152
+ const ptr0 = passStringToWasm0(cost, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
153
+ const len0 = WASM_VECTOR_LEN;
154
+ const ptr1 = passArrayJsValueToWasm0(vary, wasm.__wbindgen_malloc);
155
+ const len1 = WASM_VECTOR_LEN;
156
+ const ret = wasm.composition_solve(this.__wbg_ptr, ptr0, len0, ptr1, len1, options);
157
+ return ret;
158
+ }
130
159
  /**
131
160
  * `target`'s placed notes as `sva-cli outline @score/song` lists them, under
132
161
  * `options.set` as `render` takes it: `{ song, events }`, each with `at`, `sounds`,
@@ -653,7 +682,7 @@ function __wbg_get_imports(memory) {
653
682
  __wbg__wbg_cb_unref_997e73d32238e655: function(arg0) {
654
683
  arg0._wbg_cb_unref();
655
684
  },
656
- __wbg_arrayBuffer_f365fd580ffa1c92: function(arg0) {
685
+ __wbg_arrayBuffer_e29603fbb7413792: function(arg0) {
657
686
  const ret = arg0.arrayBuffer();
658
687
  return ret;
659
688
  },
@@ -673,18 +702,18 @@ function __wbg_get_imports(memory) {
673
702
  const ret = arg0.call(arg1, arg2);
674
703
  return ret;
675
704
  }, arguments); },
676
- __wbg_close_5cd20013e7972c42: function(arg0) {
705
+ __wbg_close_0058ba3abbb2e948: function(arg0) {
706
+ arg0.close();
707
+ },
708
+ __wbg_close_4d96984e1092a65a: function(arg0) {
677
709
  const ret = arg0.close();
678
710
  return ret;
679
711
  },
680
- __wbg_close_ca83fbed995e2e01: function(arg0) {
681
- arg0.close();
682
- },
683
712
  __wbg_composition_new: function(arg0) {
684
713
  const ret = Composition.__wrap(arg0);
685
714
  return ret;
686
715
  },
687
- __wbg_createWritable_48566cc7e2a7a3c2: function(arg0) {
716
+ __wbg_createWritable_db9efbff89d31a22: function(arg0) {
688
717
  const ret = arg0.createWritable();
689
718
  return ret;
690
719
  },
@@ -700,15 +729,15 @@ function __wbg_get_imports(memory) {
700
729
  const ret = Array.from(arg0);
701
730
  return ret;
702
731
  },
703
- __wbg_getDirectoryHandle_add98c3ed0bcb1e5: function(arg0, arg1, arg2, arg3) {
732
+ __wbg_getDirectoryHandle_65154acb323edb5a: function(arg0, arg1, arg2, arg3) {
704
733
  const ret = arg0.getDirectoryHandle(getStringFromWasm0(arg1, arg2), arg3);
705
734
  return ret;
706
735
  },
707
- __wbg_getFileHandle_50a8e51835eb1893: function(arg0, arg1, arg2, arg3) {
736
+ __wbg_getFileHandle_ac6d479cbce76278: function(arg0, arg1, arg2, arg3) {
708
737
  const ret = arg0.getFileHandle(getStringFromWasm0(arg1, arg2), arg3);
709
738
  return ret;
710
739
  },
711
- __wbg_getFile_00276f661752b0d7: function(arg0) {
740
+ __wbg_getFile_fc773e65f7a96603: function(arg0) {
712
741
  const ret = arg0.getFile();
713
742
  return ret;
714
743
  },
@@ -762,7 +791,7 @@ function __wbg_get_imports(memory) {
762
791
  const ret = Array.isArray(arg0);
763
792
  return ret;
764
793
  },
765
- __wbg_keys_143bcb9163ce7059: function(arg0) {
794
+ __wbg_keys_b3b8cf7df8baa503: function(arg0) {
766
795
  const ret = arg0.keys();
767
796
  return ret;
768
797
  },
@@ -778,11 +807,11 @@ function __wbg_get_imports(memory) {
778
807
  const ret = arg0.length;
779
808
  return ret;
780
809
  },
781
- __wbg_move_e01680a9e2f56ad2: function(arg0, arg1, arg2, arg3) {
810
+ __wbg_move_9f7a9e1981813461: function(arg0, arg1, arg2, arg3) {
782
811
  const ret = arg0.move(arg1, getStringFromWasm0(arg2, arg3));
783
812
  return ret;
784
813
  },
785
- __wbg_name_334a3c5f2443d864: function(arg0, arg1) {
814
+ __wbg_name_629e048da2876a10: function(arg0, arg1) {
786
815
  const ret = arg1.name;
787
816
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
788
817
  const len1 = WASM_VECTOR_LEN;
@@ -793,10 +822,18 @@ function __wbg_get_imports(memory) {
793
822
  const ret = new Int32Array(arg0);
794
823
  return ret;
795
824
  },
825
+ __wbg_new_0d715b19bdf9498c: function() {
826
+ const ret = new MessageChannel();
827
+ return ret;
828
+ },
796
829
  __wbg_new_1da3429bc3c4541c: function(arg0) {
797
830
  const ret = new Uint8Array(arg0);
798
831
  return ret;
799
832
  },
833
+ __wbg_new_7c7f106d53cf296c: function(arg0, arg1) {
834
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
835
+ return ret;
836
+ },
800
837
  __wbg_new_8f72ed7c652bf5a2: function(arg0, arg1) {
801
838
  try {
802
839
  var state0 = {a: arg0, b: arg1};
@@ -815,18 +852,10 @@ function __wbg_get_imports(memory) {
815
852
  state0.a = 0;
816
853
  }
817
854
  },
818
- __wbg_new_90b5023f00fd5dae: function() {
819
- const ret = new MessageChannel();
820
- return ret;
821
- },
822
855
  __wbg_new_bebc3f4757acf305: function() {
823
856
  const ret = new Object();
824
857
  return ret;
825
858
  },
826
- __wbg_new_bf196fe205c10ce4: function(arg0, arg1) {
827
- const ret = new Error(getStringFromWasm0(arg0, arg1));
828
- return ret;
829
- },
830
859
  __wbg_new_ffa92086ea89f79c: function() {
831
860
  const ret = new Array();
832
861
  return ret;
@@ -857,7 +886,7 @@ function __wbg_get_imports(memory) {
857
886
  const ret = new Worker(getStringFromWasm0(arg0, arg1));
858
887
  return ret;
859
888
  },
860
- __wbg_next_38533dcc88e18634: function(arg0) {
889
+ __wbg_next_9176f5a2a54ca305: function(arg0) {
861
890
  const ret = arg0.next();
862
891
  return ret;
863
892
  },
@@ -865,19 +894,19 @@ function __wbg_get_imports(memory) {
865
894
  const ret = Array.of(arg0, arg1, arg2);
866
895
  return ret;
867
896
  },
868
- __wbg_parse_d26e3971af323908: function() { return handleError(function (arg0, arg1) {
897
+ __wbg_parse_e3be4b13e18b6b18: function() { return handleError(function (arg0, arg1) {
869
898
  const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
870
899
  return ret;
871
900
  }, arguments); },
872
- __wbg_port1_d1e66566011cf5d6: function(arg0) {
901
+ __wbg_port1_a98064467b620bec: function(arg0) {
873
902
  const ret = arg0.port1;
874
903
  return ret;
875
904
  },
876
- __wbg_port2_97c25116adc33c01: function(arg0) {
905
+ __wbg_port2_33b8daafa45e2100: function(arg0) {
877
906
  const ret = arg0.port2;
878
907
  return ret;
879
908
  },
880
- __wbg_postMessage_05d98e1b5fb6a5e6: function(arg0, arg1) {
909
+ __wbg_postMessage_4e60d208733dd268: function(arg0, arg1) {
881
910
  arg0.postMessage(arg1);
882
911
  },
883
912
  __wbg_postMessage_8105a302ed002474: function() { return handleError(function (arg0, arg1) {
@@ -893,7 +922,7 @@ function __wbg_get_imports(memory) {
893
922
  const ret = arg0.push(arg1);
894
923
  return ret;
895
924
  },
896
- __wbg_query_bb29a13e5e5c0b71: function(arg0) {
925
+ __wbg_query_51024f18d035960d: function(arg0) {
897
926
  const ret = arg0.query();
898
927
  return ret;
899
928
  },
@@ -908,11 +937,11 @@ function __wbg_get_imports(memory) {
908
937
  const ret = Math.random();
909
938
  return ret;
910
939
  },
911
- __wbg_removeEntry_def05bd290316e64: function(arg0, arg1, arg2, arg3) {
940
+ __wbg_removeEntry_e4d944c91e6cf2f6: function(arg0, arg1, arg2, arg3) {
912
941
  const ret = arg0.removeEntry(getStringFromWasm0(arg1, arg2), arg3);
913
942
  return ret;
914
943
  },
915
- __wbg_removeEntry_f2b2235439b08db2: function(arg0, arg1, arg2) {
944
+ __wbg_removeEntry_e5b8506039a55bdb: function(arg0, arg1, arg2) {
916
945
  const ret = arg0.removeEntry(getStringFromWasm0(arg1, arg2));
917
946
  return ret;
918
947
  },
@@ -920,7 +949,7 @@ function __wbg_get_imports(memory) {
920
949
  const ret = Rendering.__wrap(arg0);
921
950
  return ret;
922
951
  },
923
- __wbg_request_779634d0b0a144df: function(arg0, arg1, arg2, arg3) {
952
+ __wbg_request_1ac049ca0cd0b19a: function(arg0, arg1, arg2, arg3) {
924
953
  const ret = arg0.request(getStringFromWasm0(arg1, arg2), arg3);
925
954
  return ret;
926
955
  },
@@ -935,23 +964,23 @@ function __wbg_get_imports(memory) {
935
964
  __wbg_set_c41f8dbc07a2190f: function(arg0, arg1, arg2) {
936
965
  arg0.set(getArrayF32FromWasm0(arg1, arg2));
937
966
  },
938
- __wbg_set_name_8240acd4f45229dd: function(arg0, arg1, arg2) {
967
+ __wbg_set_name_bc9162a3ae0bc5eb: function(arg0, arg1, arg2) {
939
968
  arg0.name = getStringFromWasm0(arg1, arg2);
940
969
  },
941
970
  __wbg_set_onmessage_2244c2525c4e0c38: function(arg0, arg1) {
942
971
  arg0.onmessage = arg1;
943
972
  },
944
- __wbg_set_onmessage_4bf364c93dfb7e69: function(arg0, arg1) {
973
+ __wbg_set_onmessage_d5536090d1c54a1f: function(arg0, arg1) {
945
974
  arg0.onmessage = arg1;
946
975
  },
947
- __wbg_set_refusal_980a0e509d192702: function(arg0, arg1) {
976
+ __wbg_set_refusal_02cb46b24b0c05ca: function(arg0, arg1) {
948
977
  arg0.refusal = arg1;
949
978
  },
950
- __wbg_size_8266988606a2465b: function(arg0) {
979
+ __wbg_size_12001a980cb86c23: function(arg0) {
951
980
  const ret = arg0.size;
952
981
  return ret;
953
982
  },
954
- __wbg_slice_89649fead5d0a65f: function(arg0, arg1, arg2) {
983
+ __wbg_slice_92746a756d29cf21: function(arg0, arg1, arg2) {
955
984
  const ret = arg0.slice(arg1, arg2);
956
985
  return ret;
957
986
  },
@@ -1011,10 +1040,10 @@ function __wbg_get_imports(memory) {
1011
1040
  const ret = Atomics.waitAsync;
1012
1041
  return ret;
1013
1042
  },
1014
- __wbg_warn_2569b4620c2a7628: function(arg0, arg1) {
1043
+ __wbg_warn_fe0e62581cc260ab: function(arg0, arg1) {
1015
1044
  console.warn(getStringFromWasm0(arg0, arg1));
1016
1045
  },
1017
- __wbg_write_b3d60f38c3824b10: function(arg0, arg1) {
1046
+ __wbg_write_6325ef1ba9abab0d: function(arg0, arg1) {
1018
1047
  const ret = arg0.write(arg1);
1019
1048
  return ret;
1020
1049
  },
@@ -1024,12 +1053,12 @@ function __wbg_get_imports(memory) {
1024
1053
  return ret;
1025
1054
  },
1026
1055
  __wbindgen_generic_0000000000000002: function(arg0, arg1) {
1027
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 558, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1056
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 582, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1028
1057
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d3a5247b0aa3f0ac___convert__closures_____invoke___wasm_bindgen_d3a5247b0aa3f0ac___JsValue__core_ea519e494776717c___result__Result_____wasm_bindgen_d3a5247b0aa3f0ac___JsError___true_);
1029
1058
  return ret;
1030
1059
  },
1031
1060
  __wbindgen_generic_0000000000000003: function(arg0, arg1) {
1032
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 560, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1061
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 584, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1033
1062
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_d3a5247b0aa3f0ac___convert__closures_____invoke___js_sys_2b088e2931f41c5___futures__task__wait_async_polyfill__MessageEvent______true_);
1034
1063
  return ret;
1035
1064
  },
package/sva_wasm_bg.wasm CHANGED
Binary file