@octoseq/visualiser 0.1.0-main.0d2814e → 0.1.0-main.4baa7cd

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octoseq/visualiser",
3
- "version": "0.1.0-main.0d2814e",
3
+ "version": "0.1.0-main.4baa7cd",
4
4
  "description": "WASM-based visualiser for Octoseq",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -18,6 +18,15 @@ export class WasmVisualiser {
18
18
  * The signal will be available as `inputs.<name>` in Rhai scripts.
19
19
  */
20
20
  push_signal(name: string, samples: Float32Array, sample_rate: number): void;
21
+ /**
22
+ * Run script in analysis mode to collect debug.emit() signals.
23
+ *
24
+ * This runs the script headlessly across the full track duration,
25
+ * collecting all debug.emit() calls without rendering.
26
+ *
27
+ * Returns a JSON-serialized AnalysisResultJson.
28
+ */
29
+ run_analysis(script: string, duration: number, time_step: number): string;
21
30
  /**
22
31
  * Clear all named signals.
23
32
  */
@@ -62,14 +71,15 @@ export interface InitOutput {
62
71
  readonly wasmvisualiser_push_zoom_data: (a: number, b: number, c: number, d: number) => void;
63
72
  readonly wasmvisualiser_render: (a: number, b: number) => void;
64
73
  readonly wasmvisualiser_resize: (a: number, b: number, c: number) => void;
74
+ readonly wasmvisualiser_run_analysis: (a: number, b: number, c: number, d: number, e: number) => [number, number];
65
75
  readonly wasmvisualiser_set_sigmoid_k: (a: number, b: number) => void;
66
76
  readonly wasmvisualiser_set_time: (a: number, b: number) => void;
67
77
  readonly wasmvisualiser_push_rotation_data: (a: number, b: number, c: number, d: number) => void;
68
78
  readonly init_panic_hook: () => void;
69
- readonly wasm_bindgen__convert__closures_____invoke__h53437a38721e89f7: (a: number, b: number, c: any) => void;
70
- readonly wasm_bindgen__closure__destroy__hf5eaa61ced318e08: (a: number, b: number) => void;
71
79
  readonly wasm_bindgen__convert__closures_____invoke__h9d1c5a23ecfcd5c8: (a: number, b: number, c: any) => void;
72
80
  readonly wasm_bindgen__closure__destroy__heb49a8f426ac2d2e: (a: number, b: number) => void;
81
+ readonly wasm_bindgen__convert__closures_____invoke__h53437a38721e89f7: (a: number, b: number, c: any) => void;
82
+ readonly wasm_bindgen__closure__destroy__hf5eaa61ced318e08: (a: number, b: number) => void;
73
83
  readonly wasm_bindgen__convert__closures_____invoke__h320f3d825d3712ba: (a: number, b: number, c: any, d: any) => void;
74
84
  readonly __wbindgen_malloc: (a: number, b: number) => number;
75
85
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
package/pkg/visualiser.js CHANGED
@@ -241,14 +241,14 @@ if (!('encodeInto' in cachedTextEncoder)) {
241
241
 
242
242
  let WASM_VECTOR_LEN = 0;
243
243
 
244
- function wasm_bindgen__convert__closures_____invoke__h53437a38721e89f7(arg0, arg1, arg2) {
245
- wasm.wasm_bindgen__convert__closures_____invoke__h53437a38721e89f7(arg0, arg1, arg2);
246
- }
247
-
248
244
  function wasm_bindgen__convert__closures_____invoke__h9d1c5a23ecfcd5c8(arg0, arg1, arg2) {
249
245
  wasm.wasm_bindgen__convert__closures_____invoke__h9d1c5a23ecfcd5c8(arg0, arg1, arg2);
250
246
  }
251
247
 
248
+ function wasm_bindgen__convert__closures_____invoke__h53437a38721e89f7(arg0, arg1, arg2) {
249
+ wasm.wasm_bindgen__convert__closures_____invoke__h53437a38721e89f7(arg0, arg1, arg2);
250
+ }
251
+
252
252
  function wasm_bindgen__convert__closures_____invoke__h320f3d825d3712ba(arg0, arg1, arg2, arg3) {
253
253
  wasm.wasm_bindgen__convert__closures_____invoke__h320f3d825d3712ba(arg0, arg1, arg2, arg3);
254
254
  }
@@ -319,6 +319,32 @@ export class WasmVisualiser {
319
319
  const len1 = WASM_VECTOR_LEN;
320
320
  wasm.wasmvisualiser_push_signal(this.__wbg_ptr, ptr0, len0, ptr1, len1, sample_rate);
321
321
  }
322
+ /**
323
+ * Run script in analysis mode to collect debug.emit() signals.
324
+ *
325
+ * This runs the script headlessly across the full track duration,
326
+ * collecting all debug.emit() calls without rendering.
327
+ *
328
+ * Returns a JSON-serialized AnalysisResultJson.
329
+ * @param {string} script
330
+ * @param {number} duration
331
+ * @param {number} time_step
332
+ * @returns {string}
333
+ */
334
+ run_analysis(script, duration, time_step) {
335
+ let deferred2_0;
336
+ let deferred2_1;
337
+ try {
338
+ const ptr0 = passStringToWasm0(script, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
339
+ const len0 = WASM_VECTOR_LEN;
340
+ const ret = wasm.wasmvisualiser_run_analysis(this.__wbg_ptr, ptr0, len0, duration, time_step);
341
+ deferred2_0 = ret[0];
342
+ deferred2_1 = ret[1];
343
+ return getStringFromWasm0(ret[0], ret[1]);
344
+ } finally {
345
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
346
+ }
347
+ }
322
348
  /**
323
349
  * Clear all named signals.
324
350
  */
@@ -1273,19 +1299,14 @@ function __wbg_get_imports() {
1273
1299
  imports.wbg.__wbg_writeTexture_246118eb2f5a1592 = function(arg0, arg1, arg2, arg3, arg4) {
1274
1300
  arg0.writeTexture(arg1, arg2, arg3, arg4);
1275
1301
  };
1276
- imports.wbg.__wbindgen_cast_1ad8672233d2fd7b = function(arg0, arg1) {
1277
- // Cast intrinsic for `Closure(Closure { dtor_idx: 2007, function: Function { arguments: [Externref], shim_idx: 2008, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1278
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hf5eaa61ced318e08, wasm_bindgen__convert__closures_____invoke__h53437a38721e89f7);
1279
- return ret;
1280
- };
1281
1302
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1282
1303
  // Cast intrinsic for `Ref(String) -> Externref`.
1283
1304
  const ret = getStringFromWasm0(arg0, arg1);
1284
1305
  return ret;
1285
1306
  };
1286
- imports.wbg.__wbindgen_cast_762879c56a766cac = function(arg0, arg1) {
1287
- // Cast intrinsic for `Closure(Closure { dtor_idx: 1873, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 1874, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1288
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__heb49a8f426ac2d2e, wasm_bindgen__convert__closures_____invoke__h9d1c5a23ecfcd5c8);
1307
+ imports.wbg.__wbindgen_cast_a940bba3a504385a = function(arg0, arg1) {
1308
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 2004, function: Function { arguments: [Externref], shim_idx: 2005, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1309
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hf5eaa61ced318e08, wasm_bindgen__convert__closures_____invoke__h53437a38721e89f7);
1289
1310
  return ret;
1290
1311
  };
1291
1312
  imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
@@ -1298,6 +1319,11 @@ function __wbg_get_imports() {
1298
1319
  const ret = arg0;
1299
1320
  return ret;
1300
1321
  };
1322
+ imports.wbg.__wbindgen_cast_da826c7c17cbbe12 = function(arg0, arg1) {
1323
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1870, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 1871, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1324
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__heb49a8f426ac2d2e, wasm_bindgen__convert__closures_____invoke__h9d1c5a23ecfcd5c8);
1325
+ return ret;
1326
+ };
1301
1327
  imports.wbg.__wbindgen_init_externref_table = function() {
1302
1328
  const table = wasm.__wbindgen_externrefs;
1303
1329
  const offset = table.grow(4);
Binary file
@@ -14,14 +14,15 @@ export const wasmvisualiser_push_signal: (a: number, b: number, c: number, d: nu
14
14
  export const wasmvisualiser_push_zoom_data: (a: number, b: number, c: number, d: number) => void;
15
15
  export const wasmvisualiser_render: (a: number, b: number) => void;
16
16
  export const wasmvisualiser_resize: (a: number, b: number, c: number) => void;
17
+ export const wasmvisualiser_run_analysis: (a: number, b: number, c: number, d: number, e: number) => [number, number];
17
18
  export const wasmvisualiser_set_sigmoid_k: (a: number, b: number) => void;
18
19
  export const wasmvisualiser_set_time: (a: number, b: number) => void;
19
20
  export const wasmvisualiser_push_rotation_data: (a: number, b: number, c: number, d: number) => void;
20
21
  export const init_panic_hook: () => void;
21
- export const wasm_bindgen__convert__closures_____invoke__h53437a38721e89f7: (a: number, b: number, c: any) => void;
22
- export const wasm_bindgen__closure__destroy__hf5eaa61ced318e08: (a: number, b: number) => void;
23
22
  export const wasm_bindgen__convert__closures_____invoke__h9d1c5a23ecfcd5c8: (a: number, b: number, c: any) => void;
24
23
  export const wasm_bindgen__closure__destroy__heb49a8f426ac2d2e: (a: number, b: number) => void;
24
+ export const wasm_bindgen__convert__closures_____invoke__h53437a38721e89f7: (a: number, b: number, c: any) => void;
25
+ export const wasm_bindgen__closure__destroy__hf5eaa61ced318e08: (a: number, b: number) => void;
25
26
  export const wasm_bindgen__convert__closures_____invoke__h320f3d825d3712ba: (a: number, b: number, c: any, d: any) => void;
26
27
  export const __wbindgen_malloc: (a: number, b: number) => number;
27
28
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;