@octoseq/visualiser 0.1.0-main.856feb5 → 0.1.0-main.959ab48
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/pkg/visualiser.d.ts +106 -2
- package/pkg/visualiser.js +203 -11
- package/pkg/visualiser_bg.wasm +0 -0
- package/pkg/visualiser_bg.wasm.d.ts +14 -2
package/package.json
CHANGED
package/pkg/visualiser.d.ts
CHANGED
|
@@ -93,6 +93,18 @@ export class WasmVisualiser {
|
|
|
93
93
|
* - `sample_rate`: Sample rate of the signal.
|
|
94
94
|
*/
|
|
95
95
|
push_band_signal(band_id: string, band_label: string, feature: string, samples: Float32Array, sample_rate: number): void;
|
|
96
|
+
/**
|
|
97
|
+
* Push a stem-scoped signal for use in scripts.
|
|
98
|
+
* The signal will be available as `inputs.stems[stem_id].{feature}` in Rhai scripts.
|
|
99
|
+
* Stores under both stem_id and stem_label for dual-access support.
|
|
100
|
+
*
|
|
101
|
+
* - `stem_id`: The unique ID of the stem.
|
|
102
|
+
* - `stem_label`: The user-visible label of the stem.
|
|
103
|
+
* - `feature`: Signal type ("energy", "onset", "flux").
|
|
104
|
+
* - `samples`: Signal data.
|
|
105
|
+
* - `sample_rate`: Sample rate of the signal.
|
|
106
|
+
*/
|
|
107
|
+
push_stem_signal(stem_id: string, stem_label: string, feature: string, samples: Float32Array, sample_rate: number): void;
|
|
96
108
|
/**
|
|
97
109
|
* Set the musical time structure for beat-aware signal processing.
|
|
98
110
|
* The JSON format matches the TypeScript MusicalTimeStructure type.
|
|
@@ -132,6 +144,10 @@ export class WasmVisualiser {
|
|
|
132
144
|
* Beat-aware operations will fall back to 120 BPM default.
|
|
133
145
|
*/
|
|
134
146
|
clear_musical_time(): void;
|
|
147
|
+
/**
|
|
148
|
+
* Clear all stem signals.
|
|
149
|
+
*/
|
|
150
|
+
clear_stem_signals(): void;
|
|
135
151
|
/**
|
|
136
152
|
* Get frequency bounds for all active bands at a given time.
|
|
137
153
|
* Returns a JSON array of { bandId, label, lowHz, highHz, enabled } objects.
|
|
@@ -142,6 +158,16 @@ export class WasmVisualiser {
|
|
|
142
158
|
* Returns a JSON array of ScriptSignalInfo objects.
|
|
143
159
|
*/
|
|
144
160
|
get_script_signals(): string;
|
|
161
|
+
/**
|
|
162
|
+
* Push a custom signal for use in scripts.
|
|
163
|
+
* The signal will be available as `inputs.customSignals["signal_id"]` in Rhai scripts.
|
|
164
|
+
*
|
|
165
|
+
* - `signal_id`: The unique ID of the custom signal.
|
|
166
|
+
* - `label`: The user-visible label of the signal.
|
|
167
|
+
* - `samples`: Signal data.
|
|
168
|
+
* - `sample_rate`: Sample rate of the signal.
|
|
169
|
+
*/
|
|
170
|
+
push_custom_signal(signal_id: string, label: string, samples: Float32Array, sample_rate: number): void;
|
|
145
171
|
push_rotation_data(samples: Float32Array, sample_rate: number): void;
|
|
146
172
|
/**
|
|
147
173
|
* Render with a frame budget timeout.
|
|
@@ -166,6 +192,17 @@ export class WasmVisualiser {
|
|
|
166
192
|
* Returns true if successful, false if parsing failed.
|
|
167
193
|
*/
|
|
168
194
|
register_mesh_asset(asset_id: string, obj_content: string): boolean;
|
|
195
|
+
/**
|
|
196
|
+
* Set available stems for script namespace generation.
|
|
197
|
+
* This registers stem IDs and labels so the script engine can generate
|
|
198
|
+
* `inputs.stems["stem_id"]` and `inputs.stems["label"]` accessors.
|
|
199
|
+
*
|
|
200
|
+
* The JSON format should be an array of [id, label] pairs:
|
|
201
|
+
* `[["stem-abc123", "Drums"], ["stem-def456", "Bass"]]`
|
|
202
|
+
*
|
|
203
|
+
* Returns true if successful, false if parsing failed.
|
|
204
|
+
*/
|
|
205
|
+
set_available_stems(json: string): boolean;
|
|
169
206
|
/**
|
|
170
207
|
* Set the frequency band structure for band-aware processing.
|
|
171
208
|
* The JSON format matches the TypeScript FrequencyBandStructure type.
|
|
@@ -186,6 +223,10 @@ export class WasmVisualiser {
|
|
|
186
223
|
* - sample_count: Number of samples to take
|
|
187
224
|
*/
|
|
188
225
|
analyze_signal_chain(signal_name: string, center_time: number, window_beats: number, sample_count: number): string;
|
|
226
|
+
/**
|
|
227
|
+
* Clear all custom signals.
|
|
228
|
+
*/
|
|
229
|
+
clear_custom_signals(): void;
|
|
189
230
|
/**
|
|
190
231
|
* Get the number of events for a specific band.
|
|
191
232
|
* Returns 0 if no events are stored for this band.
|
|
@@ -196,15 +237,30 @@ export class WasmVisualiser {
|
|
|
196
237
|
* Returns a JSON array of strings.
|
|
197
238
|
*/
|
|
198
239
|
get_band_signal_keys(): string;
|
|
240
|
+
/**
|
|
241
|
+
* Get list of stem keys (IDs and labels) that have signals.
|
|
242
|
+
* Returns a JSON array of strings.
|
|
243
|
+
*/
|
|
244
|
+
get_stem_signal_keys(): string;
|
|
199
245
|
/**
|
|
200
246
|
* Clear the frequency band structure.
|
|
201
247
|
*/
|
|
202
248
|
clear_frequency_bands(): void;
|
|
249
|
+
/**
|
|
250
|
+
* Get camera state as JSON for inspector.
|
|
251
|
+
* Returns current position, rotation, target, fov, near, far, mode, and signal flags.
|
|
252
|
+
*/
|
|
253
|
+
get_camera_state_json(): string;
|
|
203
254
|
/**
|
|
204
255
|
* Unregister a mesh asset.
|
|
205
256
|
* Returns true if the asset was unregistered, false if it didn't exist.
|
|
206
257
|
*/
|
|
207
258
|
unregister_mesh_asset(asset_id: string): boolean;
|
|
259
|
+
/**
|
|
260
|
+
* Get list of custom signal keys (IDs and labels).
|
|
261
|
+
* Returns a JSON array of strings.
|
|
262
|
+
*/
|
|
263
|
+
get_custom_signal_keys(): string;
|
|
208
264
|
/**
|
|
209
265
|
* Get the number of events in a named event stream.
|
|
210
266
|
* Returns 0 if no events are stored for this name.
|
|
@@ -229,6 +285,37 @@ export class WasmVisualiser {
|
|
|
229
285
|
* Returns a JSON array of objects with id, type, and position fields.
|
|
230
286
|
*/
|
|
231
287
|
get_entity_positions_json(): string;
|
|
288
|
+
/**
|
|
289
|
+
* Push an authored event stream for script access.
|
|
290
|
+
*
|
|
291
|
+
* The event stream will be available as `inputs.authored["name"]` in Rhai scripts.
|
|
292
|
+
* This is used for user-authored events (promoted or manually created).
|
|
293
|
+
*
|
|
294
|
+
* The JSON format should be an array of event objects with:
|
|
295
|
+
* - time: f32
|
|
296
|
+
* - weight: f32
|
|
297
|
+
* - beat_position: Option<f32>
|
|
298
|
+
* - beat_phase: Option<f32>
|
|
299
|
+
* - cluster_id: Option<u32>
|
|
300
|
+
*
|
|
301
|
+
* Returns true if successful, false if parsing failed.
|
|
302
|
+
*/
|
|
303
|
+
push_authored_event_stream(name: string, events_json: string): boolean;
|
|
304
|
+
/**
|
|
305
|
+
* Clear all authored event streams.
|
|
306
|
+
*/
|
|
307
|
+
clear_authored_event_streams(): void;
|
|
308
|
+
/**
|
|
309
|
+
* Set available custom signals for script namespace generation.
|
|
310
|
+
* This registers custom signal IDs and labels so the script engine can generate
|
|
311
|
+
* `inputs.customSignals["signal_id"]` accessors.
|
|
312
|
+
*
|
|
313
|
+
* The JSON format should be an array of [id, label] pairs:
|
|
314
|
+
* `[["signal-abc123", "My Signal"], ["signal-def456", "Another Signal"]]`
|
|
315
|
+
*
|
|
316
|
+
* Returns true if successful, false if parsing failed.
|
|
317
|
+
*/
|
|
318
|
+
set_available_custom_signals(json: string): boolean;
|
|
232
319
|
/**
|
|
233
320
|
* Drain and return any pending structured script diagnostics as JSON.
|
|
234
321
|
*
|
|
@@ -236,6 +323,11 @@ export class WasmVisualiser {
|
|
|
236
323
|
* queue so repeated polling does not duplicate messages.
|
|
237
324
|
*/
|
|
238
325
|
take_script_diagnostics_json(): string;
|
|
326
|
+
/**
|
|
327
|
+
* Get the number of events in an authored event stream.
|
|
328
|
+
* Returns 0 if no events are stored for this name.
|
|
329
|
+
*/
|
|
330
|
+
get_authored_event_stream_count(name: string): number;
|
|
239
331
|
constructor();
|
|
240
332
|
render(dt: number): void;
|
|
241
333
|
resize(width: number, height: number): void;
|
|
@@ -264,23 +356,30 @@ export interface InitOutput {
|
|
|
264
356
|
readonly create_visualiser: (a: any) => any;
|
|
265
357
|
readonly get_script_api_metadata_json: () => [number, number];
|
|
266
358
|
readonly wasmvisualiser_analyze_signal_chain: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
359
|
+
readonly wasmvisualiser_clear_authored_event_streams: (a: number) => void;
|
|
267
360
|
readonly wasmvisualiser_clear_band_events: (a: number) => void;
|
|
268
361
|
readonly wasmvisualiser_clear_band_signals: (a: number) => void;
|
|
362
|
+
readonly wasmvisualiser_clear_custom_signals: (a: number) => void;
|
|
269
363
|
readonly wasmvisualiser_clear_event_streams: (a: number) => void;
|
|
270
364
|
readonly wasmvisualiser_clear_frequency_bands: (a: number) => void;
|
|
271
365
|
readonly wasmvisualiser_clear_isolation: (a: number) => void;
|
|
272
366
|
readonly wasmvisualiser_clear_musical_time: (a: number) => void;
|
|
273
367
|
readonly wasmvisualiser_clear_signals: (a: number) => void;
|
|
368
|
+
readonly wasmvisualiser_clear_stem_signals: (a: number) => void;
|
|
369
|
+
readonly wasmvisualiser_get_authored_event_stream_count: (a: number, b: number, c: number) => number;
|
|
274
370
|
readonly wasmvisualiser_get_band_bounds_at: (a: number, b: number) => [number, number];
|
|
275
371
|
readonly wasmvisualiser_get_band_event_count: (a: number, b: number, c: number) => number;
|
|
276
372
|
readonly wasmvisualiser_get_band_signal_keys: (a: number) => [number, number];
|
|
373
|
+
readonly wasmvisualiser_get_camera_state_json: (a: number) => [number, number];
|
|
277
374
|
readonly wasmvisualiser_get_current_vals: (a: number) => [number, number];
|
|
375
|
+
readonly wasmvisualiser_get_custom_signal_keys: (a: number) => [number, number];
|
|
278
376
|
readonly wasmvisualiser_get_entity_positions_json: (a: number) => [number, number];
|
|
279
377
|
readonly wasmvisualiser_get_event_stream_count: (a: number, b: number, c: number) => number;
|
|
280
378
|
readonly wasmvisualiser_get_frequency_band_count: (a: number) => number;
|
|
281
379
|
readonly wasmvisualiser_get_script_error: (a: number) => [number, number];
|
|
282
380
|
readonly wasmvisualiser_get_script_signals: (a: number) => [number, number];
|
|
283
381
|
readonly wasmvisualiser_get_signal_names: (a: number) => [number, number];
|
|
382
|
+
readonly wasmvisualiser_get_stem_signal_keys: (a: number) => [number, number];
|
|
284
383
|
readonly wasmvisualiser_has_frequency_bands: (a: number) => number;
|
|
285
384
|
readonly wasmvisualiser_has_script: (a: number) => number;
|
|
286
385
|
readonly wasmvisualiser_has_signal: (a: number, b: number, c: number) => number;
|
|
@@ -288,11 +387,14 @@ export interface InitOutput {
|
|
|
288
387
|
readonly wasmvisualiser_list_mesh_assets: (a: number) => [number, number];
|
|
289
388
|
readonly wasmvisualiser_load_script: (a: number, b: number, c: number) => number;
|
|
290
389
|
readonly wasmvisualiser_new: () => number;
|
|
390
|
+
readonly wasmvisualiser_push_authored_event_stream: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
291
391
|
readonly wasmvisualiser_push_band_events: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
292
392
|
readonly wasmvisualiser_push_band_signal: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
393
|
+
readonly wasmvisualiser_push_custom_signal: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
293
394
|
readonly wasmvisualiser_push_data: (a: number, b: number, c: number, d: number) => void;
|
|
294
395
|
readonly wasmvisualiser_push_event_stream: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
295
396
|
readonly wasmvisualiser_push_signal: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
397
|
+
readonly wasmvisualiser_push_stem_signal: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
296
398
|
readonly wasmvisualiser_push_zoom_data: (a: number, b: number, c: number, d: number) => void;
|
|
297
399
|
readonly wasmvisualiser_register_mesh_asset: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
298
400
|
readonly wasmvisualiser_render: (a: number, b: number) => void;
|
|
@@ -300,6 +402,8 @@ export interface InitOutput {
|
|
|
300
402
|
readonly wasmvisualiser_resize: (a: number, b: number, c: number) => void;
|
|
301
403
|
readonly wasmvisualiser_run_analysis: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
302
404
|
readonly wasmvisualiser_run_analysis_with_events: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
405
|
+
readonly wasmvisualiser_set_available_custom_signals: (a: number, b: number, c: number) => number;
|
|
406
|
+
readonly wasmvisualiser_set_available_stems: (a: number, b: number, c: number) => number;
|
|
303
407
|
readonly wasmvisualiser_set_debug_options: (a: number, b: number, c: number) => void;
|
|
304
408
|
readonly wasmvisualiser_set_frequency_bands: (a: number, b: number, c: number) => number;
|
|
305
409
|
readonly wasmvisualiser_set_musical_time: (a: number, b: number, c: number) => number;
|
|
@@ -309,10 +413,10 @@ export interface InitOutput {
|
|
|
309
413
|
readonly wasmvisualiser_unregister_mesh_asset: (a: number, b: number, c: number) => number;
|
|
310
414
|
readonly wasmvisualiser_push_rotation_data: (a: number, b: number, c: number, d: number) => void;
|
|
311
415
|
readonly init_panic_hook: () => void;
|
|
312
|
-
readonly wasm_bindgen__convert__closures_____invoke__h53437a38721e89f7: (a: number, b: number, c: any) => void;
|
|
313
|
-
readonly wasm_bindgen__closure__destroy__hf5eaa61ced318e08: (a: number, b: number) => void;
|
|
314
416
|
readonly wasm_bindgen__convert__closures_____invoke__h9d1c5a23ecfcd5c8: (a: number, b: number, c: any) => void;
|
|
315
417
|
readonly wasm_bindgen__closure__destroy__heb49a8f426ac2d2e: (a: number, b: number) => void;
|
|
418
|
+
readonly wasm_bindgen__convert__closures_____invoke__h53437a38721e89f7: (a: number, b: number, c: any) => void;
|
|
419
|
+
readonly wasm_bindgen__closure__destroy__hf5eaa61ced318e08: (a: number, b: number) => void;
|
|
316
420
|
readonly wasm_bindgen__convert__closures_____invoke__h320f3d825d3712ba: (a: number, b: number, c: any, d: any) => void;
|
|
317
421
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
318
422
|
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
|
}
|
|
@@ -502,6 +502,33 @@ export class WasmVisualiser {
|
|
|
502
502
|
const len3 = WASM_VECTOR_LEN;
|
|
503
503
|
wasm.wasmvisualiser_push_band_signal(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, sample_rate);
|
|
504
504
|
}
|
|
505
|
+
/**
|
|
506
|
+
* Push a stem-scoped signal for use in scripts.
|
|
507
|
+
* The signal will be available as `inputs.stems[stem_id].{feature}` in Rhai scripts.
|
|
508
|
+
* Stores under both stem_id and stem_label for dual-access support.
|
|
509
|
+
*
|
|
510
|
+
* - `stem_id`: The unique ID of the stem.
|
|
511
|
+
* - `stem_label`: The user-visible label of the stem.
|
|
512
|
+
* - `feature`: Signal type ("energy", "onset", "flux").
|
|
513
|
+
* - `samples`: Signal data.
|
|
514
|
+
* - `sample_rate`: Sample rate of the signal.
|
|
515
|
+
* @param {string} stem_id
|
|
516
|
+
* @param {string} stem_label
|
|
517
|
+
* @param {string} feature
|
|
518
|
+
* @param {Float32Array} samples
|
|
519
|
+
* @param {number} sample_rate
|
|
520
|
+
*/
|
|
521
|
+
push_stem_signal(stem_id, stem_label, feature, samples, sample_rate) {
|
|
522
|
+
const ptr0 = passStringToWasm0(stem_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
523
|
+
const len0 = WASM_VECTOR_LEN;
|
|
524
|
+
const ptr1 = passStringToWasm0(stem_label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
525
|
+
const len1 = WASM_VECTOR_LEN;
|
|
526
|
+
const ptr2 = passStringToWasm0(feature, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
527
|
+
const len2 = WASM_VECTOR_LEN;
|
|
528
|
+
const ptr3 = passArrayF32ToWasm0(samples, wasm.__wbindgen_malloc);
|
|
529
|
+
const len3 = WASM_VECTOR_LEN;
|
|
530
|
+
wasm.wasmvisualiser_push_stem_signal(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, sample_rate);
|
|
531
|
+
}
|
|
505
532
|
/**
|
|
506
533
|
* Set the musical time structure for beat-aware signal processing.
|
|
507
534
|
* The JSON format matches the TypeScript MusicalTimeStructure type.
|
|
@@ -568,6 +595,12 @@ export class WasmVisualiser {
|
|
|
568
595
|
clear_musical_time() {
|
|
569
596
|
wasm.wasmvisualiser_clear_musical_time(this.__wbg_ptr);
|
|
570
597
|
}
|
|
598
|
+
/**
|
|
599
|
+
* Clear all stem signals.
|
|
600
|
+
*/
|
|
601
|
+
clear_stem_signals() {
|
|
602
|
+
wasm.wasmvisualiser_clear_stem_signals(this.__wbg_ptr);
|
|
603
|
+
}
|
|
571
604
|
/**
|
|
572
605
|
* Get frequency bounds for all active bands at a given time.
|
|
573
606
|
* Returns a JSON array of { bandId, label, lowHz, highHz, enabled } objects.
|
|
@@ -603,6 +636,28 @@ export class WasmVisualiser {
|
|
|
603
636
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
604
637
|
}
|
|
605
638
|
}
|
|
639
|
+
/**
|
|
640
|
+
* Push a custom signal for use in scripts.
|
|
641
|
+
* The signal will be available as `inputs.customSignals["signal_id"]` in Rhai scripts.
|
|
642
|
+
*
|
|
643
|
+
* - `signal_id`: The unique ID of the custom signal.
|
|
644
|
+
* - `label`: The user-visible label of the signal.
|
|
645
|
+
* - `samples`: Signal data.
|
|
646
|
+
* - `sample_rate`: Sample rate of the signal.
|
|
647
|
+
* @param {string} signal_id
|
|
648
|
+
* @param {string} label
|
|
649
|
+
* @param {Float32Array} samples
|
|
650
|
+
* @param {number} sample_rate
|
|
651
|
+
*/
|
|
652
|
+
push_custom_signal(signal_id, label, samples, sample_rate) {
|
|
653
|
+
const ptr0 = passStringToWasm0(signal_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
654
|
+
const len0 = WASM_VECTOR_LEN;
|
|
655
|
+
const ptr1 = passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
656
|
+
const len1 = WASM_VECTOR_LEN;
|
|
657
|
+
const ptr2 = passArrayF32ToWasm0(samples, wasm.__wbindgen_malloc);
|
|
658
|
+
const len2 = WASM_VECTOR_LEN;
|
|
659
|
+
wasm.wasmvisualiser_push_custom_signal(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, sample_rate);
|
|
660
|
+
}
|
|
606
661
|
/**
|
|
607
662
|
* @param {Float32Array} samples
|
|
608
663
|
* @param {number} sample_rate
|
|
@@ -657,6 +712,24 @@ export class WasmVisualiser {
|
|
|
657
712
|
const ret = wasm.wasmvisualiser_register_mesh_asset(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
658
713
|
return ret !== 0;
|
|
659
714
|
}
|
|
715
|
+
/**
|
|
716
|
+
* Set available stems for script namespace generation.
|
|
717
|
+
* This registers stem IDs and labels so the script engine can generate
|
|
718
|
+
* `inputs.stems["stem_id"]` and `inputs.stems["label"]` accessors.
|
|
719
|
+
*
|
|
720
|
+
* The JSON format should be an array of [id, label] pairs:
|
|
721
|
+
* `[["stem-abc123", "Drums"], ["stem-def456", "Bass"]]`
|
|
722
|
+
*
|
|
723
|
+
* Returns true if successful, false if parsing failed.
|
|
724
|
+
* @param {string} json
|
|
725
|
+
* @returns {boolean}
|
|
726
|
+
*/
|
|
727
|
+
set_available_stems(json) {
|
|
728
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
729
|
+
const len0 = WASM_VECTOR_LEN;
|
|
730
|
+
const ret = wasm.wasmvisualiser_set_available_stems(this.__wbg_ptr, ptr0, len0);
|
|
731
|
+
return ret !== 0;
|
|
732
|
+
}
|
|
660
733
|
/**
|
|
661
734
|
* Set the frequency band structure for band-aware processing.
|
|
662
735
|
* The JSON format matches the TypeScript FrequencyBandStructure type.
|
|
@@ -702,6 +775,12 @@ export class WasmVisualiser {
|
|
|
702
775
|
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
703
776
|
}
|
|
704
777
|
}
|
|
778
|
+
/**
|
|
779
|
+
* Clear all custom signals.
|
|
780
|
+
*/
|
|
781
|
+
clear_custom_signals() {
|
|
782
|
+
wasm.wasmvisualiser_clear_custom_signals(this.__wbg_ptr);
|
|
783
|
+
}
|
|
705
784
|
/**
|
|
706
785
|
* Get the number of events for a specific band.
|
|
707
786
|
* Returns 0 if no events are stored for this band.
|
|
@@ -731,12 +810,46 @@ export class WasmVisualiser {
|
|
|
731
810
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
732
811
|
}
|
|
733
812
|
}
|
|
813
|
+
/**
|
|
814
|
+
* Get list of stem keys (IDs and labels) that have signals.
|
|
815
|
+
* Returns a JSON array of strings.
|
|
816
|
+
* @returns {string}
|
|
817
|
+
*/
|
|
818
|
+
get_stem_signal_keys() {
|
|
819
|
+
let deferred1_0;
|
|
820
|
+
let deferred1_1;
|
|
821
|
+
try {
|
|
822
|
+
const ret = wasm.wasmvisualiser_get_stem_signal_keys(this.__wbg_ptr);
|
|
823
|
+
deferred1_0 = ret[0];
|
|
824
|
+
deferred1_1 = ret[1];
|
|
825
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
826
|
+
} finally {
|
|
827
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
828
|
+
}
|
|
829
|
+
}
|
|
734
830
|
/**
|
|
735
831
|
* Clear the frequency band structure.
|
|
736
832
|
*/
|
|
737
833
|
clear_frequency_bands() {
|
|
738
834
|
wasm.wasmvisualiser_clear_frequency_bands(this.__wbg_ptr);
|
|
739
835
|
}
|
|
836
|
+
/**
|
|
837
|
+
* Get camera state as JSON for inspector.
|
|
838
|
+
* Returns current position, rotation, target, fov, near, far, mode, and signal flags.
|
|
839
|
+
* @returns {string}
|
|
840
|
+
*/
|
|
841
|
+
get_camera_state_json() {
|
|
842
|
+
let deferred1_0;
|
|
843
|
+
let deferred1_1;
|
|
844
|
+
try {
|
|
845
|
+
const ret = wasm.wasmvisualiser_get_camera_state_json(this.__wbg_ptr);
|
|
846
|
+
deferred1_0 = ret[0];
|
|
847
|
+
deferred1_1 = ret[1];
|
|
848
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
849
|
+
} finally {
|
|
850
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
851
|
+
}
|
|
852
|
+
}
|
|
740
853
|
/**
|
|
741
854
|
* Unregister a mesh asset.
|
|
742
855
|
* Returns true if the asset was unregistered, false if it didn't exist.
|
|
@@ -749,6 +862,23 @@ export class WasmVisualiser {
|
|
|
749
862
|
const ret = wasm.wasmvisualiser_unregister_mesh_asset(this.__wbg_ptr, ptr0, len0);
|
|
750
863
|
return ret !== 0;
|
|
751
864
|
}
|
|
865
|
+
/**
|
|
866
|
+
* Get list of custom signal keys (IDs and labels).
|
|
867
|
+
* Returns a JSON array of strings.
|
|
868
|
+
* @returns {string}
|
|
869
|
+
*/
|
|
870
|
+
get_custom_signal_keys() {
|
|
871
|
+
let deferred1_0;
|
|
872
|
+
let deferred1_1;
|
|
873
|
+
try {
|
|
874
|
+
const ret = wasm.wasmvisualiser_get_custom_signal_keys(this.__wbg_ptr);
|
|
875
|
+
deferred1_0 = ret[0];
|
|
876
|
+
deferred1_1 = ret[1];
|
|
877
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
878
|
+
} finally {
|
|
879
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
752
882
|
/**
|
|
753
883
|
* Get the number of events in a named event stream.
|
|
754
884
|
* Returns 0 if no events are stored for this name.
|
|
@@ -813,6 +943,56 @@ export class WasmVisualiser {
|
|
|
813
943
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
814
944
|
}
|
|
815
945
|
}
|
|
946
|
+
/**
|
|
947
|
+
* Push an authored event stream for script access.
|
|
948
|
+
*
|
|
949
|
+
* The event stream will be available as `inputs.authored["name"]` in Rhai scripts.
|
|
950
|
+
* This is used for user-authored events (promoted or manually created).
|
|
951
|
+
*
|
|
952
|
+
* The JSON format should be an array of event objects with:
|
|
953
|
+
* - time: f32
|
|
954
|
+
* - weight: f32
|
|
955
|
+
* - beat_position: Option<f32>
|
|
956
|
+
* - beat_phase: Option<f32>
|
|
957
|
+
* - cluster_id: Option<u32>
|
|
958
|
+
*
|
|
959
|
+
* Returns true if successful, false if parsing failed.
|
|
960
|
+
* @param {string} name
|
|
961
|
+
* @param {string} events_json
|
|
962
|
+
* @returns {boolean}
|
|
963
|
+
*/
|
|
964
|
+
push_authored_event_stream(name, events_json) {
|
|
965
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
966
|
+
const len0 = WASM_VECTOR_LEN;
|
|
967
|
+
const ptr1 = passStringToWasm0(events_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
968
|
+
const len1 = WASM_VECTOR_LEN;
|
|
969
|
+
const ret = wasm.wasmvisualiser_push_authored_event_stream(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
970
|
+
return ret !== 0;
|
|
971
|
+
}
|
|
972
|
+
/**
|
|
973
|
+
* Clear all authored event streams.
|
|
974
|
+
*/
|
|
975
|
+
clear_authored_event_streams() {
|
|
976
|
+
wasm.wasmvisualiser_clear_authored_event_streams(this.__wbg_ptr);
|
|
977
|
+
}
|
|
978
|
+
/**
|
|
979
|
+
* Set available custom signals for script namespace generation.
|
|
980
|
+
* This registers custom signal IDs and labels so the script engine can generate
|
|
981
|
+
* `inputs.customSignals["signal_id"]` accessors.
|
|
982
|
+
*
|
|
983
|
+
* The JSON format should be an array of [id, label] pairs:
|
|
984
|
+
* `[["signal-abc123", "My Signal"], ["signal-def456", "Another Signal"]]`
|
|
985
|
+
*
|
|
986
|
+
* Returns true if successful, false if parsing failed.
|
|
987
|
+
* @param {string} json
|
|
988
|
+
* @returns {boolean}
|
|
989
|
+
*/
|
|
990
|
+
set_available_custom_signals(json) {
|
|
991
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
992
|
+
const len0 = WASM_VECTOR_LEN;
|
|
993
|
+
const ret = wasm.wasmvisualiser_set_available_custom_signals(this.__wbg_ptr, ptr0, len0);
|
|
994
|
+
return ret !== 0;
|
|
995
|
+
}
|
|
816
996
|
/**
|
|
817
997
|
* Drain and return any pending structured script diagnostics as JSON.
|
|
818
998
|
*
|
|
@@ -832,6 +1012,18 @@ export class WasmVisualiser {
|
|
|
832
1012
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
833
1013
|
}
|
|
834
1014
|
}
|
|
1015
|
+
/**
|
|
1016
|
+
* Get the number of events in an authored event stream.
|
|
1017
|
+
* Returns 0 if no events are stored for this name.
|
|
1018
|
+
* @param {string} name
|
|
1019
|
+
* @returns {number}
|
|
1020
|
+
*/
|
|
1021
|
+
get_authored_event_stream_count(name) {
|
|
1022
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1023
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1024
|
+
const ret = wasm.wasmvisualiser_get_authored_event_stream_count(this.__wbg_ptr, ptr0, len0);
|
|
1025
|
+
return ret >>> 0;
|
|
1026
|
+
}
|
|
835
1027
|
constructor() {
|
|
836
1028
|
const ret = wasm.wasmvisualiser_new();
|
|
837
1029
|
this.__wbg_ptr = ret >>> 0;
|
|
@@ -1757,18 +1949,18 @@ function __wbg_get_imports() {
|
|
|
1757
1949
|
imports.wbg.__wbg_writeTexture_246118eb2f5a1592 = function(arg0, arg1, arg2, arg3, arg4) {
|
|
1758
1950
|
arg0.writeTexture(arg1, arg2, arg3, arg4);
|
|
1759
1951
|
};
|
|
1760
|
-
imports.wbg.__wbindgen_cast_0f9673e2fc640759 = function(arg0, arg1) {
|
|
1761
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 3204, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 3205, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1762
|
-
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__heb49a8f426ac2d2e, wasm_bindgen__convert__closures_____invoke__h9d1c5a23ecfcd5c8);
|
|
1763
|
-
return ret;
|
|
1764
|
-
};
|
|
1765
1952
|
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
1766
1953
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1767
1954
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
1768
1955
|
return ret;
|
|
1769
1956
|
};
|
|
1770
|
-
imports.wbg.
|
|
1771
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1957
|
+
imports.wbg.__wbindgen_cast_73f7c1aa413df4f1 = function(arg0, arg1) {
|
|
1958
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3322, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 3323, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1959
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__heb49a8f426ac2d2e, wasm_bindgen__convert__closures_____invoke__h9d1c5a23ecfcd5c8);
|
|
1960
|
+
return ret;
|
|
1961
|
+
};
|
|
1962
|
+
imports.wbg.__wbindgen_cast_ad7098fabcb3be64 = function(arg0, arg1) {
|
|
1963
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3454, function: Function { arguments: [Externref], shim_idx: 3455, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1772
1964
|
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hf5eaa61ced318e08, wasm_bindgen__convert__closures_____invoke__h53437a38721e89f7);
|
|
1773
1965
|
return ret;
|
|
1774
1966
|
};
|
package/pkg/visualiser_bg.wasm
CHANGED
|
Binary file
|
|
@@ -5,23 +5,30 @@ export const __wbg_wasmvisualiser_free: (a: number, b: number) => void;
|
|
|
5
5
|
export const create_visualiser: (a: any) => any;
|
|
6
6
|
export const get_script_api_metadata_json: () => [number, number];
|
|
7
7
|
export const wasmvisualiser_analyze_signal_chain: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
8
|
+
export const wasmvisualiser_clear_authored_event_streams: (a: number) => void;
|
|
8
9
|
export const wasmvisualiser_clear_band_events: (a: number) => void;
|
|
9
10
|
export const wasmvisualiser_clear_band_signals: (a: number) => void;
|
|
11
|
+
export const wasmvisualiser_clear_custom_signals: (a: number) => void;
|
|
10
12
|
export const wasmvisualiser_clear_event_streams: (a: number) => void;
|
|
11
13
|
export const wasmvisualiser_clear_frequency_bands: (a: number) => void;
|
|
12
14
|
export const wasmvisualiser_clear_isolation: (a: number) => void;
|
|
13
15
|
export const wasmvisualiser_clear_musical_time: (a: number) => void;
|
|
14
16
|
export const wasmvisualiser_clear_signals: (a: number) => void;
|
|
17
|
+
export const wasmvisualiser_clear_stem_signals: (a: number) => void;
|
|
18
|
+
export const wasmvisualiser_get_authored_event_stream_count: (a: number, b: number, c: number) => number;
|
|
15
19
|
export const wasmvisualiser_get_band_bounds_at: (a: number, b: number) => [number, number];
|
|
16
20
|
export const wasmvisualiser_get_band_event_count: (a: number, b: number, c: number) => number;
|
|
17
21
|
export const wasmvisualiser_get_band_signal_keys: (a: number) => [number, number];
|
|
22
|
+
export const wasmvisualiser_get_camera_state_json: (a: number) => [number, number];
|
|
18
23
|
export const wasmvisualiser_get_current_vals: (a: number) => [number, number];
|
|
24
|
+
export const wasmvisualiser_get_custom_signal_keys: (a: number) => [number, number];
|
|
19
25
|
export const wasmvisualiser_get_entity_positions_json: (a: number) => [number, number];
|
|
20
26
|
export const wasmvisualiser_get_event_stream_count: (a: number, b: number, c: number) => number;
|
|
21
27
|
export const wasmvisualiser_get_frequency_band_count: (a: number) => number;
|
|
22
28
|
export const wasmvisualiser_get_script_error: (a: number) => [number, number];
|
|
23
29
|
export const wasmvisualiser_get_script_signals: (a: number) => [number, number];
|
|
24
30
|
export const wasmvisualiser_get_signal_names: (a: number) => [number, number];
|
|
31
|
+
export const wasmvisualiser_get_stem_signal_keys: (a: number) => [number, number];
|
|
25
32
|
export const wasmvisualiser_has_frequency_bands: (a: number) => number;
|
|
26
33
|
export const wasmvisualiser_has_script: (a: number) => number;
|
|
27
34
|
export const wasmvisualiser_has_signal: (a: number, b: number, c: number) => number;
|
|
@@ -29,11 +36,14 @@ export const wasmvisualiser_isolate_entity: (a: number, b: bigint) => void;
|
|
|
29
36
|
export const wasmvisualiser_list_mesh_assets: (a: number) => [number, number];
|
|
30
37
|
export const wasmvisualiser_load_script: (a: number, b: number, c: number) => number;
|
|
31
38
|
export const wasmvisualiser_new: () => number;
|
|
39
|
+
export const wasmvisualiser_push_authored_event_stream: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
32
40
|
export const wasmvisualiser_push_band_events: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
33
41
|
export const wasmvisualiser_push_band_signal: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
42
|
+
export const wasmvisualiser_push_custom_signal: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
34
43
|
export const wasmvisualiser_push_data: (a: number, b: number, c: number, d: number) => void;
|
|
35
44
|
export const wasmvisualiser_push_event_stream: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
36
45
|
export const wasmvisualiser_push_signal: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
46
|
+
export const wasmvisualiser_push_stem_signal: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
37
47
|
export const wasmvisualiser_push_zoom_data: (a: number, b: number, c: number, d: number) => void;
|
|
38
48
|
export const wasmvisualiser_register_mesh_asset: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
39
49
|
export const wasmvisualiser_render: (a: number, b: number) => void;
|
|
@@ -41,6 +51,8 @@ export const wasmvisualiser_render_with_budget: (a: number, b: number, c: number
|
|
|
41
51
|
export const wasmvisualiser_resize: (a: number, b: number, c: number) => void;
|
|
42
52
|
export const wasmvisualiser_run_analysis: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
43
53
|
export const wasmvisualiser_run_analysis_with_events: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
54
|
+
export const wasmvisualiser_set_available_custom_signals: (a: number, b: number, c: number) => number;
|
|
55
|
+
export const wasmvisualiser_set_available_stems: (a: number, b: number, c: number) => number;
|
|
44
56
|
export const wasmvisualiser_set_debug_options: (a: number, b: number, c: number) => void;
|
|
45
57
|
export const wasmvisualiser_set_frequency_bands: (a: number, b: number, c: number) => number;
|
|
46
58
|
export const wasmvisualiser_set_musical_time: (a: number, b: number, c: number) => number;
|
|
@@ -50,10 +62,10 @@ export const wasmvisualiser_take_script_diagnostics_json: (a: number) => [number
|
|
|
50
62
|
export const wasmvisualiser_unregister_mesh_asset: (a: number, b: number, c: number) => number;
|
|
51
63
|
export const wasmvisualiser_push_rotation_data: (a: number, b: number, c: number, d: number) => void;
|
|
52
64
|
export const init_panic_hook: () => void;
|
|
53
|
-
export const wasm_bindgen__convert__closures_____invoke__h53437a38721e89f7: (a: number, b: number, c: any) => void;
|
|
54
|
-
export const wasm_bindgen__closure__destroy__hf5eaa61ced318e08: (a: number, b: number) => void;
|
|
55
65
|
export const wasm_bindgen__convert__closures_____invoke__h9d1c5a23ecfcd5c8: (a: number, b: number, c: any) => void;
|
|
56
66
|
export const wasm_bindgen__closure__destroy__heb49a8f426ac2d2e: (a: number, b: number) => void;
|
|
67
|
+
export const wasm_bindgen__convert__closures_____invoke__h53437a38721e89f7: (a: number, b: number, c: any) => void;
|
|
68
|
+
export const wasm_bindgen__closure__destroy__hf5eaa61ced318e08: (a: number, b: number) => void;
|
|
57
69
|
export const wasm_bindgen__convert__closures_____invoke__h320f3d825d3712ba: (a: number, b: number, c: any, d: any) => void;
|
|
58
70
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
59
71
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|