@ilusiv/fyug-js 2026.11.2 → 2026.11.4
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/README.md +69 -15
- package/dist/FuguePlayer.d.ts +4 -1
- package/dist/FuguePlayer.d.ts.map +1 -1
- package/dist/FuguePlayer.js +25 -51
- package/dist/FuguePlayer.js.map +1 -1
- package/dist/fugue-audio-worklet.js +1 -1
- package/dist/generated/embedded-assets.d.ts +2 -2
- package/dist/generated/embedded-assets.d.ts.map +1 -1
- package/dist/generated/embedded-assets.js +2 -2
- package/dist/generated/embedded-assets.js.map +1 -1
- package/dist/generated/fugue.d.ts +13 -0
- package/dist/generated/fugue.js +97 -0
- package/dist/generated/fugue_bg.wasm +0 -0
- package/dist/generated/fugue_bg.wasm.d.ts +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/note-preview.d.ts +29 -0
- package/dist/note-preview.d.ts.map +1 -0
- package/dist/note-preview.js +74 -0
- package/dist/note-preview.js.map +1 -0
- package/dist/runtime-assets.d.ts +14 -0
- package/dist/runtime-assets.d.ts.map +1 -0
- package/dist/runtime-assets.js +70 -0
- package/dist/runtime-assets.js.map +1 -0
- package/dist/types.d.ts +76 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embedded-assets.js","sourceRoot":"","sources":["../../src/generated/embedded-assets.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"embedded-assets.js","sourceRoot":"","sources":["../../src/generated/embedded-assets.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAW,kgcAAkgc,CAAC;AAEhjc,MAAM,CAAC,MAAM,kBAAkB,GAAW,s/rtHAAs/rtH,CAAC"}
|
|
@@ -63,6 +63,15 @@ export class FugueEngine {
|
|
|
63
63
|
* Creates a new engine for the given sample rate.
|
|
64
64
|
*/
|
|
65
65
|
constructor(sample_rate: number);
|
|
66
|
+
/**
|
|
67
|
+
* Lists the notes `json` (an invention document) plays over a range of
|
|
68
|
+
* bars, as `request` (JSON) asks, without playing it or touching the
|
|
69
|
+
* engine's own piece. Resolves to the answer as JSON, or rejects with
|
|
70
|
+
* a string (see `docs/preview-notes.md`). Works in slices that yield
|
|
71
|
+
* with `setTimeout(0)`: call it from a page or a worker, not an
|
|
72
|
+
* AudioWorklet.
|
|
73
|
+
*/
|
|
74
|
+
previewNotes(json: string, request: string): Promise<any>;
|
|
66
75
|
/**
|
|
67
76
|
* Removes a module from the loaded graph.
|
|
68
77
|
*/
|
|
@@ -130,6 +139,7 @@ export interface InitOutput {
|
|
|
130
139
|
readonly fugueengine_listModules: (a: number) => [number, number, number, number];
|
|
131
140
|
readonly fugueengine_loadInvention: (a: number, b: number, c: number) => [number, number];
|
|
132
141
|
readonly fugueengine_new: (a: number) => number;
|
|
142
|
+
readonly fugueengine_previewNotes: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
133
143
|
readonly fugueengine_removeModule: (a: number, b: number, c: number) => [number, number];
|
|
134
144
|
readonly fugueengine_renderInterleaved: (a: number, b: number) => [number, number, number, number];
|
|
135
145
|
readonly fugueengine_renderInterleavedInto: (a: number, b: any) => [number, number, number];
|
|
@@ -141,9 +151,12 @@ export interface InitOutput {
|
|
|
141
151
|
readonly fugueengine_setControlNumber: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
142
152
|
readonly fugueengine_setControlString: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
|
|
143
153
|
readonly fugueengine_status: (a: number) => [number, number, number, number];
|
|
154
|
+
readonly wasm_bindgen__convert__closures_____invoke__h1b9b7a832ddda534: (a: number, b: number, c: any, d: any) => void;
|
|
155
|
+
readonly wasm_bindgen__convert__closures_____invoke__hd2d6d321acd2ef74: (a: number, b: number) => void;
|
|
144
156
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
145
157
|
readonly __externref_table_alloc: () => number;
|
|
146
158
|
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
159
|
+
readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
|
|
147
160
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
148
161
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
149
162
|
readonly __externref_table_dealloc: (a: number) => void;
|
package/dist/generated/fugue.js
CHANGED
|
@@ -285,6 +285,25 @@ export class FugueEngine {
|
|
|
285
285
|
FugueEngineFinalization.register(this, this.__wbg_ptr, this);
|
|
286
286
|
return this;
|
|
287
287
|
}
|
|
288
|
+
/**
|
|
289
|
+
* Lists the notes `json` (an invention document) plays over a range of
|
|
290
|
+
* bars, as `request` (JSON) asks, without playing it or touching the
|
|
291
|
+
* engine's own piece. Resolves to the answer as JSON, or rejects with
|
|
292
|
+
* a string (see `docs/preview-notes.md`). Works in slices that yield
|
|
293
|
+
* with `setTimeout(0)`: call it from a page or a worker, not an
|
|
294
|
+
* AudioWorklet.
|
|
295
|
+
* @param {string} json
|
|
296
|
+
* @param {string} request
|
|
297
|
+
* @returns {Promise<any>}
|
|
298
|
+
*/
|
|
299
|
+
previewNotes(json, request) {
|
|
300
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
301
|
+
const len0 = WASM_VECTOR_LEN;
|
|
302
|
+
const ptr1 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
303
|
+
const len1 = WASM_VECTOR_LEN;
|
|
304
|
+
const ret = wasm.fugueengine_previewNotes(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
305
|
+
return ret;
|
|
306
|
+
}
|
|
288
307
|
/**
|
|
289
308
|
* Removes a module from the loaded graph.
|
|
290
309
|
* @param {string} id
|
|
@@ -453,6 +472,13 @@ function __wbg_get_imports() {
|
|
|
453
472
|
__wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
|
|
454
473
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
455
474
|
},
|
|
475
|
+
__wbg__wbg_cb_unref_dcc1a90847f04c41: function(arg0) {
|
|
476
|
+
arg0._wbg_cb_unref();
|
|
477
|
+
},
|
|
478
|
+
__wbg_call_187d372bd5fdd4aa: function() { return handleError(function (arg0, arg1, arg2) {
|
|
479
|
+
const ret = arg0.call(arg1, arg2);
|
|
480
|
+
return ret;
|
|
481
|
+
}, arguments); },
|
|
456
482
|
__wbg_getRandomValues_436a51d0629d84e1: function() { return handleError(function (arg0, arg1) {
|
|
457
483
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
458
484
|
}, arguments); },
|
|
@@ -460,10 +486,41 @@ function __wbg_get_imports() {
|
|
|
460
486
|
const ret = arg0.length;
|
|
461
487
|
return ret;
|
|
462
488
|
},
|
|
489
|
+
__wbg_new_5502aad30c185fc8: function(arg0, arg1) {
|
|
490
|
+
try {
|
|
491
|
+
var state0 = {a: arg0, b: arg1};
|
|
492
|
+
var cb0 = (arg0, arg1) => {
|
|
493
|
+
const a = state0.a;
|
|
494
|
+
state0.a = 0;
|
|
495
|
+
try {
|
|
496
|
+
return wasm_bindgen__convert__closures_____invoke__h1b9b7a832ddda534(a, state0.b, arg0, arg1);
|
|
497
|
+
} finally {
|
|
498
|
+
state0.a = a;
|
|
499
|
+
}
|
|
500
|
+
};
|
|
501
|
+
const ret = new Promise(cb0);
|
|
502
|
+
return ret;
|
|
503
|
+
} finally {
|
|
504
|
+
state0.a = 0;
|
|
505
|
+
}
|
|
506
|
+
},
|
|
507
|
+
__wbg_now_aa4ccb83129e9e55: function() {
|
|
508
|
+
const ret = Date.now();
|
|
509
|
+
return ret;
|
|
510
|
+
},
|
|
511
|
+
__wbg_setTimeout_4bf75e1eaccfc9e2: function(arg0, arg1) {
|
|
512
|
+
const ret = setTimeout(arg0, arg1);
|
|
513
|
+
return ret;
|
|
514
|
+
},
|
|
463
515
|
__wbg_set_070bd465f1c195a4: function(arg0, arg1, arg2) {
|
|
464
516
|
arg0.set(getArrayF32FromWasm0(arg1, arg2));
|
|
465
517
|
},
|
|
466
518
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
519
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 1597, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
520
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hd2d6d321acd2ef74);
|
|
521
|
+
return ret;
|
|
522
|
+
},
|
|
523
|
+
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
467
524
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
468
525
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
469
526
|
return ret;
|
|
@@ -484,6 +541,14 @@ function __wbg_get_imports() {
|
|
|
484
541
|
};
|
|
485
542
|
}
|
|
486
543
|
|
|
544
|
+
function wasm_bindgen__convert__closures_____invoke__hd2d6d321acd2ef74(arg0, arg1) {
|
|
545
|
+
wasm.wasm_bindgen__convert__closures_____invoke__hd2d6d321acd2ef74(arg0, arg1);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
function wasm_bindgen__convert__closures_____invoke__h1b9b7a832ddda534(arg0, arg1, arg2, arg3) {
|
|
549
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h1b9b7a832ddda534(arg0, arg1, arg2, arg3);
|
|
550
|
+
}
|
|
551
|
+
|
|
487
552
|
const FugueEngineFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
488
553
|
? { register: () => {}, unregister: () => {} }
|
|
489
554
|
: new FinalizationRegistry(ptr => wasm.__wbg_fugueengine_free(ptr, 1));
|
|
@@ -494,6 +559,10 @@ function addToExternrefTable0(obj) {
|
|
|
494
559
|
return idx;
|
|
495
560
|
}
|
|
496
561
|
|
|
562
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
563
|
+
? { register: () => {}, unregister: () => {} }
|
|
564
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
|
|
565
|
+
|
|
497
566
|
function getArrayF32FromWasm0(ptr, len) {
|
|
498
567
|
ptr = ptr >>> 0;
|
|
499
568
|
return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
@@ -537,6 +606,34 @@ function isLikeNone(x) {
|
|
|
537
606
|
return x === undefined || x === null;
|
|
538
607
|
}
|
|
539
608
|
|
|
609
|
+
function makeMutClosure(arg0, arg1, f) {
|
|
610
|
+
const state = { a: arg0, b: arg1, cnt: 1 };
|
|
611
|
+
const real = (...args) => {
|
|
612
|
+
|
|
613
|
+
// First up with a closure we increment the internal reference
|
|
614
|
+
// count. This ensures that the Rust closure environment won't
|
|
615
|
+
// be deallocated while we're invoking it.
|
|
616
|
+
state.cnt++;
|
|
617
|
+
const a = state.a;
|
|
618
|
+
state.a = 0;
|
|
619
|
+
try {
|
|
620
|
+
return f(a, state.b, ...args);
|
|
621
|
+
} finally {
|
|
622
|
+
state.a = a;
|
|
623
|
+
real._wbg_cb_unref();
|
|
624
|
+
}
|
|
625
|
+
};
|
|
626
|
+
real._wbg_cb_unref = () => {
|
|
627
|
+
if (--state.cnt === 0) {
|
|
628
|
+
wasm.__wbindgen_destroy_closure(state.a, state.b);
|
|
629
|
+
state.a = 0;
|
|
630
|
+
CLOSURE_DTORS.unregister(state);
|
|
631
|
+
}
|
|
632
|
+
};
|
|
633
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
634
|
+
return real;
|
|
635
|
+
}
|
|
636
|
+
|
|
540
637
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
541
638
|
if (realloc === undefined) {
|
|
542
639
|
const buf = cachedTextEncoder.encode(arg);
|
|
Binary file
|
|
@@ -15,6 +15,7 @@ export const fugueengine_listControls: (a: number, b: number, c: number) => [num
|
|
|
15
15
|
export const fugueengine_listModules: (a: number) => [number, number, number, number];
|
|
16
16
|
export const fugueengine_loadInvention: (a: number, b: number, c: number) => [number, number];
|
|
17
17
|
export const fugueengine_new: (a: number) => number;
|
|
18
|
+
export const fugueengine_previewNotes: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
18
19
|
export const fugueengine_removeModule: (a: number, b: number, c: number) => [number, number];
|
|
19
20
|
export const fugueengine_renderInterleaved: (a: number, b: number) => [number, number, number, number];
|
|
20
21
|
export const fugueengine_renderInterleavedInto: (a: number, b: any) => [number, number, number];
|
|
@@ -26,9 +27,12 @@ export const fugueengine_setControlBool: (a: number, b: number, c: number, d: nu
|
|
|
26
27
|
export const fugueengine_setControlNumber: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
27
28
|
export const fugueengine_setControlString: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number];
|
|
28
29
|
export const fugueengine_status: (a: number) => [number, number, number, number];
|
|
30
|
+
export const wasm_bindgen__convert__closures_____invoke__h1b9b7a832ddda534: (a: number, b: number, c: any, d: any) => void;
|
|
31
|
+
export const wasm_bindgen__convert__closures_____invoke__hd2d6d321acd2ef74: (a: number, b: number) => void;
|
|
29
32
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
30
33
|
export const __externref_table_alloc: () => number;
|
|
31
34
|
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
35
|
+
export const __wbindgen_destroy_closure: (a: number, b: number) => void;
|
|
32
36
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
33
37
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
34
38
|
export const __externref_table_dealloc: (a: number) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { FuguePlayer } from "./FuguePlayer.js";
|
|
2
2
|
export { SUPPORTED_MODULES_SCHEMA, unsupportedModuleTypes, } from "./supported-modules.js";
|
|
3
3
|
export type { SupportedModule, SupportedModules } from "./supported-modules.js";
|
|
4
|
-
export type { ControlValue, FuguePlayerInstance, FuguePlayerOptions, FuguePlayerState, RuntimeConnection, RuntimeControlGroup, RuntimeModule, RuntimeStatus, } from "./types.js";
|
|
4
|
+
export type { ControlValue, FuguePlayerInstance, FuguePlayerOptions, FuguePlayerRenderer, FuguePlayerState, NotePreview, NotePreviewRequest, PreviewedNote, RuntimeConnection, RuntimeControlGroup, RuntimeModule, RuntimeStatus, } from "./types.js";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EACL,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAChF,YAAY,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,aAAa,GACd,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EACL,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAChF,YAAY,EACV,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,aAAa,GACd,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type InitOutput } from "./generated/fugue.js";
|
|
2
|
+
import type { NotePreview, NotePreviewRequest } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* The engine a player lists notes on: its own instance on the page's main
|
|
5
|
+
* thread, made on the first call. The engine that plays is never asked, so a
|
|
6
|
+
* preview cannot reach the piece being heard. A worklet's engine could not
|
|
7
|
+
* run one anyway: the preview works in slices scheduled with `setTimeout`,
|
|
8
|
+
* which an AudioWorklet does not have.
|
|
9
|
+
*/
|
|
10
|
+
export declare class NotePreviewer {
|
|
11
|
+
private readonly load;
|
|
12
|
+
private readonly sampleRate;
|
|
13
|
+
private engine?;
|
|
14
|
+
private disposed;
|
|
15
|
+
/**
|
|
16
|
+
* `load` makes the wasm module ready on this thread (the bytes the player
|
|
17
|
+
* already uses); `sampleRate` is the player's, so the engine's frame limit
|
|
18
|
+
* matches the piece's.
|
|
19
|
+
*/
|
|
20
|
+
constructor(load: () => Promise<InitOutput>, sampleRate: number);
|
|
21
|
+
preview(json: string, request: NotePreviewRequest): Promise<NotePreview>;
|
|
22
|
+
/**
|
|
23
|
+
* Frees the engine, without waiting for one still loading (it frees
|
|
24
|
+
* itself). A preview already running still settles.
|
|
25
|
+
*/
|
|
26
|
+
dispose(): void;
|
|
27
|
+
private ready;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=note-preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"note-preview.d.ts","sourceRoot":"","sources":["../src/note-preview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAElE;;;;;;GAMG;AACH,qBAAa,aAAa;IAUtB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAV7B,OAAO,CAAC,MAAM,CAAC,CAAuB;IACtC,OAAO,CAAC,QAAQ,CAAS;IAEzB;;;;OAIG;gBAEgB,IAAI,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,EAC/B,UAAU,EAAE,MAAM;IAG/B,OAAO,CACX,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,WAAW,CAAC;IAiBvB;;;OAGG;IACH,OAAO,IAAI,IAAI;IASf,OAAO,CAAC,KAAK;CAyBd"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { FugueEngine } from "./generated/fugue.js";
|
|
2
|
+
import { parseJson } from "./runtime-assets.js";
|
|
3
|
+
/**
|
|
4
|
+
* The engine a player lists notes on: its own instance on the page's main
|
|
5
|
+
* thread, made on the first call. The engine that plays is never asked, so a
|
|
6
|
+
* preview cannot reach the piece being heard. A worklet's engine could not
|
|
7
|
+
* run one anyway: the preview works in slices scheduled with `setTimeout`,
|
|
8
|
+
* which an AudioWorklet does not have.
|
|
9
|
+
*/
|
|
10
|
+
export class NotePreviewer {
|
|
11
|
+
load;
|
|
12
|
+
sampleRate;
|
|
13
|
+
engine;
|
|
14
|
+
disposed = false;
|
|
15
|
+
/**
|
|
16
|
+
* `load` makes the wasm module ready on this thread (the bytes the player
|
|
17
|
+
* already uses); `sampleRate` is the player's, so the engine's frame limit
|
|
18
|
+
* matches the piece's.
|
|
19
|
+
*/
|
|
20
|
+
constructor(load, sampleRate) {
|
|
21
|
+
this.load = load;
|
|
22
|
+
this.sampleRate = sampleRate;
|
|
23
|
+
}
|
|
24
|
+
async preview(json, request) {
|
|
25
|
+
const engine = await this.ready();
|
|
26
|
+
// Fields left null or undefined are left out: the engine refuses a null
|
|
27
|
+
// cursor, which is what the last page's answer carries.
|
|
28
|
+
const fields = JSON.stringify(request, (_key, value) => value === null ? undefined : value);
|
|
29
|
+
let answer;
|
|
30
|
+
try {
|
|
31
|
+
answer = await engine.previewNotes(json, fields);
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
// The engine rejects with its message as a string.
|
|
35
|
+
throw error instanceof Error ? error : new Error(String(error));
|
|
36
|
+
}
|
|
37
|
+
return parseJson("previewNotes", answer);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Frees the engine, without waiting for one still loading (it frees
|
|
41
|
+
* itself). A preview already running still settles.
|
|
42
|
+
*/
|
|
43
|
+
dispose() {
|
|
44
|
+
this.disposed = true;
|
|
45
|
+
void this.engine?.then((engine) => engine.free(), () => undefined);
|
|
46
|
+
this.engine = undefined;
|
|
47
|
+
}
|
|
48
|
+
ready() {
|
|
49
|
+
if (this.disposed) {
|
|
50
|
+
return Promise.reject(new Error("FuguePlayer has been disposed"));
|
|
51
|
+
}
|
|
52
|
+
if (!this.engine) {
|
|
53
|
+
const made = this.load().then((exports) => {
|
|
54
|
+
// An engine from `wasmUrl` may predate the preview.
|
|
55
|
+
if (!("fugueengine_previewNotes" in exports)) {
|
|
56
|
+
throw new Error("this engine build has no notes preview");
|
|
57
|
+
}
|
|
58
|
+
if (this.disposed) {
|
|
59
|
+
throw new Error("FuguePlayer has been disposed");
|
|
60
|
+
}
|
|
61
|
+
return new FugueEngine(this.sampleRate);
|
|
62
|
+
});
|
|
63
|
+
// A failed load is not kept: the next call tries again.
|
|
64
|
+
made.catch(() => {
|
|
65
|
+
if (this.engine === made) {
|
|
66
|
+
this.engine = undefined;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
this.engine = made;
|
|
70
|
+
}
|
|
71
|
+
return this.engine;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=note-preview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"note-preview.js","sourceRoot":"","sources":["../src/note-preview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAmB,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD;;;;;;GAMG;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B,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC,CAAC;QACpE,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;gBACxC,oDAAoD;gBACpD,IAAI,CAAC,CAAC,0BAA0B,IAAI,OAAO,CAAC,EAAE,CAAC;oBAC7C,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;gBAC5D,CAAC;gBACD,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;oBAClB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;gBACnD,CAAC;gBACD,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC;YACH,wDAAwD;YACxD,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;gBACd,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;oBACzB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;gBAC1B,CAAC;YACH,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACrB,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type InitOutput } from "./generated/fugue.js";
|
|
2
|
+
import type { FuguePlayerOptions } from "./types.js";
|
|
3
|
+
export type RuntimeAssetOptions = Pick<FuguePlayerOptions, "wasmUrl" | "workletUrl">;
|
|
4
|
+
export declare function parseJson<T>(method: string, value: unknown): T;
|
|
5
|
+
export declare function loadWasmBytes(options: RuntimeAssetOptions): Promise<ArrayBuffer>;
|
|
6
|
+
export declare function addWorkletModule(context: AudioContext, options: RuntimeAssetOptions): Promise<void>;
|
|
7
|
+
/**
|
|
8
|
+
* Initializes the wasm module on this thread once per page, for every player
|
|
9
|
+
* here. wasm-bindgen keeps one module per page and two inits in flight would
|
|
10
|
+
* each make one, the second replacing the first under engines already made
|
|
11
|
+
* on it. A failed load is not kept, so the next call tries again.
|
|
12
|
+
*/
|
|
13
|
+
export declare function loadWasmHere(options: RuntimeAssetOptions): Promise<InitOutput>;
|
|
14
|
+
//# sourceMappingURL=runtime-assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-assets.d.ts","sourceRoot":"","sources":["../src/runtime-assets.ts"],"names":[],"mappings":"AAAA,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAK7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,kBAAkB,EAClB,SAAS,GAAG,YAAY,CACzB,CAAC;AAEF,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,CAAC,CAS9D;AAED,wBAAsB,aAAa,CACjC,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,WAAW,CAAC,CAKtB;AAmBD,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAef;AAID;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,UAAU,CAAC,CAarB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import init, {} from "./generated/fugue.js";
|
|
2
|
+
import { embeddedWasmBase64, embeddedWorkletSource, } from "./generated/embedded-assets.js";
|
|
3
|
+
export function parseJson(method, value) {
|
|
4
|
+
if (typeof value !== "string") {
|
|
5
|
+
throw new Error(`${method} returned a non-string JSON payload`);
|
|
6
|
+
}
|
|
7
|
+
try {
|
|
8
|
+
return JSON.parse(value);
|
|
9
|
+
}
|
|
10
|
+
catch (error) {
|
|
11
|
+
throw new Error(`${method} returned invalid JSON: ${String(error)}`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export async function loadWasmBytes(options) {
|
|
15
|
+
if (options.wasmUrl) {
|
|
16
|
+
return fetchWasmBytes(options.wasmUrl);
|
|
17
|
+
}
|
|
18
|
+
return decodeBase64Bytes(embeddedWasmBase64);
|
|
19
|
+
}
|
|
20
|
+
async function fetchWasmBytes(wasmUrl) {
|
|
21
|
+
const response = await fetch(wasmUrl);
|
|
22
|
+
if (!response.ok) {
|
|
23
|
+
throw new Error(`Unable to load Fugue wasm from ${wasmUrl.toString()}`);
|
|
24
|
+
}
|
|
25
|
+
return response.arrayBuffer();
|
|
26
|
+
}
|
|
27
|
+
function decodeBase64Bytes(base64) {
|
|
28
|
+
const binary = globalThis.atob(base64);
|
|
29
|
+
const bytes = new Uint8Array(binary.length);
|
|
30
|
+
for (let index = 0; index < binary.length; index += 1) {
|
|
31
|
+
bytes[index] = binary.charCodeAt(index);
|
|
32
|
+
}
|
|
33
|
+
return bytes.buffer;
|
|
34
|
+
}
|
|
35
|
+
export async function addWorkletModule(context, options) {
|
|
36
|
+
if (options.workletUrl) {
|
|
37
|
+
await context.audioWorklet.addModule(options.workletUrl);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const blob = new Blob([embeddedWorkletSource], {
|
|
41
|
+
type: "application/javascript",
|
|
42
|
+
});
|
|
43
|
+
const workletUrl = URL.createObjectURL(blob);
|
|
44
|
+
try {
|
|
45
|
+
await context.audioWorklet.addModule(workletUrl);
|
|
46
|
+
}
|
|
47
|
+
finally {
|
|
48
|
+
URL.revokeObjectURL(workletUrl);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
let wasmHere;
|
|
52
|
+
/**
|
|
53
|
+
* Initializes the wasm module on this thread once per page, for every player
|
|
54
|
+
* here. wasm-bindgen keeps one module per page and two inits in flight would
|
|
55
|
+
* each make one, the second replacing the first under engines already made
|
|
56
|
+
* on it. A failed load is not kept, so the next call tries again.
|
|
57
|
+
*/
|
|
58
|
+
export function loadWasmHere(options) {
|
|
59
|
+
if (!wasmHere) {
|
|
60
|
+
const loading = loadWasmBytes(options).then((bytes) => init({ module_or_path: bytes }));
|
|
61
|
+
loading.catch(() => {
|
|
62
|
+
if (wasmHere === loading) {
|
|
63
|
+
wasmHere = undefined;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
wasmHere = loading;
|
|
67
|
+
}
|
|
68
|
+
return wasmHere;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=runtime-assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-assets.js","sourceRoot":"","sources":["../src/runtime-assets.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAmB,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EACL,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AAQxC,MAAM,UAAU,SAAS,CAAI,MAAc,EAAE,KAAc;IACzD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,qCAAqC,CAAC,CAAC;IAClE,CAAC;IACD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAM,CAAC;IAChC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,2BAA2B,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACvE,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAA4B;IAE5B,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACpB,OAAO,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,iBAAiB,CAAC,kBAAkB,CAAC,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,GAAG,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;AACH,CAAC;AAED,IAAI,QAAyC,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAC1B,OAA4B;IAE5B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CACpD,IAAI,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAChC,CAAC;QACF,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE;YACjB,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;gBACzB,QAAQ,GAAG,SAAS,CAAC;YACvB,CAAC;QACH,CAAC,CAAC,CAAC;QACH,QAAQ,GAAG,OAAO,CAAC;IACrB,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
export type ControlValue = number | boolean | string;
|
|
2
2
|
export type FuguePlayerState = "playing" | "stopped";
|
|
3
|
+
/**
|
|
4
|
+
* Where a player renders audio: in an AudioWorklet on the audio thread, or in
|
|
5
|
+
* a ScriptProcessorNode on the page's main thread (`preferMainThread`, or a
|
|
6
|
+
* browser with no AudioWorklet).
|
|
7
|
+
*/
|
|
8
|
+
export type FuguePlayerRenderer = "audio-worklet" | "main-thread";
|
|
3
9
|
export type FuguePlayerOptions = {
|
|
4
10
|
audioContext?: AudioContext;
|
|
5
11
|
destination?: AudioNode;
|
|
@@ -12,6 +18,8 @@ export type FuguePlayerOptions = {
|
|
|
12
18
|
onStateChange?: (state: FuguePlayerState) => void;
|
|
13
19
|
};
|
|
14
20
|
export type FuguePlayerInstance = {
|
|
21
|
+
/** Where this player renders audio. */
|
|
22
|
+
readonly renderer: FuguePlayerRenderer;
|
|
15
23
|
loadInvention(json: string): Promise<void>;
|
|
16
24
|
play(): Promise<void>;
|
|
17
25
|
stop(): void;
|
|
@@ -22,8 +30,76 @@ export type FuguePlayerInstance = {
|
|
|
22
30
|
listControls(moduleId?: string): Promise<RuntimeControlGroup[]>;
|
|
23
31
|
getControl(moduleId: string, key: string): Promise<unknown>;
|
|
24
32
|
setControl(moduleId: string, key: string, value: ControlValue): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Lists the notes `json` (a complete invention document, as
|
|
35
|
+
* `loadInvention` takes it) plays over a range of bars, without playing it.
|
|
36
|
+
* Runs on an engine of its own on the page's main thread, never the one
|
|
37
|
+
* that plays: the loaded piece's position, controls and output are
|
|
38
|
+
* untouched. Rejects with an `Error` whose message is the engine's.
|
|
39
|
+
*/
|
|
40
|
+
previewNotes(json: string, request: NotePreviewRequest): Promise<NotePreview>;
|
|
25
41
|
dispose(): Promise<void>;
|
|
26
42
|
};
|
|
43
|
+
/** What `previewNotes` lists. Fields as core's `docs/preview-notes.md`. */
|
|
44
|
+
export type NotePreviewRequest = {
|
|
45
|
+
/** How many bars the range spans, 1 to 64. */
|
|
46
|
+
bars: number;
|
|
47
|
+
/** First bar of the range, counted from 0. Defaults to 0. */
|
|
48
|
+
start_bar?: number;
|
|
49
|
+
/** List only this top-level module's notes. */
|
|
50
|
+
module_id?: string;
|
|
51
|
+
/** Invention seed for random modules with no seed of their own. Defaults to 0. */
|
|
52
|
+
seed?: number;
|
|
53
|
+
/** A previous answer's `cursor`, with the same document and fields. */
|
|
54
|
+
cursor?: string;
|
|
55
|
+
};
|
|
56
|
+
export type PreviewedNote = {
|
|
57
|
+
module_id: string;
|
|
58
|
+
/** `"0"` for a module's lone `gate`, `"N"` for `gate.N`. */
|
|
59
|
+
voice: string;
|
|
60
|
+
/** MIDI note, rounded. */
|
|
61
|
+
pitch: number;
|
|
62
|
+
velocity: number;
|
|
63
|
+
clock: string | null;
|
|
64
|
+
start_beats: number | null;
|
|
65
|
+
/** Null for a note still sounding one bar past the range, or with no clock. */
|
|
66
|
+
duration_beats: number | null;
|
|
67
|
+
start_seconds: number;
|
|
68
|
+
/** Null for a note still sounding one bar past the range. */
|
|
69
|
+
duration_seconds: number | null;
|
|
70
|
+
};
|
|
71
|
+
export type NotePreview = {
|
|
72
|
+
notes: PreviewedNote[];
|
|
73
|
+
range: {
|
|
74
|
+
start_bar: number;
|
|
75
|
+
bars: number;
|
|
76
|
+
clock: string | null;
|
|
77
|
+
beats_per_bar: number;
|
|
78
|
+
start_seconds: number;
|
|
79
|
+
end_seconds: number;
|
|
80
|
+
};
|
|
81
|
+
seed: number;
|
|
82
|
+
/** Chance-driven modules: when there are any, the notes are one possible playing. */
|
|
83
|
+
chance: {
|
|
84
|
+
involved: boolean;
|
|
85
|
+
modules: string[];
|
|
86
|
+
message: string;
|
|
87
|
+
};
|
|
88
|
+
/** `code` and `agent` modules, which never run in a preview. */
|
|
89
|
+
not_run: {
|
|
90
|
+
module_id: string;
|
|
91
|
+
type: string;
|
|
92
|
+
}[];
|
|
93
|
+
/** More notes remain: pass `cursor` back for the next page. */
|
|
94
|
+
truncated: boolean;
|
|
95
|
+
cursor: string | null;
|
|
96
|
+
/** The run stopped at the frame limit before the range ended. */
|
|
97
|
+
limit_reached: boolean;
|
|
98
|
+
limits: {
|
|
99
|
+
max_bars: number;
|
|
100
|
+
max_frames: number;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
27
103
|
export type RuntimeStatus = {
|
|
28
104
|
running: boolean;
|
|
29
105
|
sample_rate: number;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAErD,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAC;AAErD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,WAAW,CAAC,EAAE,S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