@octoseq/visualiser 0.1.0-main.6402764 → 0.1.0-main.6ed7f26
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 +364 -6
- package/pkg/visualiser.js +713 -15
- package/pkg/visualiser_bg.wasm +0 -0
- package/pkg/visualiser_bg.wasm.d.ts +52 -6
package/package.json
CHANGED
package/pkg/visualiser.d.ts
CHANGED
|
@@ -8,6 +8,10 @@ export class WasmVisualiser {
|
|
|
8
8
|
* Check if a script is currently loaded.
|
|
9
9
|
*/
|
|
10
10
|
has_script(): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Check if a signal variable exists in the current script.
|
|
13
|
+
*/
|
|
14
|
+
has_signal(name: string): boolean;
|
|
11
15
|
/**
|
|
12
16
|
* Load a Rhai script for controlling the visualiser.
|
|
13
17
|
* Returns true if the script was loaded successfully.
|
|
@@ -18,12 +22,30 @@ export class WasmVisualiser {
|
|
|
18
22
|
* The signal will be available as `inputs.<name>` in Rhai scripts.
|
|
19
23
|
*/
|
|
20
24
|
push_signal(name: string, samples: Float32Array, sample_rate: number): void;
|
|
25
|
+
/**
|
|
26
|
+
* Run script in analysis mode to collect debug.emit() signals.
|
|
27
|
+
*
|
|
28
|
+
* This runs the script headlessly across the full track duration,
|
|
29
|
+
* collecting all debug.emit() calls without rendering.
|
|
30
|
+
*
|
|
31
|
+
* Returns a JSON-serialized AnalysisResultJson.
|
|
32
|
+
*/
|
|
33
|
+
run_analysis(script: string, duration: number, time_step: number): string;
|
|
21
34
|
/**
|
|
22
35
|
* Clear all named signals.
|
|
23
36
|
*/
|
|
24
37
|
clear_signals(): void;
|
|
25
38
|
set_sigmoid_k(k: number): void;
|
|
39
|
+
/**
|
|
40
|
+
* Isolate a single entity for rendering (useful for debugging).
|
|
41
|
+
* Only this entity will be rendered.
|
|
42
|
+
*/
|
|
43
|
+
isolate_entity(entity_id: bigint): void;
|
|
26
44
|
push_zoom_data(samples: Float32Array, sample_rate: number): void;
|
|
45
|
+
/**
|
|
46
|
+
* Clear entity isolation, resume normal rendering.
|
|
47
|
+
*/
|
|
48
|
+
clear_isolation(): void;
|
|
27
49
|
/**
|
|
28
50
|
* Get current state values for debugging.
|
|
29
51
|
* Returns [time, scene_entity_count, mesh_count, line_count]
|
|
@@ -33,7 +55,288 @@ export class WasmVisualiser {
|
|
|
33
55
|
* Get the last script error message, if any.
|
|
34
56
|
*/
|
|
35
57
|
get_script_error(): string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Get the list of available signal names.
|
|
60
|
+
* Returns a JSON array of signal names.
|
|
61
|
+
*/
|
|
62
|
+
get_signal_names(): string;
|
|
63
|
+
/**
|
|
64
|
+
* Get a list of all registered mesh asset IDs.
|
|
65
|
+
* Returns a JSON array of asset IDs.
|
|
66
|
+
*/
|
|
67
|
+
list_mesh_assets(): string;
|
|
68
|
+
/**
|
|
69
|
+
* Push pre-extracted events for a band.
|
|
70
|
+
*
|
|
71
|
+
* Events are extracted by the TypeScript layer using the existing peak picker,
|
|
72
|
+
* then pushed here for script access via `inputs.bands[id].events`.
|
|
73
|
+
*
|
|
74
|
+
* The JSON format should be an array of event objects with:
|
|
75
|
+
* - time: f32
|
|
76
|
+
* - weight: f32
|
|
77
|
+
* - beat_position: Option<f32>
|
|
78
|
+
* - beat_phase: Option<f32>
|
|
79
|
+
* - cluster_id: Option<u32>
|
|
80
|
+
*
|
|
81
|
+
* Returns true if successful, false if parsing failed.
|
|
82
|
+
*/
|
|
83
|
+
push_band_events(band_id: string, events_json: string): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Push a band-scoped signal for use in scripts.
|
|
86
|
+
* The signal will be available as `inputs.bands[band_id].{feature}` in Rhai scripts.
|
|
87
|
+
* Stores under both band_id and band_label for dual-access support.
|
|
88
|
+
*
|
|
89
|
+
* - `band_id`: The unique ID of the frequency band.
|
|
90
|
+
* - `band_label`: The user-visible label of the band.
|
|
91
|
+
* - `feature`: Signal type ("energy", "onset", "flux").
|
|
92
|
+
* - `samples`: Signal data.
|
|
93
|
+
* - `sample_rate`: Sample rate of the signal.
|
|
94
|
+
*/
|
|
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;
|
|
108
|
+
/**
|
|
109
|
+
* Set the musical time structure for beat-aware signal processing.
|
|
110
|
+
* The JSON format matches the TypeScript MusicalTimeStructure type.
|
|
111
|
+
* Returns true if successful, false if parsing failed.
|
|
112
|
+
*/
|
|
113
|
+
set_musical_time(json: string): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Clear all band event streams.
|
|
116
|
+
*/
|
|
117
|
+
clear_band_events(): void;
|
|
118
|
+
/**
|
|
119
|
+
* Push a named event stream (e.g., "beatCandidates") for script access.
|
|
120
|
+
*
|
|
121
|
+
* The event stream will be available as `inputs.<name>` in Rhai scripts.
|
|
122
|
+
* This is used for MIR-derived events like beat candidates, onset peaks, etc.
|
|
123
|
+
*
|
|
124
|
+
* The JSON format should be an array of event objects with:
|
|
125
|
+
* - time: f32
|
|
126
|
+
* - weight: f32
|
|
127
|
+
* - beat_position: Option<f32>
|
|
128
|
+
* - beat_phase: Option<f32>
|
|
129
|
+
* - cluster_id: Option<u32>
|
|
130
|
+
*
|
|
131
|
+
* Returns true if successful, false if parsing failed.
|
|
132
|
+
*/
|
|
133
|
+
push_event_stream(name: string, events_json: string): boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Set debug visualization options.
|
|
136
|
+
*/
|
|
137
|
+
set_debug_options(wireframe: boolean, bounding_boxes: boolean): void;
|
|
138
|
+
/**
|
|
139
|
+
* Clear all band signals.
|
|
140
|
+
*/
|
|
141
|
+
clear_band_signals(): void;
|
|
142
|
+
/**
|
|
143
|
+
* Clear the musical time structure.
|
|
144
|
+
* Beat-aware operations will fall back to 120 BPM default.
|
|
145
|
+
*/
|
|
146
|
+
clear_musical_time(): void;
|
|
147
|
+
/**
|
|
148
|
+
* Clear all stem signals.
|
|
149
|
+
*/
|
|
150
|
+
clear_stem_signals(): void;
|
|
151
|
+
/**
|
|
152
|
+
* Get frequency bounds for all active bands at a given time.
|
|
153
|
+
* Returns a JSON array of { bandId, label, lowHz, highHz, enabled } objects.
|
|
154
|
+
*/
|
|
155
|
+
get_band_bounds_at(time: number): string;
|
|
156
|
+
/**
|
|
157
|
+
* Get all Signal variables from the current script.
|
|
158
|
+
* Returns a JSON array of ScriptSignalInfo objects.
|
|
159
|
+
*/
|
|
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;
|
|
36
171
|
push_rotation_data(samples: Float32Array, sample_rate: number): void;
|
|
172
|
+
/**
|
|
173
|
+
* Render with a frame budget timeout.
|
|
174
|
+
*
|
|
175
|
+
* If the frame takes longer than `budget_ms` to process, it will be dropped
|
|
176
|
+
* and a warning logged. This prevents expensive scripts from freezing the browser.
|
|
177
|
+
*
|
|
178
|
+
* Returns true if the frame completed, false if it was dropped due to budget.
|
|
179
|
+
*/
|
|
180
|
+
render_with_budget(dt: number, budget_ms: number): boolean;
|
|
181
|
+
/**
|
|
182
|
+
* Clear all named event streams.
|
|
183
|
+
*/
|
|
184
|
+
clear_event_streams(): void;
|
|
185
|
+
/**
|
|
186
|
+
* Check if frequency bands are currently set.
|
|
187
|
+
*/
|
|
188
|
+
has_frequency_bands(): boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Register a mesh asset from OBJ content.
|
|
191
|
+
* The asset will be available as `mesh.load(asset_id)` in scripts.
|
|
192
|
+
* Returns true if successful, false if parsing failed.
|
|
193
|
+
*/
|
|
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;
|
|
206
|
+
/**
|
|
207
|
+
* Set the frequency band structure for band-aware processing.
|
|
208
|
+
* The JSON format matches the TypeScript FrequencyBandStructure type.
|
|
209
|
+
* Returns true if successful, false if parsing failed.
|
|
210
|
+
*/
|
|
211
|
+
set_frequency_bands(json: string): boolean;
|
|
212
|
+
/**
|
|
213
|
+
* Analyze a signal chain with localized sampling.
|
|
214
|
+
*
|
|
215
|
+
* Returns JSON with either:
|
|
216
|
+
* - SignalChainAnalysis on success
|
|
217
|
+
* - { "error": "message" } on failure
|
|
218
|
+
*
|
|
219
|
+
* Parameters:
|
|
220
|
+
* - signal_name: Name of the signal variable in the script
|
|
221
|
+
* - center_time: Time to center analysis around (seconds)
|
|
222
|
+
* - window_beats: Number of beats before/after center to sample
|
|
223
|
+
* - sample_count: Number of samples to take
|
|
224
|
+
*/
|
|
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;
|
|
230
|
+
/**
|
|
231
|
+
* Get the number of events for a specific band.
|
|
232
|
+
* Returns 0 if no events are stored for this band.
|
|
233
|
+
*/
|
|
234
|
+
get_band_event_count(band_id: string): number;
|
|
235
|
+
/**
|
|
236
|
+
* Get list of band keys (IDs and labels) that have signals.
|
|
237
|
+
* Returns a JSON array of strings.
|
|
238
|
+
*/
|
|
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;
|
|
245
|
+
/**
|
|
246
|
+
* Check if performance profiling is currently enabled.
|
|
247
|
+
*/
|
|
248
|
+
is_profiling_enabled(): boolean;
|
|
249
|
+
/**
|
|
250
|
+
* Clear the frequency band structure.
|
|
251
|
+
*/
|
|
252
|
+
clear_frequency_bands(): void;
|
|
253
|
+
/**
|
|
254
|
+
* Get camera state as JSON for inspector.
|
|
255
|
+
* Returns current position, rotation, target, fov, near, far, mode, and signal flags.
|
|
256
|
+
*/
|
|
257
|
+
get_camera_state_json(): string;
|
|
258
|
+
/**
|
|
259
|
+
* Enable or disable performance profiling.
|
|
260
|
+
* When enabled, console timing and collection size logging will be active.
|
|
261
|
+
*/
|
|
262
|
+
set_profiling_enabled(enabled: boolean): void;
|
|
263
|
+
/**
|
|
264
|
+
* Unregister a mesh asset.
|
|
265
|
+
* Returns true if the asset was unregistered, false if it didn't exist.
|
|
266
|
+
*/
|
|
267
|
+
unregister_mesh_asset(asset_id: string): boolean;
|
|
268
|
+
/**
|
|
269
|
+
* Get list of custom signal keys (IDs and labels).
|
|
270
|
+
* Returns a JSON array of strings.
|
|
271
|
+
*/
|
|
272
|
+
get_custom_signal_keys(): string;
|
|
273
|
+
/**
|
|
274
|
+
* Get the number of events in a named event stream.
|
|
275
|
+
* Returns 0 if no events are stored for this name.
|
|
276
|
+
*/
|
|
277
|
+
get_event_stream_count(name: string): number;
|
|
278
|
+
/**
|
|
279
|
+
* Get the number of frequency bands.
|
|
280
|
+
*/
|
|
281
|
+
get_frequency_band_count(): number;
|
|
282
|
+
/**
|
|
283
|
+
* Run script in analysis mode with event extraction support.
|
|
284
|
+
*
|
|
285
|
+
* This runs the script headlessly across the full track duration,
|
|
286
|
+
* collecting all debug.emit() calls AND extracting events from
|
|
287
|
+
* any signal.pick.events() calls.
|
|
288
|
+
*
|
|
289
|
+
* Returns a JSON-serialized ExtendedAnalysisResultJson.
|
|
290
|
+
*/
|
|
291
|
+
run_analysis_with_events(script: string, duration: number, time_step: number): string;
|
|
292
|
+
/**
|
|
293
|
+
* Get entity positions as JSON for debugging.
|
|
294
|
+
* Returns a JSON array of objects with id, type, and position fields.
|
|
295
|
+
*/
|
|
296
|
+
get_entity_positions_json(): string;
|
|
297
|
+
/**
|
|
298
|
+
* Push an authored event stream for script access.
|
|
299
|
+
*
|
|
300
|
+
* The event stream will be available as `inputs.authored["name"]` in Rhai scripts.
|
|
301
|
+
* This is used for user-authored events (promoted or manually created).
|
|
302
|
+
*
|
|
303
|
+
* The JSON format should be an array of event objects with:
|
|
304
|
+
* - time: f32
|
|
305
|
+
* - weight: f32
|
|
306
|
+
* - beat_position: Option<f32>
|
|
307
|
+
* - beat_phase: Option<f32>
|
|
308
|
+
* - cluster_id: Option<u32>
|
|
309
|
+
*
|
|
310
|
+
* Returns true if successful, false if parsing failed.
|
|
311
|
+
*/
|
|
312
|
+
push_authored_event_stream(name: string, events_json: string): boolean;
|
|
313
|
+
/**
|
|
314
|
+
* Clear all authored event streams.
|
|
315
|
+
*/
|
|
316
|
+
clear_authored_event_streams(): void;
|
|
317
|
+
/**
|
|
318
|
+
* Set available custom signals for script namespace generation.
|
|
319
|
+
* This registers custom signal IDs and labels so the script engine can generate
|
|
320
|
+
* `inputs.customSignals["signal_id"]` accessors.
|
|
321
|
+
*
|
|
322
|
+
* The JSON format should be an array of [id, label] pairs:
|
|
323
|
+
* `[["signal-abc123", "My Signal"], ["signal-def456", "Another Signal"]]`
|
|
324
|
+
*
|
|
325
|
+
* Returns true if successful, false if parsing failed.
|
|
326
|
+
*/
|
|
327
|
+
set_available_custom_signals(json: string): boolean;
|
|
328
|
+
/**
|
|
329
|
+
* Drain and return any pending structured script diagnostics as JSON.
|
|
330
|
+
*
|
|
331
|
+
* Intended for UI consumption. Calling this clears the pending diagnostics
|
|
332
|
+
* queue so repeated polling does not duplicate messages.
|
|
333
|
+
*/
|
|
334
|
+
take_script_diagnostics_json(): string;
|
|
335
|
+
/**
|
|
336
|
+
* Get the number of events in an authored event stream.
|
|
337
|
+
* Returns 0 if no events are stored for this name.
|
|
338
|
+
*/
|
|
339
|
+
get_authored_event_stream_count(name: string): number;
|
|
37
340
|
constructor();
|
|
38
341
|
render(dt: number): void;
|
|
39
342
|
resize(width: number, height: number): void;
|
|
@@ -43,6 +346,15 @@ export class WasmVisualiser {
|
|
|
43
346
|
|
|
44
347
|
export function create_visualiser(canvas: HTMLCanvasElement): Promise<WasmVisualiser>;
|
|
45
348
|
|
|
349
|
+
/**
|
|
350
|
+
* Get the host-defined Script API metadata as a JSON string.
|
|
351
|
+
*
|
|
352
|
+
* This is a stable, versioned description of the scripting API surface and is
|
|
353
|
+
* intended to drive editor UX (autocomplete/hover/docs) and future language
|
|
354
|
+
* bindings.
|
|
355
|
+
*/
|
|
356
|
+
export function get_script_api_metadata_json(): string;
|
|
357
|
+
|
|
46
358
|
export function init_panic_hook(): void;
|
|
47
359
|
|
|
48
360
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
@@ -51,26 +363,72 @@ export interface InitOutput {
|
|
|
51
363
|
readonly memory: WebAssembly.Memory;
|
|
52
364
|
readonly __wbg_wasmvisualiser_free: (a: number, b: number) => void;
|
|
53
365
|
readonly create_visualiser: (a: any) => any;
|
|
366
|
+
readonly get_script_api_metadata_json: () => [number, number];
|
|
367
|
+
readonly wasmvisualiser_analyze_signal_chain: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
368
|
+
readonly wasmvisualiser_clear_authored_event_streams: (a: number) => void;
|
|
369
|
+
readonly wasmvisualiser_clear_band_events: (a: number) => void;
|
|
370
|
+
readonly wasmvisualiser_clear_band_signals: (a: number) => void;
|
|
371
|
+
readonly wasmvisualiser_clear_custom_signals: (a: number) => void;
|
|
372
|
+
readonly wasmvisualiser_clear_event_streams: (a: number) => void;
|
|
373
|
+
readonly wasmvisualiser_clear_frequency_bands: (a: number) => void;
|
|
374
|
+
readonly wasmvisualiser_clear_isolation: (a: number) => void;
|
|
375
|
+
readonly wasmvisualiser_clear_musical_time: (a: number) => void;
|
|
54
376
|
readonly wasmvisualiser_clear_signals: (a: number) => void;
|
|
377
|
+
readonly wasmvisualiser_clear_stem_signals: (a: number) => void;
|
|
378
|
+
readonly wasmvisualiser_get_authored_event_stream_count: (a: number, b: number, c: number) => number;
|
|
379
|
+
readonly wasmvisualiser_get_band_bounds_at: (a: number, b: number) => [number, number];
|
|
380
|
+
readonly wasmvisualiser_get_band_event_count: (a: number, b: number, c: number) => number;
|
|
381
|
+
readonly wasmvisualiser_get_band_signal_keys: (a: number) => [number, number];
|
|
382
|
+
readonly wasmvisualiser_get_camera_state_json: (a: number) => [number, number];
|
|
55
383
|
readonly wasmvisualiser_get_current_vals: (a: number) => [number, number];
|
|
384
|
+
readonly wasmvisualiser_get_custom_signal_keys: (a: number) => [number, number];
|
|
385
|
+
readonly wasmvisualiser_get_entity_positions_json: (a: number) => [number, number];
|
|
386
|
+
readonly wasmvisualiser_get_event_stream_count: (a: number, b: number, c: number) => number;
|
|
387
|
+
readonly wasmvisualiser_get_frequency_band_count: (a: number) => number;
|
|
56
388
|
readonly wasmvisualiser_get_script_error: (a: number) => [number, number];
|
|
389
|
+
readonly wasmvisualiser_get_script_signals: (a: number) => [number, number];
|
|
390
|
+
readonly wasmvisualiser_get_signal_names: (a: number) => [number, number];
|
|
391
|
+
readonly wasmvisualiser_get_stem_signal_keys: (a: number) => [number, number];
|
|
392
|
+
readonly wasmvisualiser_has_frequency_bands: (a: number) => number;
|
|
57
393
|
readonly wasmvisualiser_has_script: (a: number) => number;
|
|
394
|
+
readonly wasmvisualiser_has_signal: (a: number, b: number, c: number) => number;
|
|
395
|
+
readonly wasmvisualiser_is_profiling_enabled: (a: number) => number;
|
|
396
|
+
readonly wasmvisualiser_isolate_entity: (a: number, b: bigint) => void;
|
|
397
|
+
readonly wasmvisualiser_list_mesh_assets: (a: number) => [number, number];
|
|
58
398
|
readonly wasmvisualiser_load_script: (a: number, b: number, c: number) => number;
|
|
59
399
|
readonly wasmvisualiser_new: () => number;
|
|
400
|
+
readonly wasmvisualiser_push_authored_event_stream: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
401
|
+
readonly wasmvisualiser_push_band_events: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
402
|
+
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;
|
|
403
|
+
readonly wasmvisualiser_push_custom_signal: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
60
404
|
readonly wasmvisualiser_push_data: (a: number, b: number, c: number, d: number) => void;
|
|
405
|
+
readonly wasmvisualiser_push_event_stream: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
61
406
|
readonly wasmvisualiser_push_signal: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
407
|
+
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;
|
|
62
408
|
readonly wasmvisualiser_push_zoom_data: (a: number, b: number, c: number, d: number) => void;
|
|
409
|
+
readonly wasmvisualiser_register_mesh_asset: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
63
410
|
readonly wasmvisualiser_render: (a: number, b: number) => void;
|
|
411
|
+
readonly wasmvisualiser_render_with_budget: (a: number, b: number, c: number) => number;
|
|
64
412
|
readonly wasmvisualiser_resize: (a: number, b: number, c: number) => void;
|
|
413
|
+
readonly wasmvisualiser_run_analysis: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
414
|
+
readonly wasmvisualiser_run_analysis_with_events: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
415
|
+
readonly wasmvisualiser_set_available_custom_signals: (a: number, b: number, c: number) => number;
|
|
416
|
+
readonly wasmvisualiser_set_available_stems: (a: number, b: number, c: number) => number;
|
|
417
|
+
readonly wasmvisualiser_set_debug_options: (a: number, b: number, c: number) => void;
|
|
418
|
+
readonly wasmvisualiser_set_frequency_bands: (a: number, b: number, c: number) => number;
|
|
419
|
+
readonly wasmvisualiser_set_musical_time: (a: number, b: number, c: number) => number;
|
|
420
|
+
readonly wasmvisualiser_set_profiling_enabled: (a: number, b: number) => void;
|
|
65
421
|
readonly wasmvisualiser_set_sigmoid_k: (a: number, b: number) => void;
|
|
66
422
|
readonly wasmvisualiser_set_time: (a: number, b: number) => void;
|
|
67
|
-
readonly
|
|
423
|
+
readonly wasmvisualiser_take_script_diagnostics_json: (a: number) => [number, number];
|
|
424
|
+
readonly wasmvisualiser_unregister_mesh_asset: (a: number, b: number, c: number) => number;
|
|
68
425
|
readonly wasmvisualiser_push_rotation_data: (a: number, b: number, c: number, d: number) => void;
|
|
69
|
-
readonly
|
|
70
|
-
readonly
|
|
71
|
-
readonly
|
|
72
|
-
readonly
|
|
73
|
-
readonly
|
|
426
|
+
readonly init_panic_hook: () => void;
|
|
427
|
+
readonly wasm_bindgen__convert__closures_____invoke__h09705603bb35b975: (a: number, b: number, c: any) => void;
|
|
428
|
+
readonly wasm_bindgen__closure__destroy__h6518d8d5fffe1051: (a: number, b: number) => void;
|
|
429
|
+
readonly wasm_bindgen__convert__closures_____invoke__hd456749e88b4d731: (a: number, b: number, c: any) => void;
|
|
430
|
+
readonly wasm_bindgen__closure__destroy__hff2bb8e37b7072b2: (a: number, b: number) => void;
|
|
431
|
+
readonly wasm_bindgen__convert__closures_____invoke__h12a8c25a05856851: (a: number, b: number, c: any, d: any) => void;
|
|
74
432
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
75
433
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
76
434
|
readonly __wbindgen_exn_store: (a: number) => void;
|
package/pkg/visualiser.js
CHANGED
|
@@ -241,16 +241,16 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
241
241
|
|
|
242
242
|
let WASM_VECTOR_LEN = 0;
|
|
243
243
|
|
|
244
|
-
function
|
|
245
|
-
wasm.
|
|
244
|
+
function wasm_bindgen__convert__closures_____invoke__h09705603bb35b975(arg0, arg1, arg2) {
|
|
245
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h09705603bb35b975(arg0, arg1, arg2);
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
function
|
|
249
|
-
wasm.
|
|
248
|
+
function wasm_bindgen__convert__closures_____invoke__hd456749e88b4d731(arg0, arg1, arg2) {
|
|
249
|
+
wasm.wasm_bindgen__convert__closures_____invoke__hd456749e88b4d731(arg0, arg1, arg2);
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
function
|
|
253
|
-
wasm.
|
|
252
|
+
function wasm_bindgen__convert__closures_____invoke__h12a8c25a05856851(arg0, arg1, arg2, arg3) {
|
|
253
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h12a8c25a05856851(arg0, arg1, arg2, arg3);
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
const __wbindgen_enum_GpuCompilationMessageType = ["error", "warning", "info"];
|
|
@@ -293,6 +293,17 @@ export class WasmVisualiser {
|
|
|
293
293
|
const ret = wasm.wasmvisualiser_has_script(this.__wbg_ptr);
|
|
294
294
|
return ret !== 0;
|
|
295
295
|
}
|
|
296
|
+
/**
|
|
297
|
+
* Check if a signal variable exists in the current script.
|
|
298
|
+
* @param {string} name
|
|
299
|
+
* @returns {boolean}
|
|
300
|
+
*/
|
|
301
|
+
has_signal(name) {
|
|
302
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
303
|
+
const len0 = WASM_VECTOR_LEN;
|
|
304
|
+
const ret = wasm.wasmvisualiser_has_signal(this.__wbg_ptr, ptr0, len0);
|
|
305
|
+
return ret !== 0;
|
|
306
|
+
}
|
|
296
307
|
/**
|
|
297
308
|
* Load a Rhai script for controlling the visualiser.
|
|
298
309
|
* Returns true if the script was loaded successfully.
|
|
@@ -319,6 +330,32 @@ export class WasmVisualiser {
|
|
|
319
330
|
const len1 = WASM_VECTOR_LEN;
|
|
320
331
|
wasm.wasmvisualiser_push_signal(this.__wbg_ptr, ptr0, len0, ptr1, len1, sample_rate);
|
|
321
332
|
}
|
|
333
|
+
/**
|
|
334
|
+
* Run script in analysis mode to collect debug.emit() signals.
|
|
335
|
+
*
|
|
336
|
+
* This runs the script headlessly across the full track duration,
|
|
337
|
+
* collecting all debug.emit() calls without rendering.
|
|
338
|
+
*
|
|
339
|
+
* Returns a JSON-serialized AnalysisResultJson.
|
|
340
|
+
* @param {string} script
|
|
341
|
+
* @param {number} duration
|
|
342
|
+
* @param {number} time_step
|
|
343
|
+
* @returns {string}
|
|
344
|
+
*/
|
|
345
|
+
run_analysis(script, duration, time_step) {
|
|
346
|
+
let deferred2_0;
|
|
347
|
+
let deferred2_1;
|
|
348
|
+
try {
|
|
349
|
+
const ptr0 = passStringToWasm0(script, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
350
|
+
const len0 = WASM_VECTOR_LEN;
|
|
351
|
+
const ret = wasm.wasmvisualiser_run_analysis(this.__wbg_ptr, ptr0, len0, duration, time_step);
|
|
352
|
+
deferred2_0 = ret[0];
|
|
353
|
+
deferred2_1 = ret[1];
|
|
354
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
355
|
+
} finally {
|
|
356
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
322
359
|
/**
|
|
323
360
|
* Clear all named signals.
|
|
324
361
|
*/
|
|
@@ -331,6 +368,14 @@ export class WasmVisualiser {
|
|
|
331
368
|
set_sigmoid_k(k) {
|
|
332
369
|
wasm.wasmvisualiser_set_sigmoid_k(this.__wbg_ptr, k);
|
|
333
370
|
}
|
|
371
|
+
/**
|
|
372
|
+
* Isolate a single entity for rendering (useful for debugging).
|
|
373
|
+
* Only this entity will be rendered.
|
|
374
|
+
* @param {bigint} entity_id
|
|
375
|
+
*/
|
|
376
|
+
isolate_entity(entity_id) {
|
|
377
|
+
wasm.wasmvisualiser_isolate_entity(this.__wbg_ptr, entity_id);
|
|
378
|
+
}
|
|
334
379
|
/**
|
|
335
380
|
* @param {Float32Array} samples
|
|
336
381
|
* @param {number} sample_rate
|
|
@@ -340,6 +385,12 @@ export class WasmVisualiser {
|
|
|
340
385
|
const len0 = WASM_VECTOR_LEN;
|
|
341
386
|
wasm.wasmvisualiser_push_zoom_data(this.__wbg_ptr, ptr0, len0, sample_rate);
|
|
342
387
|
}
|
|
388
|
+
/**
|
|
389
|
+
* Clear entity isolation, resume normal rendering.
|
|
390
|
+
*/
|
|
391
|
+
clear_isolation() {
|
|
392
|
+
wasm.wasmvisualiser_clear_isolation(this.__wbg_ptr);
|
|
393
|
+
}
|
|
343
394
|
/**
|
|
344
395
|
* Get current state values for debugging.
|
|
345
396
|
* Returns [time, scene_entity_count, mesh_count, line_count]
|
|
@@ -364,6 +415,249 @@ export class WasmVisualiser {
|
|
|
364
415
|
}
|
|
365
416
|
return v1;
|
|
366
417
|
}
|
|
418
|
+
/**
|
|
419
|
+
* Get the list of available signal names.
|
|
420
|
+
* Returns a JSON array of signal names.
|
|
421
|
+
* @returns {string}
|
|
422
|
+
*/
|
|
423
|
+
get_signal_names() {
|
|
424
|
+
let deferred1_0;
|
|
425
|
+
let deferred1_1;
|
|
426
|
+
try {
|
|
427
|
+
const ret = wasm.wasmvisualiser_get_signal_names(this.__wbg_ptr);
|
|
428
|
+
deferred1_0 = ret[0];
|
|
429
|
+
deferred1_1 = ret[1];
|
|
430
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
431
|
+
} finally {
|
|
432
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Get a list of all registered mesh asset IDs.
|
|
437
|
+
* Returns a JSON array of asset IDs.
|
|
438
|
+
* @returns {string}
|
|
439
|
+
*/
|
|
440
|
+
list_mesh_assets() {
|
|
441
|
+
let deferred1_0;
|
|
442
|
+
let deferred1_1;
|
|
443
|
+
try {
|
|
444
|
+
const ret = wasm.wasmvisualiser_list_mesh_assets(this.__wbg_ptr);
|
|
445
|
+
deferred1_0 = ret[0];
|
|
446
|
+
deferred1_1 = ret[1];
|
|
447
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
448
|
+
} finally {
|
|
449
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Push pre-extracted events for a band.
|
|
454
|
+
*
|
|
455
|
+
* Events are extracted by the TypeScript layer using the existing peak picker,
|
|
456
|
+
* then pushed here for script access via `inputs.bands[id].events`.
|
|
457
|
+
*
|
|
458
|
+
* The JSON format should be an array of event objects with:
|
|
459
|
+
* - time: f32
|
|
460
|
+
* - weight: f32
|
|
461
|
+
* - beat_position: Option<f32>
|
|
462
|
+
* - beat_phase: Option<f32>
|
|
463
|
+
* - cluster_id: Option<u32>
|
|
464
|
+
*
|
|
465
|
+
* Returns true if successful, false if parsing failed.
|
|
466
|
+
* @param {string} band_id
|
|
467
|
+
* @param {string} events_json
|
|
468
|
+
* @returns {boolean}
|
|
469
|
+
*/
|
|
470
|
+
push_band_events(band_id, events_json) {
|
|
471
|
+
const ptr0 = passStringToWasm0(band_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
472
|
+
const len0 = WASM_VECTOR_LEN;
|
|
473
|
+
const ptr1 = passStringToWasm0(events_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
474
|
+
const len1 = WASM_VECTOR_LEN;
|
|
475
|
+
const ret = wasm.wasmvisualiser_push_band_events(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
476
|
+
return ret !== 0;
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Push a band-scoped signal for use in scripts.
|
|
480
|
+
* The signal will be available as `inputs.bands[band_id].{feature}` in Rhai scripts.
|
|
481
|
+
* Stores under both band_id and band_label for dual-access support.
|
|
482
|
+
*
|
|
483
|
+
* - `band_id`: The unique ID of the frequency band.
|
|
484
|
+
* - `band_label`: The user-visible label of the band.
|
|
485
|
+
* - `feature`: Signal type ("energy", "onset", "flux").
|
|
486
|
+
* - `samples`: Signal data.
|
|
487
|
+
* - `sample_rate`: Sample rate of the signal.
|
|
488
|
+
* @param {string} band_id
|
|
489
|
+
* @param {string} band_label
|
|
490
|
+
* @param {string} feature
|
|
491
|
+
* @param {Float32Array} samples
|
|
492
|
+
* @param {number} sample_rate
|
|
493
|
+
*/
|
|
494
|
+
push_band_signal(band_id, band_label, feature, samples, sample_rate) {
|
|
495
|
+
const ptr0 = passStringToWasm0(band_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
496
|
+
const len0 = WASM_VECTOR_LEN;
|
|
497
|
+
const ptr1 = passStringToWasm0(band_label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
498
|
+
const len1 = WASM_VECTOR_LEN;
|
|
499
|
+
const ptr2 = passStringToWasm0(feature, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
500
|
+
const len2 = WASM_VECTOR_LEN;
|
|
501
|
+
const ptr3 = passArrayF32ToWasm0(samples, wasm.__wbindgen_malloc);
|
|
502
|
+
const len3 = WASM_VECTOR_LEN;
|
|
503
|
+
wasm.wasmvisualiser_push_band_signal(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, sample_rate);
|
|
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
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* Set the musical time structure for beat-aware signal processing.
|
|
534
|
+
* The JSON format matches the TypeScript MusicalTimeStructure type.
|
|
535
|
+
* Returns true if successful, false if parsing failed.
|
|
536
|
+
* @param {string} json
|
|
537
|
+
* @returns {boolean}
|
|
538
|
+
*/
|
|
539
|
+
set_musical_time(json) {
|
|
540
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
541
|
+
const len0 = WASM_VECTOR_LEN;
|
|
542
|
+
const ret = wasm.wasmvisualiser_set_musical_time(this.__wbg_ptr, ptr0, len0);
|
|
543
|
+
return ret !== 0;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Clear all band event streams.
|
|
547
|
+
*/
|
|
548
|
+
clear_band_events() {
|
|
549
|
+
wasm.wasmvisualiser_clear_band_events(this.__wbg_ptr);
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* Push a named event stream (e.g., "beatCandidates") for script access.
|
|
553
|
+
*
|
|
554
|
+
* The event stream will be available as `inputs.<name>` in Rhai scripts.
|
|
555
|
+
* This is used for MIR-derived events like beat candidates, onset peaks, etc.
|
|
556
|
+
*
|
|
557
|
+
* The JSON format should be an array of event objects with:
|
|
558
|
+
* - time: f32
|
|
559
|
+
* - weight: f32
|
|
560
|
+
* - beat_position: Option<f32>
|
|
561
|
+
* - beat_phase: Option<f32>
|
|
562
|
+
* - cluster_id: Option<u32>
|
|
563
|
+
*
|
|
564
|
+
* Returns true if successful, false if parsing failed.
|
|
565
|
+
* @param {string} name
|
|
566
|
+
* @param {string} events_json
|
|
567
|
+
* @returns {boolean}
|
|
568
|
+
*/
|
|
569
|
+
push_event_stream(name, events_json) {
|
|
570
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
571
|
+
const len0 = WASM_VECTOR_LEN;
|
|
572
|
+
const ptr1 = passStringToWasm0(events_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
573
|
+
const len1 = WASM_VECTOR_LEN;
|
|
574
|
+
const ret = wasm.wasmvisualiser_push_event_stream(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
575
|
+
return ret !== 0;
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Set debug visualization options.
|
|
579
|
+
* @param {boolean} wireframe
|
|
580
|
+
* @param {boolean} bounding_boxes
|
|
581
|
+
*/
|
|
582
|
+
set_debug_options(wireframe, bounding_boxes) {
|
|
583
|
+
wasm.wasmvisualiser_set_debug_options(this.__wbg_ptr, wireframe, bounding_boxes);
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Clear all band signals.
|
|
587
|
+
*/
|
|
588
|
+
clear_band_signals() {
|
|
589
|
+
wasm.wasmvisualiser_clear_band_signals(this.__wbg_ptr);
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* Clear the musical time structure.
|
|
593
|
+
* Beat-aware operations will fall back to 120 BPM default.
|
|
594
|
+
*/
|
|
595
|
+
clear_musical_time() {
|
|
596
|
+
wasm.wasmvisualiser_clear_musical_time(this.__wbg_ptr);
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Clear all stem signals.
|
|
600
|
+
*/
|
|
601
|
+
clear_stem_signals() {
|
|
602
|
+
wasm.wasmvisualiser_clear_stem_signals(this.__wbg_ptr);
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* Get frequency bounds for all active bands at a given time.
|
|
606
|
+
* Returns a JSON array of { bandId, label, lowHz, highHz, enabled } objects.
|
|
607
|
+
* @param {number} time
|
|
608
|
+
* @returns {string}
|
|
609
|
+
*/
|
|
610
|
+
get_band_bounds_at(time) {
|
|
611
|
+
let deferred1_0;
|
|
612
|
+
let deferred1_1;
|
|
613
|
+
try {
|
|
614
|
+
const ret = wasm.wasmvisualiser_get_band_bounds_at(this.__wbg_ptr, time);
|
|
615
|
+
deferred1_0 = ret[0];
|
|
616
|
+
deferred1_1 = ret[1];
|
|
617
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
618
|
+
} finally {
|
|
619
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
/**
|
|
623
|
+
* Get all Signal variables from the current script.
|
|
624
|
+
* Returns a JSON array of ScriptSignalInfo objects.
|
|
625
|
+
* @returns {string}
|
|
626
|
+
*/
|
|
627
|
+
get_script_signals() {
|
|
628
|
+
let deferred1_0;
|
|
629
|
+
let deferred1_1;
|
|
630
|
+
try {
|
|
631
|
+
const ret = wasm.wasmvisualiser_get_script_signals(this.__wbg_ptr);
|
|
632
|
+
deferred1_0 = ret[0];
|
|
633
|
+
deferred1_1 = ret[1];
|
|
634
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
635
|
+
} finally {
|
|
636
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
637
|
+
}
|
|
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
|
+
}
|
|
367
661
|
/**
|
|
368
662
|
* @param {Float32Array} samples
|
|
369
663
|
* @param {number} sample_rate
|
|
@@ -373,6 +667,379 @@ export class WasmVisualiser {
|
|
|
373
667
|
const len0 = WASM_VECTOR_LEN;
|
|
374
668
|
wasm.wasmvisualiser_push_data(this.__wbg_ptr, ptr0, len0, sample_rate);
|
|
375
669
|
}
|
|
670
|
+
/**
|
|
671
|
+
* Render with a frame budget timeout.
|
|
672
|
+
*
|
|
673
|
+
* If the frame takes longer than `budget_ms` to process, it will be dropped
|
|
674
|
+
* and a warning logged. This prevents expensive scripts from freezing the browser.
|
|
675
|
+
*
|
|
676
|
+
* Returns true if the frame completed, false if it was dropped due to budget.
|
|
677
|
+
* @param {number} dt
|
|
678
|
+
* @param {number} budget_ms
|
|
679
|
+
* @returns {boolean}
|
|
680
|
+
*/
|
|
681
|
+
render_with_budget(dt, budget_ms) {
|
|
682
|
+
const ret = wasm.wasmvisualiser_render_with_budget(this.__wbg_ptr, dt, budget_ms);
|
|
683
|
+
return ret !== 0;
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Clear all named event streams.
|
|
687
|
+
*/
|
|
688
|
+
clear_event_streams() {
|
|
689
|
+
wasm.wasmvisualiser_clear_event_streams(this.__wbg_ptr);
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* Check if frequency bands are currently set.
|
|
693
|
+
* @returns {boolean}
|
|
694
|
+
*/
|
|
695
|
+
has_frequency_bands() {
|
|
696
|
+
const ret = wasm.wasmvisualiser_has_frequency_bands(this.__wbg_ptr);
|
|
697
|
+
return ret !== 0;
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* Register a mesh asset from OBJ content.
|
|
701
|
+
* The asset will be available as `mesh.load(asset_id)` in scripts.
|
|
702
|
+
* Returns true if successful, false if parsing failed.
|
|
703
|
+
* @param {string} asset_id
|
|
704
|
+
* @param {string} obj_content
|
|
705
|
+
* @returns {boolean}
|
|
706
|
+
*/
|
|
707
|
+
register_mesh_asset(asset_id, obj_content) {
|
|
708
|
+
const ptr0 = passStringToWasm0(asset_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
709
|
+
const len0 = WASM_VECTOR_LEN;
|
|
710
|
+
const ptr1 = passStringToWasm0(obj_content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
711
|
+
const len1 = WASM_VECTOR_LEN;
|
|
712
|
+
const ret = wasm.wasmvisualiser_register_mesh_asset(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
713
|
+
return ret !== 0;
|
|
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
|
+
}
|
|
733
|
+
/**
|
|
734
|
+
* Set the frequency band structure for band-aware processing.
|
|
735
|
+
* The JSON format matches the TypeScript FrequencyBandStructure type.
|
|
736
|
+
* Returns true if successful, false if parsing failed.
|
|
737
|
+
* @param {string} json
|
|
738
|
+
* @returns {boolean}
|
|
739
|
+
*/
|
|
740
|
+
set_frequency_bands(json) {
|
|
741
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
742
|
+
const len0 = WASM_VECTOR_LEN;
|
|
743
|
+
const ret = wasm.wasmvisualiser_set_frequency_bands(this.__wbg_ptr, ptr0, len0);
|
|
744
|
+
return ret !== 0;
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* Analyze a signal chain with localized sampling.
|
|
748
|
+
*
|
|
749
|
+
* Returns JSON with either:
|
|
750
|
+
* - SignalChainAnalysis on success
|
|
751
|
+
* - { "error": "message" } on failure
|
|
752
|
+
*
|
|
753
|
+
* Parameters:
|
|
754
|
+
* - signal_name: Name of the signal variable in the script
|
|
755
|
+
* - center_time: Time to center analysis around (seconds)
|
|
756
|
+
* - window_beats: Number of beats before/after center to sample
|
|
757
|
+
* - sample_count: Number of samples to take
|
|
758
|
+
* @param {string} signal_name
|
|
759
|
+
* @param {number} center_time
|
|
760
|
+
* @param {number} window_beats
|
|
761
|
+
* @param {number} sample_count
|
|
762
|
+
* @returns {string}
|
|
763
|
+
*/
|
|
764
|
+
analyze_signal_chain(signal_name, center_time, window_beats, sample_count) {
|
|
765
|
+
let deferred2_0;
|
|
766
|
+
let deferred2_1;
|
|
767
|
+
try {
|
|
768
|
+
const ptr0 = passStringToWasm0(signal_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
769
|
+
const len0 = WASM_VECTOR_LEN;
|
|
770
|
+
const ret = wasm.wasmvisualiser_analyze_signal_chain(this.__wbg_ptr, ptr0, len0, center_time, window_beats, sample_count);
|
|
771
|
+
deferred2_0 = ret[0];
|
|
772
|
+
deferred2_1 = ret[1];
|
|
773
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
774
|
+
} finally {
|
|
775
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* Clear all custom signals.
|
|
780
|
+
*/
|
|
781
|
+
clear_custom_signals() {
|
|
782
|
+
wasm.wasmvisualiser_clear_custom_signals(this.__wbg_ptr);
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* Get the number of events for a specific band.
|
|
786
|
+
* Returns 0 if no events are stored for this band.
|
|
787
|
+
* @param {string} band_id
|
|
788
|
+
* @returns {number}
|
|
789
|
+
*/
|
|
790
|
+
get_band_event_count(band_id) {
|
|
791
|
+
const ptr0 = passStringToWasm0(band_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
792
|
+
const len0 = WASM_VECTOR_LEN;
|
|
793
|
+
const ret = wasm.wasmvisualiser_get_band_event_count(this.__wbg_ptr, ptr0, len0);
|
|
794
|
+
return ret >>> 0;
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* Get list of band keys (IDs and labels) that have signals.
|
|
798
|
+
* Returns a JSON array of strings.
|
|
799
|
+
* @returns {string}
|
|
800
|
+
*/
|
|
801
|
+
get_band_signal_keys() {
|
|
802
|
+
let deferred1_0;
|
|
803
|
+
let deferred1_1;
|
|
804
|
+
try {
|
|
805
|
+
const ret = wasm.wasmvisualiser_get_band_signal_keys(this.__wbg_ptr);
|
|
806
|
+
deferred1_0 = ret[0];
|
|
807
|
+
deferred1_1 = ret[1];
|
|
808
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
809
|
+
} finally {
|
|
810
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
811
|
+
}
|
|
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
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* Check if performance profiling is currently enabled.
|
|
832
|
+
* @returns {boolean}
|
|
833
|
+
*/
|
|
834
|
+
is_profiling_enabled() {
|
|
835
|
+
const ret = wasm.wasmvisualiser_is_profiling_enabled(this.__wbg_ptr);
|
|
836
|
+
return ret !== 0;
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* Clear the frequency band structure.
|
|
840
|
+
*/
|
|
841
|
+
clear_frequency_bands() {
|
|
842
|
+
wasm.wasmvisualiser_clear_frequency_bands(this.__wbg_ptr);
|
|
843
|
+
}
|
|
844
|
+
/**
|
|
845
|
+
* Get camera state as JSON for inspector.
|
|
846
|
+
* Returns current position, rotation, target, fov, near, far, mode, and signal flags.
|
|
847
|
+
* @returns {string}
|
|
848
|
+
*/
|
|
849
|
+
get_camera_state_json() {
|
|
850
|
+
let deferred1_0;
|
|
851
|
+
let deferred1_1;
|
|
852
|
+
try {
|
|
853
|
+
const ret = wasm.wasmvisualiser_get_camera_state_json(this.__wbg_ptr);
|
|
854
|
+
deferred1_0 = ret[0];
|
|
855
|
+
deferred1_1 = ret[1];
|
|
856
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
857
|
+
} finally {
|
|
858
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
/**
|
|
862
|
+
* Enable or disable performance profiling.
|
|
863
|
+
* When enabled, console timing and collection size logging will be active.
|
|
864
|
+
* @param {boolean} enabled
|
|
865
|
+
*/
|
|
866
|
+
set_profiling_enabled(enabled) {
|
|
867
|
+
wasm.wasmvisualiser_set_profiling_enabled(this.__wbg_ptr, enabled);
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* Unregister a mesh asset.
|
|
871
|
+
* Returns true if the asset was unregistered, false if it didn't exist.
|
|
872
|
+
* @param {string} asset_id
|
|
873
|
+
* @returns {boolean}
|
|
874
|
+
*/
|
|
875
|
+
unregister_mesh_asset(asset_id) {
|
|
876
|
+
const ptr0 = passStringToWasm0(asset_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
877
|
+
const len0 = WASM_VECTOR_LEN;
|
|
878
|
+
const ret = wasm.wasmvisualiser_unregister_mesh_asset(this.__wbg_ptr, ptr0, len0);
|
|
879
|
+
return ret !== 0;
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* Get list of custom signal keys (IDs and labels).
|
|
883
|
+
* Returns a JSON array of strings.
|
|
884
|
+
* @returns {string}
|
|
885
|
+
*/
|
|
886
|
+
get_custom_signal_keys() {
|
|
887
|
+
let deferred1_0;
|
|
888
|
+
let deferred1_1;
|
|
889
|
+
try {
|
|
890
|
+
const ret = wasm.wasmvisualiser_get_custom_signal_keys(this.__wbg_ptr);
|
|
891
|
+
deferred1_0 = ret[0];
|
|
892
|
+
deferred1_1 = ret[1];
|
|
893
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
894
|
+
} finally {
|
|
895
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
/**
|
|
899
|
+
* Get the number of events in a named event stream.
|
|
900
|
+
* Returns 0 if no events are stored for this name.
|
|
901
|
+
* @param {string} name
|
|
902
|
+
* @returns {number}
|
|
903
|
+
*/
|
|
904
|
+
get_event_stream_count(name) {
|
|
905
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
906
|
+
const len0 = WASM_VECTOR_LEN;
|
|
907
|
+
const ret = wasm.wasmvisualiser_get_event_stream_count(this.__wbg_ptr, ptr0, len0);
|
|
908
|
+
return ret >>> 0;
|
|
909
|
+
}
|
|
910
|
+
/**
|
|
911
|
+
* Get the number of frequency bands.
|
|
912
|
+
* @returns {number}
|
|
913
|
+
*/
|
|
914
|
+
get_frequency_band_count() {
|
|
915
|
+
const ret = wasm.wasmvisualiser_get_frequency_band_count(this.__wbg_ptr);
|
|
916
|
+
return ret >>> 0;
|
|
917
|
+
}
|
|
918
|
+
/**
|
|
919
|
+
* Run script in analysis mode with event extraction support.
|
|
920
|
+
*
|
|
921
|
+
* This runs the script headlessly across the full track duration,
|
|
922
|
+
* collecting all debug.emit() calls AND extracting events from
|
|
923
|
+
* any signal.pick.events() calls.
|
|
924
|
+
*
|
|
925
|
+
* Returns a JSON-serialized ExtendedAnalysisResultJson.
|
|
926
|
+
* @param {string} script
|
|
927
|
+
* @param {number} duration
|
|
928
|
+
* @param {number} time_step
|
|
929
|
+
* @returns {string}
|
|
930
|
+
*/
|
|
931
|
+
run_analysis_with_events(script, duration, time_step) {
|
|
932
|
+
let deferred2_0;
|
|
933
|
+
let deferred2_1;
|
|
934
|
+
try {
|
|
935
|
+
const ptr0 = passStringToWasm0(script, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
936
|
+
const len0 = WASM_VECTOR_LEN;
|
|
937
|
+
const ret = wasm.wasmvisualiser_run_analysis_with_events(this.__wbg_ptr, ptr0, len0, duration, time_step);
|
|
938
|
+
deferred2_0 = ret[0];
|
|
939
|
+
deferred2_1 = ret[1];
|
|
940
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
941
|
+
} finally {
|
|
942
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
/**
|
|
946
|
+
* Get entity positions as JSON for debugging.
|
|
947
|
+
* Returns a JSON array of objects with id, type, and position fields.
|
|
948
|
+
* @returns {string}
|
|
949
|
+
*/
|
|
950
|
+
get_entity_positions_json() {
|
|
951
|
+
let deferred1_0;
|
|
952
|
+
let deferred1_1;
|
|
953
|
+
try {
|
|
954
|
+
const ret = wasm.wasmvisualiser_get_entity_positions_json(this.__wbg_ptr);
|
|
955
|
+
deferred1_0 = ret[0];
|
|
956
|
+
deferred1_1 = ret[1];
|
|
957
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
958
|
+
} finally {
|
|
959
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
/**
|
|
963
|
+
* Push an authored event stream for script access.
|
|
964
|
+
*
|
|
965
|
+
* The event stream will be available as `inputs.authored["name"]` in Rhai scripts.
|
|
966
|
+
* This is used for user-authored events (promoted or manually created).
|
|
967
|
+
*
|
|
968
|
+
* The JSON format should be an array of event objects with:
|
|
969
|
+
* - time: f32
|
|
970
|
+
* - weight: f32
|
|
971
|
+
* - beat_position: Option<f32>
|
|
972
|
+
* - beat_phase: Option<f32>
|
|
973
|
+
* - cluster_id: Option<u32>
|
|
974
|
+
*
|
|
975
|
+
* Returns true if successful, false if parsing failed.
|
|
976
|
+
* @param {string} name
|
|
977
|
+
* @param {string} events_json
|
|
978
|
+
* @returns {boolean}
|
|
979
|
+
*/
|
|
980
|
+
push_authored_event_stream(name, events_json) {
|
|
981
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
982
|
+
const len0 = WASM_VECTOR_LEN;
|
|
983
|
+
const ptr1 = passStringToWasm0(events_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
984
|
+
const len1 = WASM_VECTOR_LEN;
|
|
985
|
+
const ret = wasm.wasmvisualiser_push_authored_event_stream(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
986
|
+
return ret !== 0;
|
|
987
|
+
}
|
|
988
|
+
/**
|
|
989
|
+
* Clear all authored event streams.
|
|
990
|
+
*/
|
|
991
|
+
clear_authored_event_streams() {
|
|
992
|
+
wasm.wasmvisualiser_clear_authored_event_streams(this.__wbg_ptr);
|
|
993
|
+
}
|
|
994
|
+
/**
|
|
995
|
+
* Set available custom signals for script namespace generation.
|
|
996
|
+
* This registers custom signal IDs and labels so the script engine can generate
|
|
997
|
+
* `inputs.customSignals["signal_id"]` accessors.
|
|
998
|
+
*
|
|
999
|
+
* The JSON format should be an array of [id, label] pairs:
|
|
1000
|
+
* `[["signal-abc123", "My Signal"], ["signal-def456", "Another Signal"]]`
|
|
1001
|
+
*
|
|
1002
|
+
* Returns true if successful, false if parsing failed.
|
|
1003
|
+
* @param {string} json
|
|
1004
|
+
* @returns {boolean}
|
|
1005
|
+
*/
|
|
1006
|
+
set_available_custom_signals(json) {
|
|
1007
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1008
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1009
|
+
const ret = wasm.wasmvisualiser_set_available_custom_signals(this.__wbg_ptr, ptr0, len0);
|
|
1010
|
+
return ret !== 0;
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* Drain and return any pending structured script diagnostics as JSON.
|
|
1014
|
+
*
|
|
1015
|
+
* Intended for UI consumption. Calling this clears the pending diagnostics
|
|
1016
|
+
* queue so repeated polling does not duplicate messages.
|
|
1017
|
+
* @returns {string}
|
|
1018
|
+
*/
|
|
1019
|
+
take_script_diagnostics_json() {
|
|
1020
|
+
let deferred1_0;
|
|
1021
|
+
let deferred1_1;
|
|
1022
|
+
try {
|
|
1023
|
+
const ret = wasm.wasmvisualiser_take_script_diagnostics_json(this.__wbg_ptr);
|
|
1024
|
+
deferred1_0 = ret[0];
|
|
1025
|
+
deferred1_1 = ret[1];
|
|
1026
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1027
|
+
} finally {
|
|
1028
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
/**
|
|
1032
|
+
* Get the number of events in an authored event stream.
|
|
1033
|
+
* Returns 0 if no events are stored for this name.
|
|
1034
|
+
* @param {string} name
|
|
1035
|
+
* @returns {number}
|
|
1036
|
+
*/
|
|
1037
|
+
get_authored_event_stream_count(name) {
|
|
1038
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1039
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1040
|
+
const ret = wasm.wasmvisualiser_get_authored_event_stream_count(this.__wbg_ptr, ptr0, len0);
|
|
1041
|
+
return ret >>> 0;
|
|
1042
|
+
}
|
|
376
1043
|
constructor() {
|
|
377
1044
|
const ret = wasm.wasmvisualiser_new();
|
|
378
1045
|
this.__wbg_ptr = ret >>> 0;
|
|
@@ -419,6 +1086,27 @@ export function create_visualiser(canvas) {
|
|
|
419
1086
|
return ret;
|
|
420
1087
|
}
|
|
421
1088
|
|
|
1089
|
+
/**
|
|
1090
|
+
* Get the host-defined Script API metadata as a JSON string.
|
|
1091
|
+
*
|
|
1092
|
+
* This is a stable, versioned description of the scripting API surface and is
|
|
1093
|
+
* intended to drive editor UX (autocomplete/hover/docs) and future language
|
|
1094
|
+
* bindings.
|
|
1095
|
+
* @returns {string}
|
|
1096
|
+
*/
|
|
1097
|
+
export function get_script_api_metadata_json() {
|
|
1098
|
+
let deferred1_0;
|
|
1099
|
+
let deferred1_1;
|
|
1100
|
+
try {
|
|
1101
|
+
const ret = wasm.get_script_api_metadata_json();
|
|
1102
|
+
deferred1_0 = ret[0];
|
|
1103
|
+
deferred1_1 = ret[1];
|
|
1104
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1105
|
+
} finally {
|
|
1106
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
|
|
422
1110
|
export function init_panic_hook() {
|
|
423
1111
|
wasm.init_panic_hook();
|
|
424
1112
|
}
|
|
@@ -1039,7 +1727,7 @@ function __wbg_get_imports() {
|
|
|
1039
1727
|
const a = state0.a;
|
|
1040
1728
|
state0.a = 0;
|
|
1041
1729
|
try {
|
|
1042
|
-
return
|
|
1730
|
+
return wasm_bindgen__convert__closures_____invoke__h12a8c25a05856851(a, state0.b, arg0, arg1);
|
|
1043
1731
|
} finally {
|
|
1044
1732
|
state0.a = a;
|
|
1045
1733
|
}
|
|
@@ -1070,6 +1758,10 @@ function __wbg_get_imports() {
|
|
|
1070
1758
|
const ret = arg0.offset;
|
|
1071
1759
|
return ret;
|
|
1072
1760
|
};
|
|
1761
|
+
imports.wbg.__wbg_performance_c77a440eff2efd9b = function(arg0) {
|
|
1762
|
+
const ret = arg0.performance;
|
|
1763
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1764
|
+
};
|
|
1073
1765
|
imports.wbg.__wbg_popErrorScope_af0b22f136a861d6 = function(arg0) {
|
|
1074
1766
|
const ret = arg0.popErrorScope();
|
|
1075
1767
|
return ret;
|
|
@@ -1241,6 +1933,12 @@ function __wbg_get_imports() {
|
|
|
1241
1933
|
const ret = arg0.then(arg1);
|
|
1242
1934
|
return ret;
|
|
1243
1935
|
};
|
|
1936
|
+
imports.wbg.__wbg_timeEnd_46ed224117e5f2d2 = function(arg0, arg1) {
|
|
1937
|
+
console.timeEnd(getStringFromWasm0(arg0, arg1));
|
|
1938
|
+
};
|
|
1939
|
+
imports.wbg.__wbg_time_c49415b636fbbf3f = function(arg0, arg1) {
|
|
1940
|
+
console.time(getStringFromWasm0(arg0, arg1));
|
|
1941
|
+
};
|
|
1244
1942
|
imports.wbg.__wbg_type_c0d5d83032e9858a = function(arg0) {
|
|
1245
1943
|
const ret = arg0.type;
|
|
1246
1944
|
return (__wbindgen_enum_GpuCompilationMessageType.indexOf(ret) + 1 || 4) - 1;
|
|
@@ -1273,19 +1971,19 @@ function __wbg_get_imports() {
|
|
|
1273
1971
|
imports.wbg.__wbg_writeTexture_246118eb2f5a1592 = function(arg0, arg1, arg2, arg3, arg4) {
|
|
1274
1972
|
arg0.writeTexture(arg1, arg2, arg3, arg4);
|
|
1275
1973
|
};
|
|
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
1974
|
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
1282
1975
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1283
1976
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
1284
1977
|
return ret;
|
|
1285
1978
|
};
|
|
1286
|
-
imports.wbg.
|
|
1287
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1288
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1979
|
+
imports.wbg.__wbindgen_cast_ad7098fabcb3be64 = function(arg0, arg1) {
|
|
1980
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3454, function: Function { arguments: [Externref], shim_idx: 3455, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1981
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hff2bb8e37b7072b2, wasm_bindgen__convert__closures_____invoke__hd456749e88b4d731);
|
|
1982
|
+
return ret;
|
|
1983
|
+
};
|
|
1984
|
+
imports.wbg.__wbindgen_cast_b71f11108f0008f4 = function(arg0, arg1) {
|
|
1985
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 3445, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 3446, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1986
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h6518d8d5fffe1051, wasm_bindgen__convert__closures_____invoke__h09705603bb35b975);
|
|
1289
1987
|
return ret;
|
|
1290
1988
|
};
|
|
1291
1989
|
imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
|
package/pkg/visualiser_bg.wasm
CHANGED
|
Binary file
|
|
@@ -3,26 +3,72 @@
|
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const __wbg_wasmvisualiser_free: (a: number, b: number) => void;
|
|
5
5
|
export const create_visualiser: (a: any) => any;
|
|
6
|
+
export const get_script_api_metadata_json: () => [number, number];
|
|
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;
|
|
9
|
+
export const wasmvisualiser_clear_band_events: (a: number) => void;
|
|
10
|
+
export const wasmvisualiser_clear_band_signals: (a: number) => void;
|
|
11
|
+
export const wasmvisualiser_clear_custom_signals: (a: number) => void;
|
|
12
|
+
export const wasmvisualiser_clear_event_streams: (a: number) => void;
|
|
13
|
+
export const wasmvisualiser_clear_frequency_bands: (a: number) => void;
|
|
14
|
+
export const wasmvisualiser_clear_isolation: (a: number) => void;
|
|
15
|
+
export const wasmvisualiser_clear_musical_time: (a: number) => void;
|
|
6
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;
|
|
19
|
+
export const wasmvisualiser_get_band_bounds_at: (a: number, b: number) => [number, number];
|
|
20
|
+
export const wasmvisualiser_get_band_event_count: (a: number, b: number, c: number) => number;
|
|
21
|
+
export const wasmvisualiser_get_band_signal_keys: (a: number) => [number, number];
|
|
22
|
+
export const wasmvisualiser_get_camera_state_json: (a: number) => [number, number];
|
|
7
23
|
export const wasmvisualiser_get_current_vals: (a: number) => [number, number];
|
|
24
|
+
export const wasmvisualiser_get_custom_signal_keys: (a: number) => [number, number];
|
|
25
|
+
export const wasmvisualiser_get_entity_positions_json: (a: number) => [number, number];
|
|
26
|
+
export const wasmvisualiser_get_event_stream_count: (a: number, b: number, c: number) => number;
|
|
27
|
+
export const wasmvisualiser_get_frequency_band_count: (a: number) => number;
|
|
8
28
|
export const wasmvisualiser_get_script_error: (a: number) => [number, number];
|
|
29
|
+
export const wasmvisualiser_get_script_signals: (a: number) => [number, number];
|
|
30
|
+
export const wasmvisualiser_get_signal_names: (a: number) => [number, number];
|
|
31
|
+
export const wasmvisualiser_get_stem_signal_keys: (a: number) => [number, number];
|
|
32
|
+
export const wasmvisualiser_has_frequency_bands: (a: number) => number;
|
|
9
33
|
export const wasmvisualiser_has_script: (a: number) => number;
|
|
34
|
+
export const wasmvisualiser_has_signal: (a: number, b: number, c: number) => number;
|
|
35
|
+
export const wasmvisualiser_is_profiling_enabled: (a: number) => number;
|
|
36
|
+
export const wasmvisualiser_isolate_entity: (a: number, b: bigint) => void;
|
|
37
|
+
export const wasmvisualiser_list_mesh_assets: (a: number) => [number, number];
|
|
10
38
|
export const wasmvisualiser_load_script: (a: number, b: number, c: number) => number;
|
|
11
39
|
export const wasmvisualiser_new: () => number;
|
|
40
|
+
export const wasmvisualiser_push_authored_event_stream: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
41
|
+
export const wasmvisualiser_push_band_events: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
42
|
+
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;
|
|
43
|
+
export const wasmvisualiser_push_custom_signal: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
12
44
|
export const wasmvisualiser_push_data: (a: number, b: number, c: number, d: number) => void;
|
|
45
|
+
export const wasmvisualiser_push_event_stream: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
13
46
|
export const wasmvisualiser_push_signal: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
47
|
+
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;
|
|
14
48
|
export const wasmvisualiser_push_zoom_data: (a: number, b: number, c: number, d: number) => void;
|
|
49
|
+
export const wasmvisualiser_register_mesh_asset: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
15
50
|
export const wasmvisualiser_render: (a: number, b: number) => void;
|
|
51
|
+
export const wasmvisualiser_render_with_budget: (a: number, b: number, c: number) => number;
|
|
16
52
|
export const wasmvisualiser_resize: (a: number, b: number, c: number) => void;
|
|
53
|
+
export const wasmvisualiser_run_analysis: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
54
|
+
export const wasmvisualiser_run_analysis_with_events: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
55
|
+
export const wasmvisualiser_set_available_custom_signals: (a: number, b: number, c: number) => number;
|
|
56
|
+
export const wasmvisualiser_set_available_stems: (a: number, b: number, c: number) => number;
|
|
57
|
+
export const wasmvisualiser_set_debug_options: (a: number, b: number, c: number) => void;
|
|
58
|
+
export const wasmvisualiser_set_frequency_bands: (a: number, b: number, c: number) => number;
|
|
59
|
+
export const wasmvisualiser_set_musical_time: (a: number, b: number, c: number) => number;
|
|
60
|
+
export const wasmvisualiser_set_profiling_enabled: (a: number, b: number) => void;
|
|
17
61
|
export const wasmvisualiser_set_sigmoid_k: (a: number, b: number) => void;
|
|
18
62
|
export const wasmvisualiser_set_time: (a: number, b: number) => void;
|
|
19
|
-
export const
|
|
63
|
+
export const wasmvisualiser_take_script_diagnostics_json: (a: number) => [number, number];
|
|
64
|
+
export const wasmvisualiser_unregister_mesh_asset: (a: number, b: number, c: number) => number;
|
|
20
65
|
export const wasmvisualiser_push_rotation_data: (a: number, b: number, c: number, d: number) => void;
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
23
|
-
export const
|
|
24
|
-
export const
|
|
25
|
-
export const
|
|
66
|
+
export const init_panic_hook: () => void;
|
|
67
|
+
export const wasm_bindgen__convert__closures_____invoke__h09705603bb35b975: (a: number, b: number, c: any) => void;
|
|
68
|
+
export const wasm_bindgen__closure__destroy__h6518d8d5fffe1051: (a: number, b: number) => void;
|
|
69
|
+
export const wasm_bindgen__convert__closures_____invoke__hd456749e88b4d731: (a: number, b: number, c: any) => void;
|
|
70
|
+
export const wasm_bindgen__closure__destroy__hff2bb8e37b7072b2: (a: number, b: number) => void;
|
|
71
|
+
export const wasm_bindgen__convert__closures_____invoke__h12a8c25a05856851: (a: number, b: number, c: any, d: any) => void;
|
|
26
72
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
27
73
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
28
74
|
export const __wbindgen_exn_store: (a: number) => void;
|