kordweb 0.7.1 → 0.8.1

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/klib_bg.js CHANGED
@@ -5,24 +5,33 @@ export function __wbg_set_wasm(val) {
5
5
  }
6
6
 
7
7
 
8
- const heap = new Array(128).fill(undefined);
9
-
10
- heap.push(undefined, null, true, false);
8
+ function addToExternrefTable0(obj) {
9
+ const idx = wasm.__externref_table_alloc();
10
+ wasm.__wbindgen_export_2.set(idx, obj);
11
+ return idx;
12
+ }
11
13
 
12
- function getObject(idx) { return heap[idx]; }
14
+ function handleError(f, args) {
15
+ try {
16
+ return f.apply(this, args);
17
+ } catch (e) {
18
+ const idx = addToExternrefTable0(e);
19
+ wasm.__wbindgen_exn_store(idx);
20
+ }
21
+ }
13
22
 
14
- let heap_next = heap.length;
23
+ let cachedFloat32ArrayMemory0 = null;
15
24
 
16
- function dropObject(idx) {
17
- if (idx < 132) return;
18
- heap[idx] = heap_next;
19
- heap_next = idx;
25
+ function getFloat32ArrayMemory0() {
26
+ if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
27
+ cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
28
+ }
29
+ return cachedFloat32ArrayMemory0;
20
30
  }
21
31
 
22
- function takeObject(idx) {
23
- const ret = getObject(idx);
24
- dropObject(idx);
25
- return ret;
32
+ function getArrayF32FromWasm0(ptr, len) {
33
+ ptr = ptr >>> 0;
34
+ return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
26
35
  }
27
36
 
28
37
  const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
@@ -31,106 +40,53 @@ let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true
31
40
 
32
41
  cachedTextDecoder.decode();
33
42
 
34
- let cachedUint8Memory0 = null;
43
+ let cachedUint8ArrayMemory0 = null;
35
44
 
36
- function getUint8Memory0() {
37
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
38
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
45
+ function getUint8ArrayMemory0() {
46
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
47
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
39
48
  }
40
- return cachedUint8Memory0;
49
+ return cachedUint8ArrayMemory0;
41
50
  }
42
51
 
43
52
  function getStringFromWasm0(ptr, len) {
44
53
  ptr = ptr >>> 0;
45
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
46
- }
47
-
48
- function addHeapObject(obj) {
49
- if (heap_next === heap.length) heap.push(heap.length + 1);
50
- const idx = heap_next;
51
- heap_next = heap[idx];
52
-
53
- heap[idx] = obj;
54
- return idx;
54
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
55
55
  }
56
56
 
57
57
  function isLikeNone(x) {
58
58
  return x === undefined || x === null;
59
59
  }
60
60
 
61
- let cachedFloat64Memory0 = null;
62
-
63
- function getFloat64Memory0() {
64
- if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
65
- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
66
- }
67
- return cachedFloat64Memory0;
68
- }
69
-
70
- let cachedInt32Memory0 = null;
71
-
72
- function getInt32Memory0() {
73
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
74
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
75
- }
76
- return cachedInt32Memory0;
77
- }
78
-
79
- let WASM_VECTOR_LEN = 0;
80
-
81
- const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
82
-
83
- let cachedTextEncoder = new lTextEncoder('utf-8');
84
-
85
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
86
- ? function (arg, view) {
87
- return cachedTextEncoder.encodeInto(arg, view);
88
- }
89
- : function (arg, view) {
90
- const buf = cachedTextEncoder.encode(arg);
91
- view.set(buf);
92
- return {
93
- read: arg.length,
94
- written: buf.length
95
- };
61
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
62
+ ? { register: () => {}, unregister: () => {} }
63
+ : new FinalizationRegistry(state => {
64
+ wasm.__wbindgen_export_3.get(state.dtor)(state.a, state.b)
96
65
  });
97
66
 
98
- function passStringToWasm0(arg, malloc, realloc) {
99
-
100
- if (realloc === undefined) {
101
- const buf = cachedTextEncoder.encode(arg);
102
- const ptr = malloc(buf.length, 1) >>> 0;
103
- getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
104
- WASM_VECTOR_LEN = buf.length;
105
- return ptr;
106
- }
107
-
108
- let len = arg.length;
109
- let ptr = malloc(len, 1) >>> 0;
110
-
111
- const mem = getUint8Memory0();
112
-
113
- let offset = 0;
114
-
115
- for (; offset < len; offset++) {
116
- const code = arg.charCodeAt(offset);
117
- if (code > 0x7F) break;
118
- mem[ptr + offset] = code;
119
- }
120
-
121
- if (offset !== len) {
122
- if (offset !== 0) {
123
- arg = arg.slice(offset);
67
+ function makeMutClosure(arg0, arg1, dtor, f) {
68
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
69
+ const real = (...args) => {
70
+ // First up with a closure we increment the internal reference
71
+ // count. This ensures that the Rust closure environment won't
72
+ // be deallocated while we're invoking it.
73
+ state.cnt++;
74
+ const a = state.a;
75
+ state.a = 0;
76
+ try {
77
+ return f(a, state.b, ...args);
78
+ } finally {
79
+ if (--state.cnt === 0) {
80
+ wasm.__wbindgen_export_3.get(state.dtor)(a, state.b);
81
+ CLOSURE_DTORS.unregister(state);
82
+ } else {
83
+ state.a = a;
84
+ }
124
85
  }
125
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
126
- const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
127
- const ret = encodeString(arg, view);
128
-
129
- offset += ret.written;
130
- }
131
-
132
- WASM_VECTOR_LEN = offset;
133
- return ptr;
86
+ };
87
+ real.original = state;
88
+ CLOSURE_DTORS.register(real, state, state);
89
+ return real;
134
90
  }
135
91
 
136
92
  function debugString(val) {
@@ -174,7 +130,7 @@ function debugString(val) {
174
130
  // Test for built-in
175
131
  const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
176
132
  let className;
177
- if (builtInMatches.length > 1) {
133
+ if (builtInMatches && builtInMatches.length > 1) {
178
134
  className = builtInMatches[1];
179
135
  } else {
180
136
  // Failed to match the standard '[object ClassName]'
@@ -198,1309 +154,1662 @@ function debugString(val) {
198
154
  return className;
199
155
  }
200
156
 
201
- function makeMutClosure(arg0, arg1, dtor, f) {
202
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
203
- const real = (...args) => {
204
- // First up with a closure we increment the internal reference
205
- // count. This ensures that the Rust closure environment won't
206
- // be deallocated while we're invoking it.
207
- state.cnt++;
208
- const a = state.a;
209
- state.a = 0;
210
- try {
211
- return f(a, state.b, ...args);
212
- } finally {
213
- if (--state.cnt === 0) {
214
- wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
157
+ let WASM_VECTOR_LEN = 0;
215
158
 
216
- } else {
217
- state.a = a;
218
- }
219
- }
220
- };
221
- real.original = state;
159
+ const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
222
160
 
223
- return real;
224
- }
225
- function __wbg_adapter_32(arg0, arg1, arg2) {
226
- wasm.wasm_bindgen__convert__closures__invoke1_mut__h7ae5fa43571d2d1a(arg0, arg1, addHeapObject(arg2));
227
- }
161
+ let cachedTextEncoder = new lTextEncoder('utf-8');
228
162
 
229
- function __wbg_adapter_35(arg0, arg1) {
230
- wasm.wasm_bindgen__convert__closures__invoke0_mut__h9a3cc0c6ffc8f26a(arg0, arg1);
163
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
164
+ ? function (arg, view) {
165
+ return cachedTextEncoder.encodeInto(arg, view);
231
166
  }
167
+ : function (arg, view) {
168
+ const buf = cachedTextEncoder.encode(arg);
169
+ view.set(buf);
170
+ return {
171
+ read: arg.length,
172
+ written: buf.length
173
+ };
174
+ });
175
+
176
+ function passStringToWasm0(arg, malloc, realloc) {
177
+
178
+ if (realloc === undefined) {
179
+ const buf = cachedTextEncoder.encode(arg);
180
+ const ptr = malloc(buf.length, 1) >>> 0;
181
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
182
+ WASM_VECTOR_LEN = buf.length;
183
+ return ptr;
184
+ }
185
+
186
+ let len = arg.length;
187
+ let ptr = malloc(len, 1) >>> 0;
188
+
189
+ const mem = getUint8ArrayMemory0();
190
+
191
+ let offset = 0;
192
+
193
+ for (; offset < len; offset++) {
194
+ const code = arg.charCodeAt(offset);
195
+ if (code > 0x7F) break;
196
+ mem[ptr + offset] = code;
197
+ }
198
+
199
+ if (offset !== len) {
200
+ if (offset !== 0) {
201
+ arg = arg.slice(offset);
202
+ }
203
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
204
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
205
+ const ret = encodeString(arg, view);
206
+
207
+ offset += ret.written;
208
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
209
+ }
232
210
 
233
- function __wbg_adapter_38(arg0, arg1) {
234
- wasm.wasm_bindgen__convert__closures__invoke0_mut__hddbc9bcc7c6455be(arg0, arg1);
211
+ WASM_VECTOR_LEN = offset;
212
+ return ptr;
235
213
  }
236
214
 
237
- let cachedFloat32Memory0 = null;
215
+ let cachedDataViewMemory0 = null;
238
216
 
239
- function getFloat32Memory0() {
240
- if (cachedFloat32Memory0 === null || cachedFloat32Memory0.byteLength === 0) {
241
- cachedFloat32Memory0 = new Float32Array(wasm.memory.buffer);
217
+ function getDataViewMemory0() {
218
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
219
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
242
220
  }
243
- return cachedFloat32Memory0;
221
+ return cachedDataViewMemory0;
244
222
  }
245
223
 
246
- function passArrayF32ToWasm0(arg, malloc) {
247
- const ptr = malloc(arg.length * 4, 4) >>> 0;
248
- getFloat32Memory0().set(arg, ptr / 4);
249
- WASM_VECTOR_LEN = arg.length;
250
- return ptr;
224
+ function takeFromExternrefTable0(idx) {
225
+ const value = wasm.__wbindgen_export_2.get(idx);
226
+ wasm.__externref_table_dealloc(idx);
227
+ return value;
251
228
  }
252
229
 
253
230
  function _assertClass(instance, klass) {
254
231
  if (!(instance instanceof klass)) {
255
232
  throw new Error(`expected instance of ${klass.name}`);
256
233
  }
257
- return instance.ptr;
258
234
  }
259
235
 
260
- function handleError(f, args) {
261
- try {
262
- return f.apply(this, args);
263
- } catch (e) {
264
- wasm.__wbindgen_exn_store(addHeapObject(e));
265
- }
236
+ function passArrayF32ToWasm0(arg, malloc) {
237
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
238
+ getFloat32ArrayMemory0().set(arg, ptr / 4);
239
+ WASM_VECTOR_LEN = arg.length;
240
+ return ptr;
241
+ }
242
+ function __wbg_adapter_28(arg0, arg1) {
243
+ wasm._dyn_core_86a6a94adeda8493___ops__function__FnMut_____Output______as_wasm_bindgen_2ca0cf1d0eae7d9___closure__WasmClosure___describe__invoke______(arg0, arg1);
266
244
  }
267
245
 
268
- function getArrayF32FromWasm0(ptr, len) {
269
- ptr = ptr >>> 0;
270
- return getFloat32Memory0().subarray(ptr / 4, ptr / 4 + len);
246
+ function __wbg_adapter_31(arg0, arg1, arg2) {
247
+ wasm.closure656_externref_shim(arg0, arg1, arg2);
271
248
  }
272
- function __wbg_adapter_176(arg0, arg1, arg2, arg3) {
273
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h1c849f10298b6e57(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
249
+
250
+ function __wbg_adapter_34(arg0, arg1) {
251
+ wasm._dyn_core_86a6a94adeda8493___ops__function__FnMut_____Output______as_wasm_bindgen_2ca0cf1d0eae7d9___closure__WasmClosure___describe__invoke______11(arg0, arg1);
252
+ }
253
+
254
+ function __wbg_adapter_186(arg0, arg1, arg2, arg3) {
255
+ wasm.closure759_externref_shim(arg0, arg1, arg2, arg3);
274
256
  }
275
257
 
276
258
  /**
277
- * The chord modifiers.
278
- */
279
- export const KordModifier = Object.freeze({
280
- /**
281
- * Minor modifier.
282
- */
283
- Minor:0,"0":"Minor",
284
- /**
285
- * Flat 5 modifier.
286
- */
287
- Flat5:1,"1":"Flat5",
288
- /**
289
- * Sharp 5 modifier.
290
- */
291
- Augmented5:2,"2":"Augmented5",
292
- /**
293
- * Major 7 modifier.
294
- */
295
- Major7:3,"3":"Major7",
296
- /**
297
- * Dominant 7 modifier.
298
- */
299
- Dominant7:4,"4":"Dominant7",
300
- /**
301
- * Dominant 9 modifier.
302
- */
303
- Dominant9:5,"5":"Dominant9",
304
- /**
305
- * Dominant 11 modifier.
306
- */
307
- Dominant11:6,"6":"Dominant11",
308
- /**
309
- * Dominant 13 modifier.
310
- */
311
- Dominant13:7,"7":"Dominant13",
312
- /**
313
- * Flat 9 modifier.
314
- */
315
- Flat9:8,"8":"Flat9",
316
- /**
317
- * Sharp 9 modifier.
318
- */
319
- Sharp9:9,"9":"Sharp9",
320
- /**
321
- * Sharp 11 modifier.
322
- */
323
- Sharp11:10,"10":"Sharp11",
324
- /**
325
- * Diminished modifier.
326
- */
327
- Diminished:11,"11":"Diminished", });
259
+ * An enum representing the extension of a chord.
260
+ *
261
+ * Extensions are not really "special" in the sense that they do not change how the
262
+ * chord is interpreted by the system. E.g., an `add2` just adds a 2 to the chord,
263
+ * and the chord is still interpreted as a major chord.
264
+ * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}
265
+ */
266
+ export const KordExtension = Object.freeze({
267
+ /**
268
+ * Sus2 extension.
269
+ */
270
+ Sus2: 0, "0": "Sus2",
271
+ /**
272
+ * Sus4 extension.
273
+ */
274
+ Sus4: 1, "1": "Sus4",
275
+ /**
276
+ * Flat 11 extension.
277
+ */
278
+ Flat11: 2, "2": "Flat11",
279
+ /**
280
+ * Sharp 13 extension.
281
+ */
282
+ Sharp13: 3, "3": "Sharp13",
283
+ /**
284
+ * Add2 extension.
285
+ */
286
+ Add2: 4, "4": "Add2",
287
+ /**
288
+ * Add4 extension.
289
+ */
290
+ Add4: 5, "5": "Add4",
291
+ /**
292
+ * Add6 extension.
293
+ */
294
+ Add6: 6, "6": "Add6",
295
+ /**
296
+ * Add9 extension.
297
+ */
298
+ Add9: 7, "7": "Add9",
299
+ /**
300
+ * Add11 extension.
301
+ */
302
+ Add11: 8, "8": "Add11",
303
+ /**
304
+ * Add13 extension.
305
+ */
306
+ Add13: 9, "9": "Add13",
307
+ });
328
308
  /**
329
- * An enum representing the interval between two notes.
330
- */
309
+ * An enum representing the interval between two notes.
310
+ * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47}
311
+ */
331
312
  export const KordInterval = Object.freeze({
313
+ /**
314
+ * A perfect unison interval.
315
+ */
316
+ PerfectUnison: 0, "0": "PerfectUnison",
317
+ /**
318
+ * A diminished second interval.
319
+ */
320
+ DiminishedSecond: 1, "1": "DiminishedSecond",
321
+ /**
322
+ * An augmented unison interval.
323
+ */
324
+ AugmentedUnison: 2, "2": "AugmentedUnison",
325
+ /**
326
+ * A minor second interval.
327
+ */
328
+ MinorSecond: 3, "3": "MinorSecond",
329
+ /**
330
+ * A major second interval.
331
+ */
332
+ MajorSecond: 4, "4": "MajorSecond",
333
+ /**
334
+ * A diminished third interval.
335
+ */
336
+ DiminishedThird: 5, "5": "DiminishedThird",
337
+ /**
338
+ * An augmented second interval.
339
+ */
340
+ AugmentedSecond: 6, "6": "AugmentedSecond",
341
+ /**
342
+ * A minor third interval.
343
+ */
344
+ MinorThird: 7, "7": "MinorThird",
345
+ /**
346
+ * A major third interval.
347
+ */
348
+ MajorThird: 8, "8": "MajorThird",
349
+ /**
350
+ * A diminished fourth interval.
351
+ */
352
+ DiminishedFourth: 9, "9": "DiminishedFourth",
353
+ /**
354
+ * An augmented third interval.
355
+ */
356
+ AugmentedThird: 10, "10": "AugmentedThird",
357
+ /**
358
+ * A perfect fourth interval.
359
+ */
360
+ PerfectFourth: 11, "11": "PerfectFourth",
361
+ /**
362
+ * An augmented fourth interval.
363
+ */
364
+ AugmentedFourth: 12, "12": "AugmentedFourth",
365
+ /**
366
+ * A diminished fifth interval.
367
+ */
368
+ DiminishedFifth: 13, "13": "DiminishedFifth",
369
+ /**
370
+ * A perfect fifth interval.
371
+ */
372
+ PerfectFifth: 14, "14": "PerfectFifth",
373
+ /**
374
+ * A diminished sixth interval.
375
+ */
376
+ DiminishedSixth: 15, "15": "DiminishedSixth",
377
+ /**
378
+ * An augmented fifth interval.
379
+ */
380
+ AugmentedFifth: 16, "16": "AugmentedFifth",
381
+ /**
382
+ * A minor sixth interval.
383
+ */
384
+ MinorSixth: 17, "17": "MinorSixth",
385
+ /**
386
+ * A major sixth interval.
387
+ */
388
+ MajorSixth: 18, "18": "MajorSixth",
389
+ /**
390
+ * A diminished seventh interval.
391
+ */
392
+ DiminishedSeventh: 19, "19": "DiminishedSeventh",
393
+ /**
394
+ * An augmented sixth interval.
395
+ */
396
+ AugmentedSixth: 20, "20": "AugmentedSixth",
397
+ /**
398
+ * A minor seventh interval.
399
+ */
400
+ MinorSeventh: 21, "21": "MinorSeventh",
401
+ /**
402
+ * A major seventh interval.
403
+ */
404
+ MajorSeventh: 22, "22": "MajorSeventh",
405
+ /**
406
+ * A diminished octave interval.
407
+ */
408
+ DiminishedOctave: 23, "23": "DiminishedOctave",
409
+ /**
410
+ * An augmented seventh interval.
411
+ */
412
+ AugmentedSeventh: 24, "24": "AugmentedSeventh",
413
+ /**
414
+ * A perfect octave interval.
415
+ */
416
+ PerfectOctave: 25, "25": "PerfectOctave",
417
+ /**
418
+ * An minor ninth interval.
419
+ */
420
+ MinorNinth: 26, "26": "MinorNinth",
421
+ /**
422
+ * A major ninth interval.
423
+ */
424
+ MajorNinth: 27, "27": "MajorNinth",
425
+ /**
426
+ * An augmented ninth interval.
427
+ */
428
+ AugmentedNinth: 28, "28": "AugmentedNinth",
429
+ /**
430
+ * A diminished eleventh interval.
431
+ */
432
+ DiminishedEleventh: 29, "29": "DiminishedEleventh",
433
+ /**
434
+ * A perfect eleventh interval.
435
+ */
436
+ PerfectEleventh: 30, "30": "PerfectEleventh",
437
+ /**
438
+ * An augmented eleventh interval.
439
+ */
440
+ AugmentedEleventh: 31, "31": "AugmentedEleventh",
441
+ /**
442
+ * A minor thirteenth interval.
443
+ */
444
+ MinorThirteenth: 32, "32": "MinorThirteenth",
445
+ /**
446
+ * A major thirteenth interval.
447
+ */
448
+ MajorThirteenth: 33, "33": "MajorThirteenth",
449
+ /**
450
+ * An augmented thirteenth interval.
451
+ */
452
+ AugmentedThirteenth: 34, "34": "AugmentedThirteenth",
453
+ /**
454
+ * A perfect octave and perfect fifth interval.
455
+ */
456
+ PerfectOctaveAndPerfectFifth: 35, "35": "PerfectOctaveAndPerfectFifth",
457
+ /**
458
+ * Two perfect octaves.
459
+ */
460
+ TwoPerfectOctaves: 36, "36": "TwoPerfectOctaves",
461
+ /**
462
+ * Two perfect octaves and a major third.
463
+ */
464
+ TwoPerfectOctavesAndMajorThird: 37, "37": "TwoPerfectOctavesAndMajorThird",
465
+ /**
466
+ * Two perfect octaves and a perfect fifth.
467
+ */
468
+ TwoPerfectOctavesAndPerfectFifth: 38, "38": "TwoPerfectOctavesAndPerfectFifth",
469
+ /**
470
+ * Two perfect octaves and a minor sixth.
471
+ */
472
+ TwoPerfectOctavesAndMinorSeventh: 39, "39": "TwoPerfectOctavesAndMinorSeventh",
473
+ /**
474
+ * Three perfect octaves.
475
+ */
476
+ ThreePerfectOctaves: 40, "40": "ThreePerfectOctaves",
477
+ /**
478
+ * Three perfect octaves and a major second.
479
+ */
480
+ ThreePerfectOctavesAndMajorSecond: 41, "41": "ThreePerfectOctavesAndMajorSecond",
481
+ /**
482
+ * Three perfect octaves and a major third.
483
+ */
484
+ ThreePerfectOctavesAndMajorThird: 42, "42": "ThreePerfectOctavesAndMajorThird",
485
+ /**
486
+ * Three perfect octaves and an augmented fourth.
487
+ */
488
+ ThreePerfectOctavesAndAugmentedFourth: 43, "43": "ThreePerfectOctavesAndAugmentedFourth",
489
+ /**
490
+ * Three perfect octaves and a perfect fifth.
491
+ */
492
+ ThreePerfectOctavesAndPerfectFifth: 44, "44": "ThreePerfectOctavesAndPerfectFifth",
493
+ /**
494
+ * Three perfect octaves and a minor sixth.
495
+ */
496
+ ThreePerfectOctavesAndMinorSixth: 45, "45": "ThreePerfectOctavesAndMinorSixth",
497
+ /**
498
+ * Three perfect octaves and a minor seventh.
499
+ */
500
+ ThreePerfectOctavesAndMinorSeventh: 46, "46": "ThreePerfectOctavesAndMinorSeventh",
501
+ /**
502
+ * Three perfect octaves and a major seventh.
503
+ */
504
+ ThreePerfectOctavesAndMajorSeventh: 47, "47": "ThreePerfectOctavesAndMajorSeventh",
505
+ });
332
506
  /**
333
- * A perfect unison interval.
334
- */
335
- PerfectUnison:0,"0":"PerfectUnison",
336
- /**
337
- * A diminished second interval.
338
- */
339
- DiminishedSecond:1,"1":"DiminishedSecond",
340
- /**
341
- * An augmented unison interval.
342
- */
343
- AugmentedUnison:2,"2":"AugmentedUnison",
344
- /**
345
- * A minor second interval.
346
- */
347
- MinorSecond:3,"3":"MinorSecond",
348
- /**
349
- * A major second interval.
350
- */
351
- MajorSecond:4,"4":"MajorSecond",
352
- /**
353
- * A diminished third interval.
354
- */
355
- DiminishedThird:5,"5":"DiminishedThird",
356
- /**
357
- * An augmented second interval.
358
- */
359
- AugmentedSecond:6,"6":"AugmentedSecond",
360
- /**
361
- * A minor third interval.
362
- */
363
- MinorThird:7,"7":"MinorThird",
364
- /**
365
- * A major third interval.
366
- */
367
- MajorThird:8,"8":"MajorThird",
368
- /**
369
- * A diminished fourth interval.
370
- */
371
- DiminishedFourth:9,"9":"DiminishedFourth",
372
- /**
373
- * An augmented third interval.
374
- */
375
- AugmentedThird:10,"10":"AugmentedThird",
376
- /**
377
- * A perfect fourth interval.
378
- */
379
- PerfectFourth:11,"11":"PerfectFourth",
380
- /**
381
- * An augmented fourth interval.
382
- */
383
- AugmentedFourth:12,"12":"AugmentedFourth",
384
- /**
385
- * A diminished fifth interval.
386
- */
387
- DiminishedFifth:13,"13":"DiminishedFifth",
388
- /**
389
- * A perfect fifth interval.
390
- */
391
- PerfectFifth:14,"14":"PerfectFifth",
392
- /**
393
- * A diminished sixth interval.
394
- */
395
- DiminishedSixth:15,"15":"DiminishedSixth",
396
- /**
397
- * An augmented fifth interval.
398
- */
399
- AugmentedFifth:16,"16":"AugmentedFifth",
400
- /**
401
- * A minor sixth interval.
402
- */
403
- MinorSixth:17,"17":"MinorSixth",
404
- /**
405
- * A major sixth interval.
406
- */
407
- MajorSixth:18,"18":"MajorSixth",
408
- /**
409
- * A diminished seventh interval.
410
- */
411
- DiminishedSeventh:19,"19":"DiminishedSeventh",
412
- /**
413
- * An augmented sixth interval.
414
- */
415
- AugmentedSixth:20,"20":"AugmentedSixth",
416
- /**
417
- * A minor seventh interval.
418
- */
419
- MinorSeventh:21,"21":"MinorSeventh",
420
- /**
421
- * A major seventh interval.
422
- */
423
- MajorSeventh:22,"22":"MajorSeventh",
424
- /**
425
- * A diminished octave interval.
426
- */
427
- DiminishedOctave:23,"23":"DiminishedOctave",
428
- /**
429
- * An augmented seventh interval.
430
- */
431
- AugmentedSeventh:24,"24":"AugmentedSeventh",
432
- /**
433
- * A perfect octave interval.
434
- */
435
- PerfectOctave:25,"25":"PerfectOctave",
436
- /**
437
- * An minor ninth interval.
438
- */
439
- MinorNinth:26,"26":"MinorNinth",
440
- /**
441
- * A major ninth interval.
442
- */
443
- MajorNinth:27,"27":"MajorNinth",
444
- /**
445
- * An augmented ninth interval.
446
- */
447
- AugmentedNinth:28,"28":"AugmentedNinth",
448
- /**
449
- * A diminished eleventh interval.
450
- */
451
- DiminishedEleventh:29,"29":"DiminishedEleventh",
452
- /**
453
- * A perfect eleventh interval.
454
- */
455
- PerfectEleventh:30,"30":"PerfectEleventh",
456
- /**
457
- * An augmented eleventh interval.
458
- */
459
- AugmentedEleventh:31,"31":"AugmentedEleventh",
460
- /**
461
- * A minor thirteenth interval.
462
- */
463
- MinorThirteenth:32,"32":"MinorThirteenth",
464
- /**
465
- * A major thirteenth interval.
466
- */
467
- MajorThirteenth:33,"33":"MajorThirteenth",
468
- /**
469
- * An augmented thirteenth interval.
470
- */
471
- AugmentedThirteenth:34,"34":"AugmentedThirteenth",
472
- /**
473
- * A perfect octave and perfect fifth interval.
474
- */
475
- PerfectOctaveAndPerfectFifth:35,"35":"PerfectOctaveAndPerfectFifth",
476
- /**
477
- * Two perfect octaves.
478
- */
479
- TwoPerfectOctaves:36,"36":"TwoPerfectOctaves",
480
- /**
481
- * Two perfect octaves and a major third.
482
- */
483
- TwoPerfectOctavesAndMajorThird:37,"37":"TwoPerfectOctavesAndMajorThird",
484
- /**
485
- * Two perfect octaves and a perfect fifth.
486
- */
487
- TwoPerfectOctavesAndPerfectFifth:38,"38":"TwoPerfectOctavesAndPerfectFifth",
488
- /**
489
- * Two perfect octaves and a minor sixth.
490
- */
491
- TwoPerfectOctavesAndMinorSeventh:39,"39":"TwoPerfectOctavesAndMinorSeventh",
492
- /**
493
- * Three perfect octaves.
494
- */
495
- ThreePerfectOctaves:40,"40":"ThreePerfectOctaves",
496
- /**
497
- * Three perfect octaves and a major second.
498
- */
499
- ThreePerfectOctavesAndMajorSecond:41,"41":"ThreePerfectOctavesAndMajorSecond",
500
- /**
501
- * Three perfect octaves and a major third.
502
- */
503
- ThreePerfectOctavesAndMajorThird:42,"42":"ThreePerfectOctavesAndMajorThird",
504
- /**
505
- * Three perfect octaves and an augmented fourth.
506
- */
507
- ThreePerfectOctavesAndAugmentedFourth:43,"43":"ThreePerfectOctavesAndAugmentedFourth",
508
- /**
509
- * Three perfect octaves and a perfect fifth.
510
- */
511
- ThreePerfectOctavesAndPerfectFifth:44,"44":"ThreePerfectOctavesAndPerfectFifth",
512
- /**
513
- * Three perfect octaves and a minor sixth.
514
- */
515
- ThreePerfectOctavesAndMinorSixth:45,"45":"ThreePerfectOctavesAndMinorSixth",
516
- /**
517
- * Three perfect octaves and a minor seventh.
518
- */
519
- ThreePerfectOctavesAndMinorSeventh:46,"46":"ThreePerfectOctavesAndMinorSeventh",
520
- /**
521
- * Three perfect octaves and a major seventh.
522
- */
523
- ThreePerfectOctavesAndMajorSeventh:47,"47":"ThreePerfectOctavesAndMajorSeventh", });
524
- /**
525
- * An enum representing the extension of a chord.
526
- *
527
- * Extensions are not really "special" in the sense that they do not change how the
528
- * chord is interpreted by the system. E.g., an `add2` just adds a 2 to the chord,
529
- * and the chord is still interpreted as a major chord.
530
- */
531
- export const KordExtension = Object.freeze({
532
- /**
533
- * Sus2 extension.
534
- */
535
- Sus2:0,"0":"Sus2",
536
- /**
537
- * Sus4 extension.
538
- */
539
- Sus4:1,"1":"Sus4",
540
- /**
541
- * Flat 11 extension.
542
- */
543
- Flat11:2,"2":"Flat11",
544
- /**
545
- * Flat 13 extension.
546
- */
547
- Flat13:3,"3":"Flat13",
548
- /**
549
- * Sharp 13 extension.
550
- */
551
- Sharp13:4,"4":"Sharp13",
552
- /**
553
- * Add2 extension.
554
- */
555
- Add2:5,"5":"Add2",
556
- /**
557
- * Add4 extension.
558
- */
559
- Add4:6,"6":"Add4",
560
- /**
561
- * Add6 extension.
562
- */
563
- Add6:7,"7":"Add6",
564
- /**
565
- * Add9 extension.
566
- */
567
- Add9:8,"8":"Add9",
568
- /**
569
- * Add11 extension.
570
- */
571
- Add11:9,"9":"Add11",
572
- /**
573
- * Add13 extension.
574
- */
575
- Add13:10,"10":"Add13", });
507
+ * The chord modifiers.
508
+ * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11}
509
+ */
510
+ export const KordModifier = Object.freeze({
511
+ /**
512
+ * Minor modifier.
513
+ */
514
+ Minor: 0, "0": "Minor",
515
+ /**
516
+ * Flat 5 modifier.
517
+ */
518
+ Flat5: 1, "1": "Flat5",
519
+ /**
520
+ * Sharp 5 modifier.
521
+ */
522
+ Augmented5: 2, "2": "Augmented5",
523
+ /**
524
+ * Major 7 modifier.
525
+ */
526
+ Major7: 3, "3": "Major7",
527
+ /**
528
+ * Dominant 7 modifier.
529
+ */
530
+ Dominant7: 4, "4": "Dominant7",
531
+ /**
532
+ * Dominant 9 modifier.
533
+ */
534
+ Dominant9: 5, "5": "Dominant9",
535
+ /**
536
+ * Dominant 11 modifier.
537
+ */
538
+ Dominant11: 6, "6": "Dominant11",
539
+ /**
540
+ * Dominant 13 modifier.
541
+ */
542
+ Dominant13: 7, "7": "Dominant13",
543
+ /**
544
+ * Flat 9 modifier.
545
+ */
546
+ Flat9: 8, "8": "Flat9",
547
+ /**
548
+ * Sharp 9 modifier.
549
+ */
550
+ Sharp9: 9, "9": "Sharp9",
551
+ /**
552
+ * Sharp 11 modifier.
553
+ */
554
+ Sharp11: 10, "10": "Sharp11",
555
+ /**
556
+ * Diminished modifier.
557
+ */
558
+ Diminished: 11, "11": "Diminished",
559
+ });
560
+
561
+ const KordChordFinalization = (typeof FinalizationRegistry === 'undefined')
562
+ ? { register: () => {}, unregister: () => {} }
563
+ : new FinalizationRegistry(ptr => wasm.__wbg_kordchord_free(ptr >>> 0, 1));
576
564
  /**
577
- * The [`Chord`] wrapper.
578
- */
565
+ * The [`Chord`] wrapper.
566
+ */
579
567
  export class KordChord {
580
568
 
581
569
  static __wrap(ptr) {
582
570
  ptr = ptr >>> 0;
583
571
  const obj = Object.create(KordChord.prototype);
584
572
  obj.__wbg_ptr = ptr;
585
-
573
+ KordChordFinalization.register(obj, obj.__wbg_ptr, obj);
586
574
  return obj;
587
575
  }
588
576
 
589
577
  __destroy_into_raw() {
590
578
  const ptr = this.__wbg_ptr;
591
579
  this.__wbg_ptr = 0;
592
-
580
+ KordChordFinalization.unregister(this);
593
581
  return ptr;
594
582
  }
595
583
 
596
584
  free() {
597
585
  const ptr = this.__destroy_into_raw();
598
- wasm.__wbg_kordchord_free(ptr);
586
+ wasm.__wbg_kordchord_free(ptr, 0);
599
587
  }
600
588
  /**
601
- * Creates a new [`Chord`] from a frequency.
602
- * @param {string} name
603
- * @returns {KordChord}
604
- */
605
- static parse(name) {
606
- try {
607
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
608
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
609
- const len0 = WASM_VECTOR_LEN;
610
- wasm.kordchord_parse(retptr, ptr0, len0);
611
- var r0 = getInt32Memory0()[retptr / 4 + 0];
612
- var r1 = getInt32Memory0()[retptr / 4 + 1];
613
- var r2 = getInt32Memory0()[retptr / 4 + 2];
614
- if (r2) {
615
- throw takeObject(r1);
616
- }
617
- return KordChord.__wrap(r0);
618
- } finally {
619
- wasm.__wbindgen_add_to_stack_pointer(16);
620
- }
589
+ * Plays the [`Chord`].
590
+ * @param {number} delay
591
+ * @param {number} length
592
+ * @param {number} fade_in
593
+ * @returns {Promise<void>}
594
+ */
595
+ play(delay, length, fade_in) {
596
+ const ret = wasm.kordchord_play(this.__wbg_ptr, delay, length, fade_in);
597
+ return ret;
621
598
  }
622
599
  /**
623
- * Creates a new [`Chord`] from a set of [`Note`]s.
624
- *
625
- * The [`Note`]s should be represented as a space-separated string.
626
- * E.g., `C E G`.
627
- * @param {string} notes
628
- * @returns {Array<any>}
629
- */
630
- static fromNotesString(notes) {
631
- try {
632
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
633
- const ptr0 = passStringToWasm0(notes, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
634
- const len0 = WASM_VECTOR_LEN;
635
- wasm.kordchord_fromNotesString(retptr, ptr0, len0);
636
- var r0 = getInt32Memory0()[retptr / 4 + 0];
637
- var r1 = getInt32Memory0()[retptr / 4 + 1];
638
- var r2 = getInt32Memory0()[retptr / 4 + 2];
639
- if (r2) {
640
- throw takeObject(r1);
641
- }
642
- return takeObject(r0);
643
- } finally {
644
- wasm.__wbindgen_add_to_stack_pointer(16);
645
- }
600
+ * Returns the [`Chord`]'s extensions.
601
+ * @returns {Array<any>}
602
+ */
603
+ extensions() {
604
+ const ret = wasm.kordchord_extensions(this.__wbg_ptr);
605
+ return ret;
646
606
  }
647
607
  /**
648
- * Creates a new [`Chord`] from a set of [`Note`]s.
649
- * @param {Array<any>} notes
650
- * @returns {Array<any>}
651
- */
608
+ * Creates a new [`Chord`] from a set of [`Note`]s.
609
+ * @param {Array<any>} notes
610
+ * @returns {Array<any>}
611
+ */
652
612
  static fromNotes(notes) {
653
- try {
654
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
655
- wasm.kordchord_fromNotes(retptr, addHeapObject(notes));
656
- var r0 = getInt32Memory0()[retptr / 4 + 0];
657
- var r1 = getInt32Memory0()[retptr / 4 + 1];
658
- var r2 = getInt32Memory0()[retptr / 4 + 2];
659
- if (r2) {
660
- throw takeObject(r1);
661
- }
662
- return takeObject(r0);
663
- } finally {
664
- wasm.__wbindgen_add_to_stack_pointer(16);
613
+ const ret = wasm.kordchord_fromNotes(notes);
614
+ if (ret[2]) {
615
+ throw takeFromExternrefTable0(ret[1]);
665
616
  }
617
+ return takeFromExternrefTable0(ret[0]);
666
618
  }
667
619
  /**
668
- * Returns the [`Chord`]'s friendly name.
669
- * @returns {string}
670
- */
671
- name() {
620
+ * Returns whether or not the [`Chord`] is "crunchy".
621
+ * @returns {boolean}
622
+ */
623
+ isCrunchy() {
624
+ const ret = wasm.kordchord_isCrunchy(this.__wbg_ptr);
625
+ return ret !== 0;
626
+ }
627
+ /**
628
+ * Returns a new [`Chord`] with the slash set to the provided value.
629
+ * @param {KordNote} slash
630
+ * @returns {KordChord}
631
+ */
632
+ withSlash(slash) {
633
+ _assertClass(slash, KordNote);
634
+ const ret = wasm.kordchord_withSlash(this.__wbg_ptr, slash.__wbg_ptr);
635
+ return KordChord.__wrap(ret);
636
+ }
637
+ /**
638
+ * Returns the [`Chord`]'s description.
639
+ * @returns {string}
640
+ */
641
+ description() {
672
642
  let deferred1_0;
673
643
  let deferred1_1;
674
644
  try {
675
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
676
- wasm.kordchord_name(retptr, this.__wbg_ptr);
677
- var r0 = getInt32Memory0()[retptr / 4 + 0];
678
- var r1 = getInt32Memory0()[retptr / 4 + 1];
679
- deferred1_0 = r0;
680
- deferred1_1 = r1;
681
- return getStringFromWasm0(r0, r1);
645
+ const ret = wasm.kordchord_description(this.__wbg_ptr);
646
+ deferred1_0 = ret[0];
647
+ deferred1_1 = ret[1];
648
+ return getStringFromWasm0(ret[0], ret[1]);
682
649
  } finally {
683
- wasm.__wbindgen_add_to_stack_pointer(16);
684
650
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
685
651
  }
686
652
  }
687
653
  /**
688
- * Returns the [`Chord`]'s precise name.
689
- * @returns {string}
690
- */
691
- preciseName() {
692
- let deferred1_0;
693
- let deferred1_1;
694
- try {
695
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
696
- wasm.kordchord_preciseName(retptr, this.__wbg_ptr);
697
- var r0 = getInt32Memory0()[retptr / 4 + 0];
698
- var r1 = getInt32Memory0()[retptr / 4 + 1];
699
- deferred1_0 = r0;
700
- deferred1_1 = r1;
701
- return getStringFromWasm0(r0, r1);
702
- } finally {
703
- wasm.__wbindgen_add_to_stack_pointer(16);
704
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
654
+ * Returns a new [`Chord`] with the octave of the root set to the provided value.
655
+ * @param {number} octave
656
+ * @returns {KordChord}
657
+ */
658
+ withOctave(octave) {
659
+ const ret = wasm.kordchord_withOctave(this.__wbg_ptr, octave);
660
+ if (ret[2]) {
661
+ throw takeFromExternrefTable0(ret[1]);
705
662
  }
663
+ return KordChord.__wrap(ret[0]);
706
664
  }
707
665
  /**
708
- * Returns the [`Chord`] as a string (same as `precise_name`).
709
- * @returns {string}
710
- */
711
- toString() {
666
+ * Returns the [`Chord`]'s chord tones as a string.
667
+ * @returns {string}
668
+ */
669
+ chordString() {
712
670
  let deferred1_0;
713
671
  let deferred1_1;
714
672
  try {
715
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
716
- wasm.kordchord_preciseName(retptr, this.__wbg_ptr);
717
- var r0 = getInt32Memory0()[retptr / 4 + 0];
718
- var r1 = getInt32Memory0()[retptr / 4 + 1];
719
- deferred1_0 = r0;
720
- deferred1_1 = r1;
721
- return getStringFromWasm0(r0, r1);
673
+ const ret = wasm.kordchord_chordString(this.__wbg_ptr);
674
+ deferred1_0 = ret[0];
675
+ deferred1_1 = ret[1];
676
+ return getStringFromWasm0(ret[0], ret[1]);
722
677
  } finally {
723
- wasm.__wbindgen_add_to_stack_pointer(16);
724
678
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
725
679
  }
726
680
  }
727
681
  /**
728
- * Returns the [`Chord`]'s description.
729
- * @returns {string}
730
- */
731
- description() {
682
+ * Returns the [`Chord`]'s precise name.
683
+ * @returns {string}
684
+ */
685
+ preciseName() {
732
686
  let deferred1_0;
733
687
  let deferred1_1;
734
688
  try {
735
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
736
- wasm.kordchord_description(retptr, this.__wbg_ptr);
737
- var r0 = getInt32Memory0()[retptr / 4 + 0];
738
- var r1 = getInt32Memory0()[retptr / 4 + 1];
739
- deferred1_0 = r0;
740
- deferred1_1 = r1;
741
- return getStringFromWasm0(r0, r1);
689
+ const ret = wasm.kordchord_preciseName(this.__wbg_ptr);
690
+ deferred1_0 = ret[0];
691
+ deferred1_1 = ret[1];
692
+ return getStringFromWasm0(ret[0], ret[1]);
742
693
  } finally {
743
- wasm.__wbindgen_add_to_stack_pointer(16);
744
694
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
745
695
  }
746
696
  }
747
697
  /**
748
- * Returns the [`Chord`]'s display text.
749
- * @returns {string}
750
- */
751
- display() {
698
+ * Returns the [`Chord`]'s scale tones as a string.
699
+ * @returns {string}
700
+ */
701
+ scaleString() {
752
702
  let deferred1_0;
753
703
  let deferred1_1;
754
704
  try {
755
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
756
- wasm.kordchord_display(retptr, this.__wbg_ptr);
757
- var r0 = getInt32Memory0()[retptr / 4 + 0];
758
- var r1 = getInt32Memory0()[retptr / 4 + 1];
759
- deferred1_0 = r0;
760
- deferred1_1 = r1;
761
- return getStringFromWasm0(r0, r1);
705
+ const ret = wasm.kordchord_scaleString(this.__wbg_ptr);
706
+ deferred1_0 = ret[0];
707
+ deferred1_1 = ret[1];
708
+ return getStringFromWasm0(ret[0], ret[1]);
762
709
  } finally {
763
- wasm.__wbindgen_add_to_stack_pointer(16);
764
710
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
765
711
  }
766
712
  }
767
713
  /**
768
- * Returns the [`Chord`]'s root note.
769
- * @returns {string}
770
- */
771
- root() {
714
+ * Returns a new [`Chord`] with the "crunchiness" set to the provided value.
715
+ * @param {boolean} is_crunchy
716
+ * @returns {KordChord}
717
+ */
718
+ withCrunchy(is_crunchy) {
719
+ const ret = wasm.kordchord_withCrunchy(this.__wbg_ptr, is_crunchy);
720
+ return KordChord.__wrap(ret);
721
+ }
722
+ /**
723
+ * Returns a new [`Chord`] with the inversion set to the provided value.
724
+ * @param {number} inversion
725
+ * @returns {KordChord}
726
+ */
727
+ withInversion(inversion) {
728
+ const ret = wasm.kordchord_withInversion(this.__wbg_ptr, inversion);
729
+ return KordChord.__wrap(ret);
730
+ }
731
+ /**
732
+ * Returns the recommended scale/mode candidates for this chord.
733
+ * The candidates are ranked by relevance (rank 1 = most relevant).
734
+ * @returns {Array<any>}
735
+ */
736
+ scaleCandidates() {
737
+ const ret = wasm.kordchord_scaleCandidates(this.__wbg_ptr);
738
+ return ret;
739
+ }
740
+ /**
741
+ * Creates a new [`Chord`] from a set of [`Note`]s.
742
+ *
743
+ * The [`Note`]s should be represented as a space-separated string.
744
+ * E.g., `C E G`.
745
+ * @param {string} notes
746
+ * @returns {Array<any>}
747
+ */
748
+ static fromNotesString(notes) {
749
+ const ptr0 = passStringToWasm0(notes, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
750
+ const len0 = WASM_VECTOR_LEN;
751
+ const ret = wasm.kordchord_fromNotesString(ptr0, len0);
752
+ if (ret[2]) {
753
+ throw takeFromExternrefTable0(ret[1]);
754
+ }
755
+ return takeFromExternrefTable0(ret[0]);
756
+ }
757
+ /**
758
+ * Returns the clone of the [`Chord`].
759
+ * @returns {KordChord}
760
+ */
761
+ copy() {
762
+ const ret = wasm.kordchord_copy(this.__wbg_ptr);
763
+ return KordChord.__wrap(ret);
764
+ }
765
+ /**
766
+ * Returns the [`Chord`]'s friendly name.
767
+ * @returns {string}
768
+ */
769
+ name() {
772
770
  let deferred1_0;
773
771
  let deferred1_1;
774
772
  try {
775
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
776
- wasm.kordchord_root(retptr, this.__wbg_ptr);
777
- var r0 = getInt32Memory0()[retptr / 4 + 0];
778
- var r1 = getInt32Memory0()[retptr / 4 + 1];
779
- deferred1_0 = r0;
780
- deferred1_1 = r1;
781
- return getStringFromWasm0(r0, r1);
773
+ const ret = wasm.kordchord_name(this.__wbg_ptr);
774
+ deferred1_0 = ret[0];
775
+ deferred1_1 = ret[1];
776
+ return getStringFromWasm0(ret[0], ret[1]);
782
777
  } finally {
783
- wasm.__wbindgen_add_to_stack_pointer(16);
784
778
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
785
779
  }
786
780
  }
787
781
  /**
788
- * Returns the [`Chord`]'s slash note.
789
- * @returns {string}
790
- */
791
- slash() {
782
+ * Returns the [`Chord`]'s root note.
783
+ * @returns {string}
784
+ */
785
+ root() {
792
786
  let deferred1_0;
793
787
  let deferred1_1;
794
788
  try {
795
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
796
- wasm.kordchord_slash(retptr, this.__wbg_ptr);
797
- var r0 = getInt32Memory0()[retptr / 4 + 0];
798
- var r1 = getInt32Memory0()[retptr / 4 + 1];
799
- deferred1_0 = r0;
800
- deferred1_1 = r1;
801
- return getStringFromWasm0(r0, r1);
789
+ const ret = wasm.kordchord_root(this.__wbg_ptr);
790
+ deferred1_0 = ret[0];
791
+ deferred1_1 = ret[1];
792
+ return getStringFromWasm0(ret[0], ret[1]);
802
793
  } finally {
803
- wasm.__wbindgen_add_to_stack_pointer(16);
804
794
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
805
795
  }
806
796
  }
807
797
  /**
808
- * Returns the [`Chord`]'s inversion.
809
- * @returns {number}
810
- */
811
- inversion() {
812
- const ret = wasm.kordchord_inversion(this.__wbg_ptr);
798
+ * Returns the [`Chord`]'s chord tones.
799
+ * @returns {Array<any>}
800
+ */
801
+ chord() {
802
+ const ret = wasm.kordchord_chord(this.__wbg_ptr);
813
803
  return ret;
814
804
  }
815
805
  /**
816
- * Returns whether or not the [`Chord`] is "crunchy".
817
- * @returns {boolean}
818
- */
819
- isCrunchy() {
820
- const ret = wasm.kordchord_isCrunchy(this.__wbg_ptr);
821
- return ret !== 0;
806
+ * Creates a new [`Chord`] from a frequency.
807
+ * @param {string} name
808
+ * @returns {KordChord}
809
+ */
810
+ static parse(name) {
811
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
812
+ const len0 = WASM_VECTOR_LEN;
813
+ const ret = wasm.kordchord_parse(ptr0, len0);
814
+ if (ret[2]) {
815
+ throw takeFromExternrefTable0(ret[1]);
816
+ }
817
+ return KordChord.__wrap(ret[0]);
822
818
  }
823
819
  /**
824
- * Returns the [`Chord`]'s chord tones.
825
- * @returns {Array<any>}
826
- */
827
- chord() {
828
- const ret = wasm.kordchord_chord(this.__wbg_ptr);
829
- return takeObject(ret);
820
+ * Returns the [`Chord`]'s scale tones.
821
+ * @returns {Array<any>}
822
+ */
823
+ scale() {
824
+ const ret = wasm.kordchord_scale(this.__wbg_ptr);
825
+ return ret;
830
826
  }
831
827
  /**
832
- * Returns the [`Chord`]'s chord tones as a string.
833
- * @returns {string}
834
- */
835
- chordString() {
828
+ * Returns the [`Chord`]'s slash note.
829
+ * @returns {string}
830
+ */
831
+ slash() {
836
832
  let deferred1_0;
837
833
  let deferred1_1;
838
834
  try {
839
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
840
- wasm.kordchord_chordString(retptr, this.__wbg_ptr);
841
- var r0 = getInt32Memory0()[retptr / 4 + 0];
842
- var r1 = getInt32Memory0()[retptr / 4 + 1];
843
- deferred1_0 = r0;
844
- deferred1_1 = r1;
845
- return getStringFromWasm0(r0, r1);
835
+ const ret = wasm.kordchord_slash(this.__wbg_ptr);
836
+ deferred1_0 = ret[0];
837
+ deferred1_1 = ret[1];
838
+ return getStringFromWasm0(ret[0], ret[1]);
846
839
  } finally {
847
- wasm.__wbindgen_add_to_stack_pointer(16);
848
840
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
849
841
  }
850
842
  }
851
843
  /**
852
- * Returns the [`Chord`]'s scale tones.
853
- * @returns {Array<any>}
854
- */
855
- scale() {
856
- const ret = wasm.kordchord_scale(this.__wbg_ptr);
857
- return takeObject(ret);
858
- }
859
- /**
860
- * Returns the [`Chord`]'s scale tones as a string.
861
- * @returns {string}
862
- */
863
- scaleString() {
844
+ * Returns the [`Chord`]'s display text.
845
+ * @returns {string}
846
+ */
847
+ display() {
864
848
  let deferred1_0;
865
849
  let deferred1_1;
866
850
  try {
867
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
868
- wasm.kordchord_scaleString(retptr, this.__wbg_ptr);
869
- var r0 = getInt32Memory0()[retptr / 4 + 0];
870
- var r1 = getInt32Memory0()[retptr / 4 + 1];
871
- deferred1_0 = r0;
872
- deferred1_1 = r1;
873
- return getStringFromWasm0(r0, r1);
851
+ const ret = wasm.kordchord_display(this.__wbg_ptr);
852
+ deferred1_0 = ret[0];
853
+ deferred1_1 = ret[1];
854
+ return getStringFromWasm0(ret[0], ret[1]);
874
855
  } finally {
875
- wasm.__wbindgen_add_to_stack_pointer(16);
876
856
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
877
857
  }
878
858
  }
879
859
  /**
880
- * Returns the [`Chord`]'s modifiers.
881
- * @returns {Array<any>}
882
- */
883
- modifiers() {
884
- const ret = wasm.kordchord_modifiers(this.__wbg_ptr);
885
- return takeObject(ret);
886
- }
887
- /**
888
- * Returns the [`Chord`]'s extensions.
889
- * @returns {Array<any>}
890
- */
891
- extensions() {
892
- const ret = wasm.kordchord_extensions(this.__wbg_ptr);
893
- return takeObject(ret);
894
- }
895
- /**
896
- * Returns a new [`Chord`] with the inversion set to the provided value.
897
- * @param {number} inversion
898
- * @returns {KordChord}
899
- */
900
- withInversion(inversion) {
901
- const ret = wasm.kordchord_withInversion(this.__wbg_ptr, inversion);
902
- return KordChord.__wrap(ret);
860
+ * Returns the [`Chord`]'s inversion.
861
+ * @returns {number}
862
+ */
863
+ inversion() {
864
+ const ret = wasm.kordchord_inversion(this.__wbg_ptr);
865
+ return ret;
903
866
  }
904
867
  /**
905
- * Returns a new [`Chord`] with the slash set to the provided value.
906
- * @param {KordNote} slash
907
- * @returns {KordChord}
908
- */
909
- withSlash(slash) {
910
- _assertClass(slash, KordNote);
911
- const ret = wasm.kordchord_withSlash(this.__wbg_ptr, slash.__wbg_ptr);
912
- return KordChord.__wrap(ret);
868
+ * Returns the [`Chord`]'s modifiers.
869
+ * @returns {Array<any>}
870
+ */
871
+ modifiers() {
872
+ const ret = wasm.kordchord_modifiers(this.__wbg_ptr);
873
+ return ret;
913
874
  }
914
875
  /**
915
- * Returns a new [`Chord`] with the octave of the root set to the provided value.
916
- * @param {number} octave
917
- * @returns {KordChord}
918
- */
919
- withOctave(octave) {
876
+ * Returns the [`Chord`] as a string (same as `precise_name`).
877
+ * @returns {string}
878
+ */
879
+ toString() {
880
+ let deferred1_0;
881
+ let deferred1_1;
920
882
  try {
921
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
922
- wasm.kordchord_withOctave(retptr, this.__wbg_ptr, octave);
923
- var r0 = getInt32Memory0()[retptr / 4 + 0];
924
- var r1 = getInt32Memory0()[retptr / 4 + 1];
925
- var r2 = getInt32Memory0()[retptr / 4 + 2];
926
- if (r2) {
927
- throw takeObject(r1);
928
- }
929
- return KordChord.__wrap(r0);
883
+ const ret = wasm.kordchord_toString(this.__wbg_ptr);
884
+ deferred1_0 = ret[0];
885
+ deferred1_1 = ret[1];
886
+ return getStringFromWasm0(ret[0], ret[1]);
930
887
  } finally {
931
- wasm.__wbindgen_add_to_stack_pointer(16);
888
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
932
889
  }
933
890
  }
934
891
  /**
935
- * Returns a new [`Chord`] with the "crunchiness" set to the provided value.
936
- * @param {boolean} is_crunchy
937
- * @returns {KordChord}
938
- */
939
- withCrunchy(is_crunchy) {
940
- const ret = wasm.kordchord_withCrunchy(this.__wbg_ptr, is_crunchy);
892
+ * Returns a new [`Chord`] with the `augmented` modifier.
893
+ * @returns {KordChord}
894
+ */
895
+ aug() {
896
+ const ret = wasm.kordchord_aug(this.__wbg_ptr);
941
897
  return KordChord.__wrap(ret);
942
898
  }
943
899
  /**
944
- * Plays the [`Chord`].
945
- * @param {number} delay
946
- * @param {number} length
947
- * @param {number} fade_in
948
- * @returns {Promise<void>}
949
- */
950
- play(delay, length, fade_in) {
951
- const ret = wasm.kordchord_play(this.__wbg_ptr, delay, length, fade_in);
952
- return takeObject(ret);
900
+ * Returns a new [`Chord`] with the `dim` modifier.
901
+ * @returns {KordChord}
902
+ */
903
+ dim() {
904
+ const ret = wasm.kordchord_dim(this.__wbg_ptr);
905
+ return KordChord.__wrap(ret);
953
906
  }
954
907
  /**
955
- * Returns the clone of the [`Chord`].
956
- * @returns {KordChord}
957
- */
958
- copy() {
959
- const ret = wasm.kordchord_copy(this.__wbg_ptr);
908
+ * Returns a new [`Chord`] with the `add2` extension.
909
+ * @returns {KordChord}
910
+ */
911
+ add2() {
912
+ const ret = wasm.kordchord_add2(this.__wbg_ptr);
960
913
  return KordChord.__wrap(ret);
961
914
  }
962
915
  /**
963
- * Returns a new [`Chord`] with the `minor` modifier.
964
- * @returns {KordChord}
965
- */
966
- minor() {
967
- const ret = wasm.kordchord_minor(this.__wbg_ptr);
916
+ * Returns a new [`Chord`] with the `add4` extension.
917
+ * @returns {KordChord}
918
+ */
919
+ add4() {
920
+ const ret = wasm.kordchord_add4(this.__wbg_ptr);
968
921
  return KordChord.__wrap(ret);
969
922
  }
970
923
  /**
971
- * Returns a new [`Chord`] with the `flat5` modifier.
972
- * @returns {KordChord}
973
- */
974
- flat5() {
975
- const ret = wasm.kordchord_flat5(this.__wbg_ptr);
924
+ * Returns a new [`Chord`] with the `add6` extension.
925
+ * @returns {KordChord}
926
+ */
927
+ add6() {
928
+ const ret = wasm.kordchord_add6(this.__wbg_ptr);
976
929
  return KordChord.__wrap(ret);
977
930
  }
978
931
  /**
979
- * Returns a new [`Chord`] with the `augmented` modifier.
980
- * @returns {KordChord}
981
- */
982
- aug() {
983
- const ret = wasm.kordchord_aug(this.__wbg_ptr);
932
+ * Returns a new [`Chord`] with the `add9` extension.
933
+ * @returns {KordChord}
934
+ */
935
+ add9() {
936
+ const ret = wasm.kordchord_add9(this.__wbg_ptr);
984
937
  return KordChord.__wrap(ret);
985
938
  }
986
939
  /**
987
- * Returns a new [`Chord`] with the `maj7` modifier.
988
- * @returns {KordChord}
989
- */
940
+ * Returns a new [`Chord`] with the `maj7` modifier.
941
+ * @returns {KordChord}
942
+ */
990
943
  maj7() {
991
944
  const ret = wasm.kordchord_maj7(this.__wbg_ptr);
992
945
  return KordChord.__wrap(ret);
993
946
  }
994
947
  /**
995
- * Returns a new [`Chord`] with the `dom7` modifier.
996
- * @returns {KordChord}
997
- */
998
- seven() {
999
- const ret = wasm.kordchord_seven(this.__wbg_ptr);
1000
- return KordChord.__wrap(ret);
1001
- }
1002
- /**
1003
- * Returns a new [`Chord`] with the `dom9` modifier.
1004
- * @returns {KordChord}
1005
- */
948
+ * Returns a new [`Chord`] with the `dom9` modifier.
949
+ * @returns {KordChord}
950
+ */
1006
951
  nine() {
1007
952
  const ret = wasm.kordchord_nine(this.__wbg_ptr);
1008
953
  return KordChord.__wrap(ret);
1009
954
  }
1010
955
  /**
1011
- * Returns a new [`Chord`] with the `dom11` modifier.
1012
- * @returns {KordChord}
1013
- */
1014
- eleven() {
1015
- const ret = wasm.kordchord_eleven(this.__wbg_ptr);
956
+ * Returns a new [`Chord`] with the `sus2` extension.
957
+ * @returns {KordChord}
958
+ */
959
+ sus2() {
960
+ const ret = wasm.kordchord_sus2(this.__wbg_ptr);
1016
961
  return KordChord.__wrap(ret);
1017
962
  }
1018
963
  /**
1019
- * Returns a new [`Chord`] with the `dom13` modifier.
1020
- * @returns {KordChord}
1021
- */
1022
- thirteen() {
1023
- const ret = wasm.kordchord_thirteen(this.__wbg_ptr);
964
+ * Returns a new [`Chord`] with the `sus4` extension.
965
+ * @returns {KordChord}
966
+ */
967
+ sus4() {
968
+ const ret = wasm.kordchord_sus4(this.__wbg_ptr);
1024
969
  return KordChord.__wrap(ret);
1025
970
  }
1026
971
  /**
1027
- * Returns a new [`Chord`] with the `flat9` modifier.
1028
- * @returns {KordChord}
1029
- */
1030
- flat9() {
1031
- const ret = wasm.kordchord_flat9(this.__wbg_ptr);
972
+ * Returns a new [`Chord`] with the `add11` extension.
973
+ * @returns {KordChord}
974
+ */
975
+ add11() {
976
+ const ret = wasm.kordchord_add11(this.__wbg_ptr);
1032
977
  return KordChord.__wrap(ret);
1033
978
  }
1034
979
  /**
1035
- * Returns a new [`Chord`] with the `sharp9` modifier.
1036
- * @returns {KordChord}
1037
- */
1038
- sharp9() {
1039
- const ret = wasm.kordchord_sharp9(this.__wbg_ptr);
980
+ * Returns a new [`Chord`] with the `add13` extension.
981
+ * @returns {KordChord}
982
+ */
983
+ add13() {
984
+ const ret = wasm.kordchord_add13(this.__wbg_ptr);
1040
985
  return KordChord.__wrap(ret);
1041
986
  }
1042
987
  /**
1043
- * Returns a new [`Chord`] with the `sharp11` modifier.
1044
- * @returns {KordChord}
1045
- */
1046
- sharp11() {
1047
- const ret = wasm.kordchord_sharp11(this.__wbg_ptr);
988
+ * Returns a new [`Chord`] with the `flat5` modifier.
989
+ * @returns {KordChord}
990
+ */
991
+ flat5() {
992
+ const ret = wasm.kordchord_flat5(this.__wbg_ptr);
1048
993
  return KordChord.__wrap(ret);
1049
994
  }
1050
995
  /**
1051
- * Returns a new [`Chord`] with the `dim` modifier.
1052
- * @returns {KordChord}
1053
- */
1054
- dim() {
1055
- const ret = wasm.kordchord_dim(this.__wbg_ptr);
996
+ * Returns a new [`Chord`] with the `flat9` modifier.
997
+ * @returns {KordChord}
998
+ */
999
+ flat9() {
1000
+ const ret = wasm.kordchord_flat9(this.__wbg_ptr);
1056
1001
  return KordChord.__wrap(ret);
1057
1002
  }
1058
1003
  /**
1059
- * Returns a new [`Chord`] with the `halfDim` modifier.
1060
- * @returns {KordChord}
1061
- */
1062
- halfDim() {
1063
- const ret = wasm.kordchord_halfDim(this.__wbg_ptr);
1004
+ * Returns a new [`Chord`] with the `minor` modifier.
1005
+ * @returns {KordChord}
1006
+ */
1007
+ minor() {
1008
+ const ret = wasm.kordchord_minor(this.__wbg_ptr);
1064
1009
  return KordChord.__wrap(ret);
1065
1010
  }
1066
1011
  /**
1067
- * Returns a new [`Chord`] with the `sus2` extension.
1068
- * @returns {KordChord}
1069
- */
1070
- sus2() {
1071
- const ret = wasm.kordchord_sus2(this.__wbg_ptr);
1012
+ * Returns a new [`Chord`] with the `dom7` modifier.
1013
+ * @returns {KordChord}
1014
+ */
1015
+ seven() {
1016
+ const ret = wasm.kordchord_seven(this.__wbg_ptr);
1072
1017
  return KordChord.__wrap(ret);
1073
1018
  }
1074
1019
  /**
1075
- * Returns a new [`Chord`] with the `sus4` extension.
1076
- * @returns {KordChord}
1077
- */
1078
- sus4() {
1079
- const ret = wasm.kordchord_sus4(this.__wbg_ptr);
1020
+ * Returns a new [`Chord`] with the `dom11` modifier.
1021
+ * @returns {KordChord}
1022
+ */
1023
+ eleven() {
1024
+ const ret = wasm.kordchord_eleven(this.__wbg_ptr);
1080
1025
  return KordChord.__wrap(ret);
1081
1026
  }
1082
1027
  /**
1083
- * Returns a new [`Chord`] with the `flat11` extension.
1084
- * @returns {KordChord}
1085
- */
1028
+ * Returns a new [`Chord`] with the `flat11` extension.
1029
+ * @returns {KordChord}
1030
+ */
1086
1031
  flat11() {
1087
1032
  const ret = wasm.kordchord_flat11(this.__wbg_ptr);
1088
1033
  return KordChord.__wrap(ret);
1089
1034
  }
1090
1035
  /**
1091
- * Returns a new [`Chord`] with the `flat13` extension.
1092
- * @returns {KordChord}
1093
- */
1036
+ * Returns a new [`Chord`] with the `flat13` extension.
1037
+ * @returns {KordChord}
1038
+ */
1094
1039
  flat13() {
1095
1040
  const ret = wasm.kordchord_flat13(this.__wbg_ptr);
1096
1041
  return KordChord.__wrap(ret);
1097
1042
  }
1098
1043
  /**
1099
- * Returns a new [`Chord`] with the `sharp13` extension.
1100
- * @returns {KordChord}
1101
- */
1102
- sharp13() {
1103
- const ret = wasm.kordchord_sharp13(this.__wbg_ptr);
1044
+ * Returns a new [`Chord`] with the `sharp9` modifier.
1045
+ * @returns {KordChord}
1046
+ */
1047
+ sharp9() {
1048
+ const ret = wasm.kordchord_sharp9(this.__wbg_ptr);
1104
1049
  return KordChord.__wrap(ret);
1105
1050
  }
1106
1051
  /**
1107
- * Returns a new [`Chord`] with the `add2` extension.
1108
- * @returns {KordChord}
1109
- */
1110
- add2() {
1111
- const ret = wasm.kordchord_add2(this.__wbg_ptr);
1052
+ * Returns a new [`Chord`] with the `sharp11` modifier.
1053
+ * @returns {KordChord}
1054
+ */
1055
+ sharp11() {
1056
+ const ret = wasm.kordchord_sharp11(this.__wbg_ptr);
1112
1057
  return KordChord.__wrap(ret);
1113
1058
  }
1114
1059
  /**
1115
- * Returns a new [`Chord`] with the `add4` extension.
1116
- * @returns {KordChord}
1117
- */
1118
- add4() {
1119
- const ret = wasm.kordchord_add4(this.__wbg_ptr);
1060
+ * Returns a new [`Chord`] with the `sharp13` extension.
1061
+ * @returns {KordChord}
1062
+ */
1063
+ sharp13() {
1064
+ const ret = wasm.kordchord_sharp13(this.__wbg_ptr);
1120
1065
  return KordChord.__wrap(ret);
1121
1066
  }
1122
1067
  /**
1123
- * Returns a new [`Chord`] with the `add6` extension.
1124
- * @returns {KordChord}
1125
- */
1126
- add6() {
1127
- const ret = wasm.kordchord_add6(this.__wbg_ptr);
1068
+ * Returns a new [`Chord`] with the `halfDim` modifier.
1069
+ * @returns {KordChord}
1070
+ */
1071
+ halfDim() {
1072
+ const ret = wasm.kordchord_halfDim(this.__wbg_ptr);
1128
1073
  return KordChord.__wrap(ret);
1129
1074
  }
1130
1075
  /**
1131
- * Returns a new [`Chord`] with the `add9` extension.
1132
- * @returns {KordChord}
1133
- */
1134
- add9() {
1135
- const ret = wasm.kordchord_add9(this.__wbg_ptr);
1076
+ * Returns a new [`Chord`] with the `dom13` modifier.
1077
+ * @returns {KordChord}
1078
+ */
1079
+ thirteen() {
1080
+ const ret = wasm.kordchord_thirteen(this.__wbg_ptr);
1136
1081
  return KordChord.__wrap(ret);
1137
1082
  }
1083
+ }
1084
+
1085
+ const KordModeFinalization = (typeof FinalizationRegistry === 'undefined')
1086
+ ? { register: () => {}, unregister: () => {} }
1087
+ : new FinalizationRegistry(ptr => wasm.__wbg_kordmode_free(ptr >>> 0, 1));
1088
+ /**
1089
+ * The [`Mode`] wrapper.
1090
+ */
1091
+ export class KordMode {
1092
+
1093
+ static __wrap(ptr) {
1094
+ ptr = ptr >>> 0;
1095
+ const obj = Object.create(KordMode.prototype);
1096
+ obj.__wbg_ptr = ptr;
1097
+ KordModeFinalization.register(obj, obj.__wbg_ptr, obj);
1098
+ return obj;
1099
+ }
1100
+
1101
+ __destroy_into_raw() {
1102
+ const ptr = this.__wbg_ptr;
1103
+ this.__wbg_ptr = 0;
1104
+ KordModeFinalization.unregister(this);
1105
+ return ptr;
1106
+ }
1107
+
1108
+ free() {
1109
+ const ptr = this.__destroy_into_raw();
1110
+ wasm.__wbg_kordmode_free(ptr, 0);
1111
+ }
1138
1112
  /**
1139
- * Returns a new [`Chord`] with the `add11` extension.
1140
- * @returns {KordChord}
1141
- */
1142
- add11() {
1143
- const ret = wasm.kordchord_add11(this.__wbg_ptr);
1144
- return KordChord.__wrap(ret);
1113
+ * Returns the [`Mode`]'s description.
1114
+ * @returns {string}
1115
+ */
1116
+ description() {
1117
+ let deferred1_0;
1118
+ let deferred1_1;
1119
+ try {
1120
+ const ret = wasm.kordmode_description(this.__wbg_ptr);
1121
+ deferred1_0 = ret[0];
1122
+ deferred1_1 = ret[1];
1123
+ return getStringFromWasm0(ret[0], ret[1]);
1124
+ } finally {
1125
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1126
+ }
1145
1127
  }
1146
1128
  /**
1147
- * Returns a new [`Chord`] with the `add13` extension.
1148
- * @returns {KordChord}
1149
- */
1150
- add13() {
1151
- const ret = wasm.kordchord_add13(this.__wbg_ptr);
1152
- return KordChord.__wrap(ret);
1129
+ * Returns the [`Mode`]'s notes as a string.
1130
+ * @returns {string}
1131
+ */
1132
+ notesString() {
1133
+ let deferred1_0;
1134
+ let deferred1_1;
1135
+ try {
1136
+ const ret = wasm.kordmode_notesString(this.__wbg_ptr);
1137
+ deferred1_0 = ret[0];
1138
+ deferred1_1 = ret[1];
1139
+ return getStringFromWasm0(ret[0], ret[1]);
1140
+ } finally {
1141
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1142
+ }
1143
+ }
1144
+ /**
1145
+ * Returns the [`Mode`]'s precise name.
1146
+ * @returns {string}
1147
+ */
1148
+ preciseName() {
1149
+ let deferred1_0;
1150
+ let deferred1_1;
1151
+ try {
1152
+ const ret = wasm.kordmode_preciseName(this.__wbg_ptr);
1153
+ deferred1_0 = ret[0];
1154
+ deferred1_1 = ret[1];
1155
+ return getStringFromWasm0(ret[0], ret[1]);
1156
+ } finally {
1157
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1158
+ }
1159
+ }
1160
+ /**
1161
+ * Returns the clone of the [`Mode`].
1162
+ * @returns {KordMode}
1163
+ */
1164
+ copy() {
1165
+ const ret = wasm.kordmode_copy(this.__wbg_ptr);
1166
+ return KordMode.__wrap(ret);
1167
+ }
1168
+ /**
1169
+ * Returns the [`Mode`]'s friendly name.
1170
+ * @returns {string}
1171
+ */
1172
+ name() {
1173
+ let deferred1_0;
1174
+ let deferred1_1;
1175
+ try {
1176
+ const ret = wasm.kordmode_name(this.__wbg_ptr);
1177
+ deferred1_0 = ret[0];
1178
+ deferred1_1 = ret[1];
1179
+ return getStringFromWasm0(ret[0], ret[1]);
1180
+ } finally {
1181
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1182
+ }
1183
+ }
1184
+ /**
1185
+ * Returns the [`Mode`]'s root note.
1186
+ * @returns {string}
1187
+ */
1188
+ root() {
1189
+ let deferred1_0;
1190
+ let deferred1_1;
1191
+ try {
1192
+ const ret = wasm.kordmode_root(this.__wbg_ptr);
1193
+ deferred1_0 = ret[0];
1194
+ deferred1_1 = ret[1];
1195
+ return getStringFromWasm0(ret[0], ret[1]);
1196
+ } finally {
1197
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1198
+ }
1199
+ }
1200
+ /**
1201
+ * Returns the [`Mode`]'s notes.
1202
+ * @returns {Array<any>}
1203
+ */
1204
+ notes() {
1205
+ const ret = wasm.kordmode_notes(this.__wbg_ptr);
1206
+ return ret;
1207
+ }
1208
+ /**
1209
+ * Creates a new [`Mode`] by parsing a string (e.g., "C dorian", "D lydian dominant").
1210
+ * @param {string} name
1211
+ * @returns {KordMode}
1212
+ */
1213
+ static parse(name) {
1214
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1215
+ const len0 = WASM_VECTOR_LEN;
1216
+ const ret = wasm.kordmode_parse(ptr0, len0);
1217
+ if (ret[2]) {
1218
+ throw takeFromExternrefTable0(ret[1]);
1219
+ }
1220
+ return KordMode.__wrap(ret[0]);
1221
+ }
1222
+ /**
1223
+ * Returns the [`Mode`] as a string (same as `precise_name`).
1224
+ * @returns {string}
1225
+ */
1226
+ toString() {
1227
+ let deferred1_0;
1228
+ let deferred1_1;
1229
+ try {
1230
+ const ret = wasm.kordmode_toString(this.__wbg_ptr);
1231
+ deferred1_0 = ret[0];
1232
+ deferred1_1 = ret[1];
1233
+ return getStringFromWasm0(ret[0], ret[1]);
1234
+ } finally {
1235
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1236
+ }
1153
1237
  }
1154
1238
  }
1239
+
1240
+ const KordNoteFinalization = (typeof FinalizationRegistry === 'undefined')
1241
+ ? { register: () => {}, unregister: () => {} }
1242
+ : new FinalizationRegistry(ptr => wasm.__wbg_kordnote_free(ptr >>> 0, 1));
1155
1243
  /**
1156
- * The [`Note`] wrapper.
1157
- */
1244
+ * The [`Note`] wrapper.
1245
+ */
1158
1246
  export class KordNote {
1159
1247
 
1160
1248
  static __wrap(ptr) {
1161
1249
  ptr = ptr >>> 0;
1162
1250
  const obj = Object.create(KordNote.prototype);
1163
1251
  obj.__wbg_ptr = ptr;
1164
-
1252
+ KordNoteFinalization.register(obj, obj.__wbg_ptr, obj);
1165
1253
  return obj;
1166
1254
  }
1167
1255
 
1168
1256
  __destroy_into_raw() {
1169
1257
  const ptr = this.__wbg_ptr;
1170
1258
  this.__wbg_ptr = 0;
1171
-
1259
+ KordNoteFinalization.unregister(this);
1172
1260
  return ptr;
1173
1261
  }
1174
1262
 
1175
1263
  free() {
1176
1264
  const ptr = this.__destroy_into_raw();
1177
- wasm.__wbg_kordnote_free(ptr);
1265
+ wasm.__wbg_kordnote_free(ptr, 0);
1266
+ }
1267
+ /**
1268
+ * Returns [`Note`]s from audio data.
1269
+ * @param {Float32Array} data
1270
+ * @param {number} length_in_seconds
1271
+ * @returns {Array<any>}
1272
+ */
1273
+ static fromAudio(data, length_in_seconds) {
1274
+ const ptr0 = passArrayF32ToWasm0(data, wasm.__wbindgen_malloc);
1275
+ const len0 = WASM_VECTOR_LEN;
1276
+ const ret = wasm.kordnote_fromAudio(ptr0, len0, length_in_seconds);
1277
+ if (ret[2]) {
1278
+ throw takeFromExternrefTable0(ret[1]);
1279
+ }
1280
+ return takeFromExternrefTable0(ret[0]);
1178
1281
  }
1179
1282
  /**
1180
- * Creates a new [`Note`] from a frequency.
1181
- * @param {string} name
1182
- * @returns {KordNote}
1183
- */
1283
+ * Computes the [`Interval`] distance between the [`Note`] and the given [`Note`].
1284
+ * @param {KordNote} other
1285
+ * @returns {KordInterval}
1286
+ */
1287
+ distanceTo(other) {
1288
+ _assertClass(other, KordNote);
1289
+ var ptr0 = other.__destroy_into_raw();
1290
+ const ret = wasm.kordnote_distanceTo(this.__wbg_ptr, ptr0);
1291
+ return ret;
1292
+ }
1293
+ /**
1294
+ * Adds the given interval to the [`Note`], producing a new [`Note`] instance.
1295
+ * @param {KordInterval} interval
1296
+ * @returns {KordNote}
1297
+ */
1298
+ addInterval(interval) {
1299
+ const ret = wasm.kordnote_addInterval(this.__wbg_ptr, interval);
1300
+ return KordNote.__wrap(ret);
1301
+ }
1302
+ /**
1303
+ * Returns [`Note`]s from audio data using the ML inference algorithm.
1304
+ * @param {Float32Array} data
1305
+ * @param {number} length_in_seconds
1306
+ * @returns {Array<any>}
1307
+ */
1308
+ static fromAudioMl(data, length_in_seconds) {
1309
+ const ptr0 = passArrayF32ToWasm0(data, wasm.__wbindgen_malloc);
1310
+ const len0 = WASM_VECTOR_LEN;
1311
+ const ret = wasm.kordnote_fromAudioMl(ptr0, len0, length_in_seconds);
1312
+ if (ret[2]) {
1313
+ throw takeFromExternrefTable0(ret[1]);
1314
+ }
1315
+ return takeFromExternrefTable0(ret[0]);
1316
+ }
1317
+ /**
1318
+ * Returns the primary (first 13) harmonic series of the [`Note`].
1319
+ * @returns {Array<any>}
1320
+ */
1321
+ harmonicSeries() {
1322
+ const ret = wasm.kordnote_harmonicSeries(this.__wbg_ptr);
1323
+ return ret;
1324
+ }
1325
+ /**
1326
+ * Subtracts the given interval from the [`Note`], producing a new [`Note`] instance.
1327
+ * @param {KordInterval} interval
1328
+ * @returns {KordNote}
1329
+ */
1330
+ subInterval(interval) {
1331
+ const ret = wasm.kordnote_subInterval(this.__wbg_ptr, interval);
1332
+ return KordNote.__wrap(ret);
1333
+ }
1334
+ /**
1335
+ * Returns the clone of the [`Note`].
1336
+ * @returns {KordNote}
1337
+ */
1338
+ copy() {
1339
+ const ret = wasm.kordnote_copy(this.__wbg_ptr);
1340
+ return KordNote.__wrap(ret);
1341
+ }
1342
+ /**
1343
+ * Returns the [`Note`]'s friendly name.
1344
+ * @returns {string}
1345
+ */
1346
+ name() {
1347
+ let deferred1_0;
1348
+ let deferred1_1;
1349
+ try {
1350
+ const ret = wasm.kordnote_name(this.__wbg_ptr);
1351
+ deferred1_0 = ret[0];
1352
+ deferred1_1 = ret[1];
1353
+ return getStringFromWasm0(ret[0], ret[1]);
1354
+ } finally {
1355
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1356
+ }
1357
+ }
1358
+ /**
1359
+ * Creates a new [`Note`] from a frequency.
1360
+ * @param {string} name
1361
+ * @returns {KordNote}
1362
+ */
1184
1363
  static parse(name) {
1364
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1365
+ const len0 = WASM_VECTOR_LEN;
1366
+ const ret = wasm.kordnote_parse(ptr0, len0);
1367
+ if (ret[2]) {
1368
+ throw takeFromExternrefTable0(ret[1]);
1369
+ }
1370
+ return KordNote.__wrap(ret[0]);
1371
+ }
1372
+ /**
1373
+ * Returns the [`Note`]'s [`NamedPitch`].
1374
+ * @returns {string}
1375
+ */
1376
+ pitch() {
1377
+ let deferred1_0;
1378
+ let deferred1_1;
1185
1379
  try {
1186
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1187
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1188
- const len0 = WASM_VECTOR_LEN;
1189
- wasm.kordnote_parse(retptr, ptr0, len0);
1190
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1191
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1192
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1193
- if (r2) {
1194
- throw takeObject(r1);
1195
- }
1196
- return KordNote.__wrap(r0);
1380
+ const ret = wasm.kordnote_pitch(this.__wbg_ptr);
1381
+ deferred1_0 = ret[0];
1382
+ deferred1_1 = ret[1];
1383
+ return getStringFromWasm0(ret[0], ret[1]);
1197
1384
  } finally {
1198
- wasm.__wbindgen_add_to_stack_pointer(16);
1385
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1199
1386
  }
1200
1387
  }
1201
1388
  /**
1202
- * Returns [`Note`]s from audio data.
1203
- * @param {Float32Array} data
1204
- * @param {number} length_in_seconds
1205
- * @returns {Array<any>}
1206
- */
1207
- static fromAudio(data, length_in_seconds) {
1389
+ * Returns the [`Note`]'s [`Octave`].
1390
+ * @returns {number}
1391
+ */
1392
+ octave() {
1393
+ const ret = wasm.kordnote_octave(this.__wbg_ptr);
1394
+ return ret;
1395
+ }
1396
+ /**
1397
+ * Returns the [`Note`]'s frequency.
1398
+ * @returns {number}
1399
+ */
1400
+ frequency() {
1401
+ const ret = wasm.kordnote_frequency(this.__wbg_ptr);
1402
+ return ret;
1403
+ }
1404
+ /**
1405
+ * Returns the [`Note`] represented as a string (same as `name`).
1406
+ * @returns {string}
1407
+ */
1408
+ toString() {
1409
+ let deferred1_0;
1410
+ let deferred1_1;
1208
1411
  try {
1209
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1210
- const ptr0 = passArrayF32ToWasm0(data, wasm.__wbindgen_malloc);
1211
- const len0 = WASM_VECTOR_LEN;
1212
- wasm.kordnote_fromAudio(retptr, ptr0, len0, length_in_seconds);
1213
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1214
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1215
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1216
- if (r2) {
1217
- throw takeObject(r1);
1218
- }
1219
- return takeObject(r0);
1412
+ const ret = wasm.kordnote_toString(this.__wbg_ptr);
1413
+ deferred1_0 = ret[0];
1414
+ deferred1_1 = ret[1];
1415
+ return getStringFromWasm0(ret[0], ret[1]);
1220
1416
  } finally {
1221
- wasm.__wbindgen_add_to_stack_pointer(16);
1417
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1222
1418
  }
1223
1419
  }
1224
- /**
1225
- * Returns [`Note`]s from audio data using the ML inference algorithm.
1226
- * @param {Float32Array} data
1227
- * @param {number} length_in_seconds
1228
- * @returns {Array<any>}
1229
- */
1230
- static fromAudioMl(data, length_in_seconds) {
1231
- try {
1232
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1233
- const ptr0 = passArrayF32ToWasm0(data, wasm.__wbindgen_malloc);
1234
- const len0 = WASM_VECTOR_LEN;
1235
- wasm.kordnote_fromAudioMl(retptr, ptr0, len0, length_in_seconds);
1236
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1237
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1238
- var r2 = getInt32Memory0()[retptr / 4 + 2];
1239
- if (r2) {
1240
- throw takeObject(r1);
1241
- }
1242
- return takeObject(r0);
1243
- } finally {
1244
- wasm.__wbindgen_add_to_stack_pointer(16);
1245
- }
1420
+ }
1421
+
1422
+ const KordPlaybackHandleFinalization = (typeof FinalizationRegistry === 'undefined')
1423
+ ? { register: () => {}, unregister: () => {} }
1424
+ : new FinalizationRegistry(ptr => wasm.__wbg_kordplaybackhandle_free(ptr >>> 0, 1));
1425
+ /**
1426
+ * A handle to a [`Chord`] playback.
1427
+ *
1428
+ * Should be dropped to stop the playback, or after playback is finished.
1429
+ */
1430
+ export class KordPlaybackHandle {
1431
+
1432
+ __destroy_into_raw() {
1433
+ const ptr = this.__wbg_ptr;
1434
+ this.__wbg_ptr = 0;
1435
+ KordPlaybackHandleFinalization.unregister(this);
1436
+ return ptr;
1437
+ }
1438
+
1439
+ free() {
1440
+ const ptr = this.__destroy_into_raw();
1441
+ wasm.__wbg_kordplaybackhandle_free(ptr, 0);
1442
+ }
1443
+ }
1444
+
1445
+ const KordScaleFinalization = (typeof FinalizationRegistry === 'undefined')
1446
+ ? { register: () => {}, unregister: () => {} }
1447
+ : new FinalizationRegistry(ptr => wasm.__wbg_kordscale_free(ptr >>> 0, 1));
1448
+ /**
1449
+ * The [`Scale`] wrapper.
1450
+ */
1451
+ export class KordScale {
1452
+
1453
+ static __wrap(ptr) {
1454
+ ptr = ptr >>> 0;
1455
+ const obj = Object.create(KordScale.prototype);
1456
+ obj.__wbg_ptr = ptr;
1457
+ KordScaleFinalization.register(obj, obj.__wbg_ptr, obj);
1458
+ return obj;
1459
+ }
1460
+
1461
+ __destroy_into_raw() {
1462
+ const ptr = this.__wbg_ptr;
1463
+ this.__wbg_ptr = 0;
1464
+ KordScaleFinalization.unregister(this);
1465
+ return ptr;
1466
+ }
1467
+
1468
+ free() {
1469
+ const ptr = this.__destroy_into_raw();
1470
+ wasm.__wbg_kordscale_free(ptr, 0);
1471
+ }
1472
+ /**
1473
+ * Returns the [`Scale`]'s description.
1474
+ * @returns {string}
1475
+ */
1476
+ description() {
1477
+ let deferred1_0;
1478
+ let deferred1_1;
1479
+ try {
1480
+ const ret = wasm.kordscale_description(this.__wbg_ptr);
1481
+ deferred1_0 = ret[0];
1482
+ deferred1_1 = ret[1];
1483
+ return getStringFromWasm0(ret[0], ret[1]);
1484
+ } finally {
1485
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1486
+ }
1487
+ }
1488
+ /**
1489
+ * Returns the [`Scale`]'s notes as a string.
1490
+ * @returns {string}
1491
+ */
1492
+ notesString() {
1493
+ let deferred1_0;
1494
+ let deferred1_1;
1495
+ try {
1496
+ const ret = wasm.kordscale_notesString(this.__wbg_ptr);
1497
+ deferred1_0 = ret[0];
1498
+ deferred1_1 = ret[1];
1499
+ return getStringFromWasm0(ret[0], ret[1]);
1500
+ } finally {
1501
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1502
+ }
1503
+ }
1504
+ /**
1505
+ * Returns the [`Scale`]'s precise name.
1506
+ * @returns {string}
1507
+ */
1508
+ preciseName() {
1509
+ let deferred1_0;
1510
+ let deferred1_1;
1511
+ try {
1512
+ const ret = wasm.kordscale_preciseName(this.__wbg_ptr);
1513
+ deferred1_0 = ret[0];
1514
+ deferred1_1 = ret[1];
1515
+ return getStringFromWasm0(ret[0], ret[1]);
1516
+ } finally {
1517
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1518
+ }
1519
+ }
1520
+ /**
1521
+ * Returns the clone of the [`Scale`].
1522
+ * @returns {KordScale}
1523
+ */
1524
+ copy() {
1525
+ const ret = wasm.kordmode_copy(this.__wbg_ptr);
1526
+ return KordScale.__wrap(ret);
1527
+ }
1528
+ /**
1529
+ * Returns the [`Scale`]'s friendly name.
1530
+ * @returns {string}
1531
+ */
1532
+ name() {
1533
+ let deferred1_0;
1534
+ let deferred1_1;
1535
+ try {
1536
+ const ret = wasm.kordscale_name(this.__wbg_ptr);
1537
+ deferred1_0 = ret[0];
1538
+ deferred1_1 = ret[1];
1539
+ return getStringFromWasm0(ret[0], ret[1]);
1540
+ } finally {
1541
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1542
+ }
1543
+ }
1544
+ /**
1545
+ * Returns the [`Scale`]'s root note.
1546
+ * @returns {string}
1547
+ */
1548
+ root() {
1549
+ let deferred1_0;
1550
+ let deferred1_1;
1551
+ try {
1552
+ const ret = wasm.kordscale_root(this.__wbg_ptr);
1553
+ deferred1_0 = ret[0];
1554
+ deferred1_1 = ret[1];
1555
+ return getStringFromWasm0(ret[0], ret[1]);
1556
+ } finally {
1557
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1558
+ }
1559
+ }
1560
+ /**
1561
+ * Returns the [`Scale`]'s notes.
1562
+ * @returns {Array<any>}
1563
+ */
1564
+ notes() {
1565
+ const ret = wasm.kordscale_notes(this.__wbg_ptr);
1566
+ return ret;
1567
+ }
1568
+ /**
1569
+ * Creates a new [`Scale`] by parsing a string (e.g., "C major", "A harmonic minor", "E blues").
1570
+ * @param {string} name
1571
+ * @returns {KordScale}
1572
+ */
1573
+ static parse(name) {
1574
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1575
+ const len0 = WASM_VECTOR_LEN;
1576
+ const ret = wasm.kordscale_parse(ptr0, len0);
1577
+ if (ret[2]) {
1578
+ throw takeFromExternrefTable0(ret[1]);
1579
+ }
1580
+ return KordScale.__wrap(ret[0]);
1581
+ }
1582
+ /**
1583
+ * Returns the [`Scale`] as a string (same as `precise_name`).
1584
+ * @returns {string}
1585
+ */
1586
+ toString() {
1587
+ let deferred1_0;
1588
+ let deferred1_1;
1589
+ try {
1590
+ const ret = wasm.kordscale_toString(this.__wbg_ptr);
1591
+ deferred1_0 = ret[0];
1592
+ deferred1_1 = ret[1];
1593
+ return getStringFromWasm0(ret[0], ret[1]);
1594
+ } finally {
1595
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1596
+ }
1597
+ }
1598
+ }
1599
+
1600
+ const KordScaleCandidateFinalization = (typeof FinalizationRegistry === 'undefined')
1601
+ ? { register: () => {}, unregister: () => {} }
1602
+ : new FinalizationRegistry(ptr => wasm.__wbg_kordscalecandidate_free(ptr >>> 0, 1));
1603
+ /**
1604
+ * The [`ScaleCandidate`] wrapper for WASM.
1605
+ * Represents a recommended scale or mode for a chord.
1606
+ */
1607
+ export class KordScaleCandidate {
1608
+
1609
+ static __wrap(ptr) {
1610
+ ptr = ptr >>> 0;
1611
+ const obj = Object.create(KordScaleCandidate.prototype);
1612
+ obj.__wbg_ptr = ptr;
1613
+ KordScaleCandidateFinalization.register(obj, obj.__wbg_ptr, obj);
1614
+ return obj;
1615
+ }
1616
+
1617
+ __destroy_into_raw() {
1618
+ const ptr = this.__wbg_ptr;
1619
+ this.__wbg_ptr = 0;
1620
+ KordScaleCandidateFinalization.unregister(this);
1621
+ return ptr;
1622
+ }
1623
+
1624
+ free() {
1625
+ const ptr = this.__destroy_into_raw();
1626
+ wasm.__wbg_kordscalecandidate_free(ptr, 0);
1246
1627
  }
1247
1628
  /**
1248
- * Returns the [`Note`]'s friendly name.
1249
- * @returns {string}
1250
- */
1251
- name() {
1629
+ * Returns the description of the scale or mode.
1630
+ * @returns {string}
1631
+ */
1632
+ description() {
1252
1633
  let deferred1_0;
1253
1634
  let deferred1_1;
1254
1635
  try {
1255
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1256
- wasm.kordnote_name(retptr, this.__wbg_ptr);
1257
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1258
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1259
- deferred1_0 = r0;
1260
- deferred1_1 = r1;
1261
- return getStringFromWasm0(r0, r1);
1636
+ const ret = wasm.kordscalecandidate_description(this.__wbg_ptr);
1637
+ deferred1_0 = ret[0];
1638
+ deferred1_1 = ret[1];
1639
+ return getStringFromWasm0(ret[0], ret[1]);
1262
1640
  } finally {
1263
- wasm.__wbindgen_add_to_stack_pointer(16);
1264
1641
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1265
1642
  }
1266
1643
  }
1267
1644
  /**
1268
- * Returns the [`Note`] represented as a string (same as `name`).
1269
- * @returns {string}
1270
- */
1271
- toString() {
1645
+ * Returns the notes as a space-separated string.
1646
+ * @returns {string}
1647
+ */
1648
+ notesString() {
1272
1649
  let deferred1_0;
1273
1650
  let deferred1_1;
1274
1651
  try {
1275
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1276
- wasm.kordnote_toString(retptr, this.__wbg_ptr);
1277
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1278
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1279
- deferred1_0 = r0;
1280
- deferred1_1 = r1;
1281
- return getStringFromWasm0(r0, r1);
1652
+ const ret = wasm.kordscalecandidate_notesString(this.__wbg_ptr);
1653
+ deferred1_0 = ret[0];
1654
+ deferred1_1 = ret[1];
1655
+ return getStringFromWasm0(ret[0], ret[1]);
1282
1656
  } finally {
1283
- wasm.__wbindgen_add_to_stack_pointer(16);
1284
1657
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1285
1658
  }
1286
1659
  }
1287
1660
  /**
1288
- * Returns the [`Note`]'s [`NamedPitch`].
1289
- * @returns {string}
1290
- */
1291
- pitch() {
1661
+ * Returns the clone of the [`KordScaleCandidate`].
1662
+ * @returns {KordScaleCandidate}
1663
+ */
1664
+ copy() {
1665
+ const ret = wasm.kordscalecandidate_copy(this.__wbg_ptr);
1666
+ return KordScaleCandidate.__wrap(ret);
1667
+ }
1668
+ /**
1669
+ * Returns the name of the scale or mode.
1670
+ * @returns {string}
1671
+ */
1672
+ name() {
1292
1673
  let deferred1_0;
1293
1674
  let deferred1_1;
1294
1675
  try {
1295
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1296
- wasm.kordnote_pitch(retptr, this.__wbg_ptr);
1297
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1298
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1299
- deferred1_0 = r0;
1300
- deferred1_1 = r1;
1301
- return getStringFromWasm0(r0, r1);
1676
+ const ret = wasm.kordscalecandidate_name(this.__wbg_ptr);
1677
+ deferred1_0 = ret[0];
1678
+ deferred1_1 = ret[1];
1679
+ return getStringFromWasm0(ret[0], ret[1]);
1302
1680
  } finally {
1303
- wasm.__wbindgen_add_to_stack_pointer(16);
1304
1681
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1305
1682
  }
1306
1683
  }
1307
1684
  /**
1308
- * Returns the [`Note`]'s [`Octave`].
1309
- * @returns {number}
1310
- */
1311
- octave() {
1312
- const ret = wasm.kordnote_octave(this.__wbg_ptr);
1685
+ * Returns the candidate's rank (1 = most relevant).
1686
+ * @returns {number}
1687
+ */
1688
+ rank() {
1689
+ const ret = wasm.kordscalecandidate_rank(this.__wbg_ptr);
1313
1690
  return ret;
1314
1691
  }
1315
1692
  /**
1316
- * Returns the [`Note`]'s frequency.
1317
- * @returns {number}
1318
- */
1319
- frequency() {
1320
- const ret = wasm.kordnote_frequency(this.__wbg_ptr);
1693
+ * Returns the notes of this scale/mode rooted at the chord's root.
1694
+ * @returns {Array<any>}
1695
+ */
1696
+ notes() {
1697
+ const ret = wasm.kordscalecandidate_notes(this.__wbg_ptr);
1321
1698
  return ret;
1322
1699
  }
1323
1700
  /**
1324
- * Adds the given interval to the [`Note`], producing a new [`Note`] instance.
1325
- * @param {KordInterval} interval
1326
- * @returns {KordNote}
1327
- */
1328
- addInterval(interval) {
1329
- const ret = wasm.kordnote_addInterval(this.__wbg_ptr, interval);
1330
- return KordNote.__wrap(ret);
1331
- }
1332
- /**
1333
- * Subtracts the given interval from the [`Note`], producing a new [`Note`] instance.
1334
- * @param {KordInterval} interval
1335
- * @returns {KordNote}
1336
- */
1337
- subInterval(interval) {
1338
- const ret = wasm.kordnote_subInterval(this.__wbg_ptr, interval);
1339
- return KordNote.__wrap(ret);
1340
- }
1341
- /**
1342
- * Computes the [`Interval`] distance between the [`Note`] and the given [`Note`].
1343
- * @param {KordNote} other
1344
- * @returns {KordInterval}
1345
- */
1346
- distanceTo(other) {
1347
- _assertClass(other, KordNote);
1348
- var ptr0 = other.__destroy_into_raw();
1349
- const ret = wasm.kordnote_distanceTo(this.__wbg_ptr, ptr0);
1350
- return ret;
1701
+ * Returns the reason why this scale/mode fits the chord.
1702
+ * @returns {string}
1703
+ */
1704
+ reason() {
1705
+ let deferred1_0;
1706
+ let deferred1_1;
1707
+ try {
1708
+ const ret = wasm.kordscalecandidate_reason(this.__wbg_ptr);
1709
+ deferred1_0 = ret[0];
1710
+ deferred1_1 = ret[1];
1711
+ return getStringFromWasm0(ret[0], ret[1]);
1712
+ } finally {
1713
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1714
+ }
1351
1715
  }
1352
1716
  /**
1353
- * Returns the primary (first 13) harmonic series of the [`Note`].
1354
- * @returns {Array<any>}
1355
- */
1356
- harmonicSeries() {
1357
- const ret = wasm.kordnote_harmonicSeries(this.__wbg_ptr);
1358
- return takeObject(ret);
1717
+ * Returns whether this is a mode candidate (vs. scale candidate).
1718
+ * @returns {boolean}
1719
+ */
1720
+ isMode() {
1721
+ const ret = wasm.kordscalecandidate_isMode(this.__wbg_ptr);
1722
+ return ret !== 0;
1359
1723
  }
1360
1724
  /**
1361
- * Returns the clone of the [`Note`].
1362
- * @returns {KordNote}
1363
- */
1364
- copy() {
1365
- const ret = wasm.kordnote_copy(this.__wbg_ptr);
1366
- return KordNote.__wrap(ret);
1367
- }
1368
- }
1369
- /**
1370
- * A handle to a [`Chord`] playback.
1371
- *
1372
- * Should be dropped to stop the playback, or after playback is finished.
1373
- */
1374
- export class KordPlaybackHandle {
1375
-
1376
- __destroy_into_raw() {
1377
- const ptr = this.__wbg_ptr;
1378
- this.__wbg_ptr = 0;
1379
-
1380
- return ptr;
1381
- }
1382
-
1383
- free() {
1384
- const ptr = this.__destroy_into_raw();
1385
- wasm.__wbg_kordplaybackhandle_free(ptr);
1725
+ * Returns whether this is a scale candidate (vs. mode candidate).
1726
+ * @returns {boolean}
1727
+ */
1728
+ isScale() {
1729
+ const ret = wasm.kordscalecandidate_isScale(this.__wbg_ptr);
1730
+ return ret !== 0;
1386
1731
  }
1387
1732
  }
1388
1733
 
1389
- export function __wbindgen_object_drop_ref(arg0) {
1390
- takeObject(arg0);
1391
- };
1392
-
1393
- export function __wbindgen_cb_drop(arg0) {
1394
- const obj = takeObject(arg0).original;
1395
- if (obj.cnt-- == 1) {
1396
- obj.a = 0;
1397
- return true;
1398
- }
1399
- const ret = false;
1734
+ export function __wbg_call_672a4d21634d4a24() { return handleError(function (arg0, arg1) {
1735
+ const ret = arg0.call(arg1);
1400
1736
  return ret;
1401
- };
1402
-
1403
- export function __wbindgen_string_new(arg0, arg1) {
1404
- const ret = getStringFromWasm0(arg0, arg1);
1405
- return addHeapObject(ret);
1406
- };
1407
-
1408
- export function __wbindgen_number_get(arg0, arg1) {
1409
- const obj = getObject(arg1);
1410
- const ret = typeof(obj) === 'number' ? obj : undefined;
1411
- getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
1412
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
1413
- };
1414
-
1415
- export function __wbg_kordchord_new(arg0) {
1416
- const ret = KordChord.__wrap(arg0);
1417
- return addHeapObject(ret);
1418
- };
1419
-
1420
- export function __wbg_kordnote_new(arg0) {
1421
- const ret = KordNote.__wrap(arg0);
1422
- return addHeapObject(ret);
1423
- };
1737
+ }, arguments) };
1424
1738
 
1425
- export function __wbindgen_number_new(arg0) {
1426
- const ret = arg0;
1427
- return addHeapObject(ret);
1428
- };
1739
+ export function __wbg_call_7cccdd69e0791ae2() { return handleError(function (arg0, arg1, arg2) {
1740
+ const ret = arg0.call(arg1, arg2);
1741
+ return ret;
1742
+ }, arguments) };
1429
1743
 
1430
- export function __wbg_clearTimeout_76877dbc010e786d(arg0) {
1431
- const ret = clearTimeout(takeObject(arg0));
1432
- return addHeapObject(ret);
1744
+ export function __wbg_clearTimeout_5a54f8841c30079a(arg0) {
1745
+ const ret = clearTimeout(arg0);
1746
+ return ret;
1433
1747
  };
1434
1748
 
1435
- export function __wbg_setTimeout_75cb9b6991a4031d() { return handleError(function (arg0, arg1) {
1436
- const ret = setTimeout(getObject(arg0), arg1);
1437
- return addHeapObject(ret);
1749
+ export function __wbg_close_5a97ef05b337f8ce() { return handleError(function (arg0) {
1750
+ const ret = arg0.close();
1751
+ return ret;
1438
1752
  }, arguments) };
1439
1753
 
1440
- export function __wbg_crypto_58f13aa23ffcb166(arg0) {
1441
- const ret = getObject(arg0).crypto;
1442
- return addHeapObject(ret);
1443
- };
1754
+ export function __wbg_connect_b22945d106632a36() { return handleError(function (arg0, arg1) {
1755
+ const ret = arg0.connect(arg1);
1756
+ return ret;
1757
+ }, arguments) };
1444
1758
 
1445
- export function __wbindgen_is_object(arg0) {
1446
- const val = getObject(arg0);
1447
- const ret = typeof(val) === 'object' && val !== null;
1759
+ export function __wbg_constructor_9fd96f589d65d4e5(arg0) {
1760
+ const ret = arg0.constructor;
1448
1761
  return ret;
1449
1762
  };
1450
1763
 
1451
- export function __wbg_process_5b786e71d465a513(arg0) {
1452
- const ret = getObject(arg0).process;
1453
- return addHeapObject(ret);
1454
- };
1764
+ export function __wbg_copyToChannel_b81ecf19fd54e146() { return handleError(function (arg0, arg1, arg2, arg3) {
1765
+ arg0.copyToChannel(getArrayF32FromWasm0(arg1, arg2), arg3);
1766
+ }, arguments) };
1455
1767
 
1456
- export function __wbg_versions_c2ab80650590b6a2(arg0) {
1457
- const ret = getObject(arg0).versions;
1458
- return addHeapObject(ret);
1459
- };
1768
+ export function __wbg_createBufferSource_f7860a96f709acbd() { return handleError(function (arg0) {
1769
+ const ret = arg0.createBufferSource();
1770
+ return ret;
1771
+ }, arguments) };
1460
1772
 
1461
- export function __wbg_node_523d7bd03ef69fba(arg0) {
1462
- const ret = getObject(arg0).node;
1463
- return addHeapObject(ret);
1464
- };
1773
+ export function __wbg_createBuffer_926beeec3ff39b5a() { return handleError(function (arg0, arg1, arg2, arg3) {
1774
+ const ret = arg0.createBuffer(arg1 >>> 0, arg2 >>> 0, arg3);
1775
+ return ret;
1776
+ }, arguments) };
1465
1777
 
1466
- export function __wbindgen_is_string(arg0) {
1467
- const ret = typeof(getObject(arg0)) === 'string';
1778
+ export function __wbg_currentTime_adef4d803f58eb66(arg0) {
1779
+ const ret = arg0.currentTime;
1468
1780
  return ret;
1469
1781
  };
1470
1782
 
1471
- export function __wbg_msCrypto_abcb1295e768d1f2(arg0) {
1472
- const ret = getObject(arg0).msCrypto;
1473
- return addHeapObject(ret);
1783
+ export function __wbg_destination_6400091abd6f01b3(arg0) {
1784
+ const ret = arg0.destination;
1785
+ return ret;
1474
1786
  };
1475
1787
 
1476
- export function __wbg_require_2784e593a4674877() { return handleError(function () {
1477
- const ret = module.require;
1478
- return addHeapObject(ret);
1788
+ export function __wbg_get_67b2ba62fc30de12() { return handleError(function (arg0, arg1) {
1789
+ const ret = Reflect.get(arg0, arg1);
1790
+ return ret;
1479
1791
  }, arguments) };
1480
1792
 
1481
- export function __wbindgen_is_function(arg0) {
1482
- const ret = typeof(getObject(arg0)) === 'function';
1793
+ export function __wbg_get_b9b93047fe3cf45b(arg0, arg1) {
1794
+ const ret = arg0[arg1 >>> 0];
1483
1795
  return ret;
1484
1796
  };
1485
1797
 
1486
- export function __wbg_randomFillSync_a0d98aa11c81fe89() { return handleError(function (arg0, arg1) {
1487
- getObject(arg0).randomFillSync(takeObject(arg1));
1488
- }, arguments) };
1489
-
1490
- export function __wbg_getRandomValues_504510b5564925af() { return handleError(function (arg0, arg1) {
1491
- getObject(arg0).getRandomValues(getObject(arg1));
1492
- }, arguments) };
1493
-
1494
- export function __wbindgen_boolean_get(arg0) {
1495
- const v = getObject(arg0);
1496
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1798
+ export function __wbg_instanceof_Object_7f2dcef8f78644a4(arg0) {
1799
+ let result;
1800
+ try {
1801
+ result = arg0 instanceof Object;
1802
+ } catch (_) {
1803
+ result = false;
1804
+ }
1805
+ const ret = result;
1497
1806
  return ret;
1498
1807
  };
1499
1808
 
1500
- export function __wbg_instanceof_Window_9029196b662bc42a(arg0) {
1809
+ export function __wbg_instanceof_Window_def73ea0955fc569(arg0) {
1501
1810
  let result;
1502
1811
  try {
1503
- result = getObject(arg0) instanceof Window;
1812
+ result = arg0 instanceof Window;
1504
1813
  } catch (_) {
1505
1814
  result = false;
1506
1815
  }
@@ -1508,269 +1817,241 @@ export function __wbg_instanceof_Window_9029196b662bc42a(arg0) {
1508
1817
  return ret;
1509
1818
  };
1510
1819
 
1511
- export function __wbg_setTimeout_eb1a0d116c26d9f6() { return handleError(function (arg0, arg1, arg2) {
1512
- const ret = getObject(arg0).setTimeout(getObject(arg1), arg2);
1820
+ export function __wbg_kordchord_new(arg0) {
1821
+ const ret = KordChord.__wrap(arg0);
1513
1822
  return ret;
1514
- }, arguments) };
1515
-
1516
- export function __wbg_destination_9e793cf556243084(arg0) {
1517
- const ret = getObject(arg0).destination;
1518
- return addHeapObject(ret);
1519
1823
  };
1520
1824
 
1521
- export function __wbg_currentTime_c6831b97750b898c(arg0) {
1522
- const ret = getObject(arg0).currentTime;
1825
+ export function __wbg_kordnote_new(arg0) {
1826
+ const ret = KordNote.__wrap(arg0);
1523
1827
  return ret;
1524
1828
  };
1525
1829
 
1526
- export function __wbg_newwithcontextoptions_3fb88aa326cd01e0() { return handleError(function (arg0) {
1527
- const ret = new lAudioContext(getObject(arg0));
1528
- return addHeapObject(ret);
1529
- }, arguments) };
1530
-
1531
- export function __wbg_close_51aa5539747ce076() { return handleError(function (arg0) {
1532
- const ret = getObject(arg0).close();
1533
- return addHeapObject(ret);
1534
- }, arguments) };
1535
-
1536
- export function __wbg_createBuffer_13cd030d2b48e8fa() { return handleError(function (arg0, arg1, arg2, arg3) {
1537
- const ret = getObject(arg0).createBuffer(arg1 >>> 0, arg2 >>> 0, arg3);
1538
- return addHeapObject(ret);
1539
- }, arguments) };
1540
-
1541
- export function __wbg_createBufferSource_58423f6345b5f559() { return handleError(function (arg0) {
1542
- const ret = getObject(arg0).createBufferSource();
1543
- return addHeapObject(ret);
1544
- }, arguments) };
1545
-
1546
- export function __wbg_resume_9dc64ed7c3a65255() { return handleError(function (arg0) {
1547
- const ret = getObject(arg0).resume();
1548
- return addHeapObject(ret);
1549
- }, arguments) };
1550
-
1551
- export function __wbindgen_string_get(arg0, arg1) {
1552
- const obj = getObject(arg1);
1553
- const ret = typeof(obj) === 'string' ? obj : undefined;
1554
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1555
- var len1 = WASM_VECTOR_LEN;
1556
- getInt32Memory0()[arg0 / 4 + 1] = len1;
1557
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
1830
+ export function __wbg_kordscalecandidate_new(arg0) {
1831
+ const ret = KordScaleCandidate.__wrap(arg0);
1832
+ return ret;
1558
1833
  };
1559
1834
 
1560
- export function __wbg_copyToChannel_6e4bd2545a53db54() { return handleError(function (arg0, arg1, arg2, arg3) {
1561
- getObject(arg0).copyToChannel(getArrayF32FromWasm0(arg1, arg2), arg3);
1562
- }, arguments) };
1563
-
1564
- export function __wbg_setbuffer_beeece042e02534f(arg0, arg1) {
1565
- getObject(arg0).buffer = getObject(arg1);
1835
+ export function __wbg_length_e2d2a49132c1b256(arg0) {
1836
+ const ret = arg0.length;
1837
+ return ret;
1566
1838
  };
1567
1839
 
1568
- export function __wbg_setonended_83dd83b7f84cdef2(arg0, arg1) {
1569
- getObject(arg0).onended = getObject(arg1);
1840
+ export function __wbg_maxChannelCount_a06f8ca4190698ed(arg0) {
1841
+ const ret = arg0.maxChannelCount;
1842
+ return ret;
1570
1843
  };
1571
1844
 
1572
- export function __wbg_start_99ecc2647eb67ca6() { return handleError(function (arg0, arg1) {
1573
- getObject(arg0).start(arg1);
1574
- }, arguments) };
1575
-
1576
- export function __wbg_connect_3f8f5ba805800c62() { return handleError(function (arg0, arg1) {
1577
- const ret = getObject(arg0).connect(getObject(arg1));
1578
- return addHeapObject(ret);
1579
- }, arguments) };
1845
+ export function __wbg_name_16617c8e9d4188ac(arg0) {
1846
+ const ret = arg0.name;
1847
+ return ret;
1848
+ };
1580
1849
 
1581
- export function __wbg_get_f01601b5a68d10e3(arg0, arg1) {
1582
- const ret = getObject(arg0)[arg1 >>> 0];
1583
- return addHeapObject(ret);
1850
+ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
1851
+ try {
1852
+ var state0 = {a: arg0, b: arg1};
1853
+ var cb0 = (arg0, arg1) => {
1854
+ const a = state0.a;
1855
+ state0.a = 0;
1856
+ try {
1857
+ return __wbg_adapter_186(a, state0.b, arg0, arg1);
1858
+ } finally {
1859
+ state0.a = a;
1860
+ }
1861
+ };
1862
+ const ret = new Promise(cb0);
1863
+ return ret;
1864
+ } finally {
1865
+ state0.a = state0.b = 0;
1866
+ }
1584
1867
  };
1585
1868
 
1586
- export function __wbg_length_1009b1af0c481d7b(arg0) {
1587
- const ret = getObject(arg0).length;
1869
+ export function __wbg_new_405e22f390576ce2() {
1870
+ const ret = new Object();
1588
1871
  return ret;
1589
1872
  };
1590
1873
 
1591
- export function __wbg_new_ffc6d4d085022169() {
1874
+ export function __wbg_new_78feb108b6472713() {
1592
1875
  const ret = new Array();
1593
- return addHeapObject(ret);
1876
+ return ret;
1594
1877
  };
1595
1878
 
1596
- export function __wbg_newnoargs_c62ea9419c21fbac(arg0, arg1) {
1879
+ export function __wbg_newnoargs_105ed471475aaf50(arg0, arg1) {
1597
1880
  const ret = new Function(getStringFromWasm0(arg0, arg1));
1598
- return addHeapObject(ret);
1881
+ return ret;
1599
1882
  };
1600
1883
 
1601
- export function __wbg_get_7b48513de5dc5ea4() { return handleError(function (arg0, arg1) {
1602
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
1603
- return addHeapObject(ret);
1884
+ export function __wbg_newwithcontextoptions_b62c06fed7900366() { return handleError(function (arg0) {
1885
+ const ret = new lAudioContext(arg0);
1886
+ return ret;
1604
1887
  }, arguments) };
1605
1888
 
1606
- export function __wbg_call_90c26b09837aba1c() { return handleError(function (arg0, arg1) {
1607
- const ret = getObject(arg0).call(getObject(arg1));
1608
- return addHeapObject(ret);
1609
- }, arguments) };
1889
+ export function __wbg_push_737cfc8c1432c2c6(arg0, arg1) {
1890
+ const ret = arg0.push(arg1);
1891
+ return ret;
1892
+ };
1610
1893
 
1611
- export function __wbg_new_9fb8d994e1c0aaac() {
1612
- const ret = new Object();
1613
- return addHeapObject(ret);
1894
+ export function __wbg_queueMicrotask_97d92b4fcc8a61c5(arg0) {
1895
+ queueMicrotask(arg0);
1614
1896
  };
1615
1897
 
1616
- export function __wbindgen_object_clone_ref(arg0) {
1617
- const ret = getObject(arg0);
1618
- return addHeapObject(ret);
1898
+ export function __wbg_queueMicrotask_d3219def82552485(arg0) {
1899
+ const ret = arg0.queueMicrotask;
1900
+ return ret;
1619
1901
  };
1620
1902
 
1621
- export function __wbg_self_f0e34d89f33b99fd() { return handleError(function () {
1622
- const ret = self.self;
1623
- return addHeapObject(ret);
1624
- }, arguments) };
1903
+ export function __wbg_resolve_4851785c9c5f573d(arg0) {
1904
+ const ret = Promise.resolve(arg0);
1905
+ return ret;
1906
+ };
1625
1907
 
1626
- export function __wbg_window_d3b084224f4774d7() { return handleError(function () {
1627
- const ret = window.window;
1628
- return addHeapObject(ret);
1908
+ export function __wbg_resume_35efdc4ffe13bf18() { return handleError(function (arg0) {
1909
+ const ret = arg0.resume();
1910
+ return ret;
1629
1911
  }, arguments) };
1630
1912
 
1631
- export function __wbg_globalThis_9caa27ff917c6860() { return handleError(function () {
1632
- const ret = globalThis.globalThis;
1633
- return addHeapObject(ret);
1913
+ export function __wbg_setTimeout_db2dbaeefb6f39c7() { return handleError(function (arg0, arg1) {
1914
+ const ret = setTimeout(arg0, arg1);
1915
+ return ret;
1634
1916
  }, arguments) };
1635
1917
 
1636
- export function __wbg_global_35dfdd59a4da3e74() { return handleError(function () {
1637
- const ret = global.global;
1638
- return addHeapObject(ret);
1918
+ export function __wbg_setTimeout_f2fe5af8e3debeb3() { return handleError(function (arg0, arg1, arg2) {
1919
+ const ret = arg0.setTimeout(arg1, arg2);
1920
+ return ret;
1639
1921
  }, arguments) };
1640
1922
 
1641
- export function __wbindgen_is_undefined(arg0) {
1642
- const ret = getObject(arg0) === undefined;
1643
- return ret;
1923
+ export function __wbg_setbuffer_10a9ee2a05c73896(arg0, arg1) {
1924
+ arg0.buffer = arg1;
1644
1925
  };
1645
1926
 
1646
- export function __wbg_eval_0b93354704a20351() { return handleError(function (arg0, arg1) {
1647
- const ret = eval(getStringFromWasm0(arg0, arg1));
1648
- return addHeapObject(ret);
1649
- }, arguments) };
1927
+ export function __wbg_setchannelCount_876fcf5798895180(arg0, arg1) {
1928
+ arg0.channelCount = arg1 >>> 0;
1929
+ };
1650
1930
 
1651
- export function __wbg_push_901f3914205d44de(arg0, arg1) {
1652
- const ret = getObject(arg0).push(getObject(arg1));
1653
- return ret;
1931
+ export function __wbg_setonended_00ff85c70a4f819f(arg0, arg1) {
1932
+ arg0.onended = arg1;
1933
+ };
1934
+
1935
+ export function __wbg_setsamplerate_8bc3fd769a6db02b(arg0, arg1) {
1936
+ arg0.sampleRate = arg1;
1654
1937
  };
1655
1938
 
1656
- export function __wbg_call_5da1969d7cd31ccd() { return handleError(function (arg0, arg1, arg2) {
1657
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1658
- return addHeapObject(ret);
1939
+ export function __wbg_start_e81f89e130c3c86e() { return handleError(function (arg0, arg1) {
1940
+ arg0.start(arg1);
1659
1941
  }, arguments) };
1660
1942
 
1661
- export function __wbg_name_0b0c238354bb6019(arg0) {
1662
- const ret = getObject(arg0).name;
1663
- return addHeapObject(ret);
1943
+ export function __wbg_static_accessor_GLOBAL_88a902d13a557d07() {
1944
+ const ret = typeof global === 'undefined' ? null : global;
1945
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1664
1946
  };
1665
1947
 
1666
- export function __wbg_instanceof_Object_702c4990f4c3db8d(arg0) {
1667
- let result;
1668
- try {
1669
- result = getObject(arg0) instanceof Object;
1670
- } catch (_) {
1671
- result = false;
1672
- }
1673
- const ret = result;
1674
- return ret;
1948
+ export function __wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0() {
1949
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1950
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1675
1951
  };
1676
1952
 
1677
- export function __wbg_constructor_2cc2b72dddc41594(arg0) {
1678
- const ret = getObject(arg0).constructor;
1679
- return addHeapObject(ret);
1953
+ export function __wbg_static_accessor_SELF_37c5d418e4bf5819() {
1954
+ const ret = typeof self === 'undefined' ? null : self;
1955
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1680
1956
  };
1681
1957
 
1682
- export function __wbg_new_60f57089c7563e81(arg0, arg1) {
1683
- try {
1684
- var state0 = {a: arg0, b: arg1};
1685
- var cb0 = (arg0, arg1) => {
1686
- const a = state0.a;
1687
- state0.a = 0;
1688
- try {
1689
- return __wbg_adapter_176(a, state0.b, arg0, arg1);
1690
- } finally {
1691
- state0.a = a;
1692
- }
1693
- };
1694
- const ret = new Promise(cb0);
1695
- return addHeapObject(ret);
1696
- } finally {
1697
- state0.a = state0.b = 0;
1698
- }
1958
+ export function __wbg_static_accessor_WINDOW_5de37043a91a9c40() {
1959
+ const ret = typeof window === 'undefined' ? null : window;
1960
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1699
1961
  };
1700
1962
 
1701
- export function __wbg_resolve_6e1c6553a82f85b7(arg0) {
1702
- const ret = Promise.resolve(getObject(arg0));
1703
- return addHeapObject(ret);
1963
+ export function __wbg_then_44b73946d2fb3e7d(arg0, arg1) {
1964
+ const ret = arg0.then(arg1);
1965
+ return ret;
1704
1966
  };
1705
1967
 
1706
- export function __wbg_then_3ab08cd4fbb91ae9(arg0, arg1) {
1707
- const ret = getObject(arg0).then(getObject(arg1));
1708
- return addHeapObject(ret);
1968
+ export function __wbindgen_boolean_get(arg0) {
1969
+ const v = arg0;
1970
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1971
+ return ret;
1709
1972
  };
1710
1973
 
1711
- export function __wbg_buffer_a448f833075b71ba(arg0) {
1712
- const ret = getObject(arg0).buffer;
1713
- return addHeapObject(ret);
1974
+ export function __wbindgen_cb_drop(arg0) {
1975
+ const obj = arg0.original;
1976
+ if (obj.cnt-- == 1) {
1977
+ obj.a = 0;
1978
+ return true;
1979
+ }
1980
+ const ret = false;
1981
+ return ret;
1714
1982
  };
1715
1983
 
1716
- export function __wbg_newwithbyteoffsetandlength_d0482f893617af71(arg0, arg1, arg2) {
1717
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
1718
- return addHeapObject(ret);
1984
+ export function __wbindgen_closure_wrapper2001(arg0, arg1, arg2) {
1985
+ const ret = makeMutClosure(arg0, arg1, 543, __wbg_adapter_28);
1986
+ return ret;
1719
1987
  };
1720
1988
 
1721
- export function __wbg_new_8f67e318f15d7254(arg0) {
1722
- const ret = new Uint8Array(getObject(arg0));
1723
- return addHeapObject(ret);
1989
+ export function __wbindgen_closure_wrapper2493(arg0, arg1, arg2) {
1990
+ const ret = makeMutClosure(arg0, arg1, 657, __wbg_adapter_31);
1991
+ return ret;
1724
1992
  };
1725
1993
 
1726
- export function __wbg_set_2357bf09366ee480(arg0, arg1, arg2) {
1727
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
1994
+ export function __wbindgen_closure_wrapper2665(arg0, arg1, arg2) {
1995
+ const ret = makeMutClosure(arg0, arg1, 727, __wbg_adapter_34);
1996
+ return ret;
1728
1997
  };
1729
1998
 
1730
- export function __wbg_newwithlength_6c2df9e2f3028c43(arg0) {
1731
- const ret = new Uint8Array(arg0 >>> 0);
1732
- return addHeapObject(ret);
1999
+ export function __wbindgen_debug_string(arg0, arg1) {
2000
+ const ret = debugString(arg1);
2001
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2002
+ const len1 = WASM_VECTOR_LEN;
2003
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2004
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1733
2005
  };
1734
2006
 
1735
- export function __wbg_subarray_2e940e41c0f5a1d9(arg0, arg1, arg2) {
1736
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
1737
- return addHeapObject(ret);
2007
+ export function __wbindgen_init_externref_table() {
2008
+ const table = wasm.__wbindgen_export_2;
2009
+ const offset = table.grow(4);
2010
+ table.set(0, undefined);
2011
+ table.set(offset + 0, undefined);
2012
+ table.set(offset + 1, null);
2013
+ table.set(offset + 2, true);
2014
+ table.set(offset + 3, false);
2015
+ ;
1738
2016
  };
1739
2017
 
1740
- export function __wbg_set_759f75cd92b612d2() { return handleError(function (arg0, arg1, arg2) {
1741
- const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
2018
+ export function __wbindgen_is_falsy(arg0) {
2019
+ const ret = !arg0;
1742
2020
  return ret;
1743
- }, arguments) };
2021
+ };
1744
2022
 
1745
- export function __wbindgen_debug_string(arg0, arg1) {
1746
- const ret = debugString(getObject(arg1));
1747
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1748
- const len1 = WASM_VECTOR_LEN;
1749
- getInt32Memory0()[arg0 / 4 + 1] = len1;
1750
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
2023
+ export function __wbindgen_is_function(arg0) {
2024
+ const ret = typeof(arg0) === 'function';
2025
+ return ret;
1751
2026
  };
1752
2027
 
1753
- export function __wbindgen_throw(arg0, arg1) {
1754
- throw new Error(getStringFromWasm0(arg0, arg1));
2028
+ export function __wbindgen_is_undefined(arg0) {
2029
+ const ret = arg0 === undefined;
2030
+ return ret;
1755
2031
  };
1756
2032
 
1757
- export function __wbindgen_memory() {
1758
- const ret = wasm.memory;
1759
- return addHeapObject(ret);
2033
+ export function __wbindgen_number_get(arg0, arg1) {
2034
+ const obj = arg1;
2035
+ const ret = typeof(obj) === 'number' ? obj : undefined;
2036
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
2037
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1760
2038
  };
1761
2039
 
1762
- export function __wbindgen_closure_wrapper1192(arg0, arg1, arg2) {
1763
- const ret = makeMutClosure(arg0, arg1, 510, __wbg_adapter_32);
1764
- return addHeapObject(ret);
2040
+ export function __wbindgen_string_get(arg0, arg1) {
2041
+ const obj = arg1;
2042
+ const ret = typeof(obj) === 'string' ? obj : undefined;
2043
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2044
+ var len1 = WASM_VECTOR_LEN;
2045
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2046
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1765
2047
  };
1766
2048
 
1767
- export function __wbindgen_closure_wrapper1218(arg0, arg1, arg2) {
1768
- const ret = makeMutClosure(arg0, arg1, 523, __wbg_adapter_35);
1769
- return addHeapObject(ret);
2049
+ export function __wbindgen_string_new(arg0, arg1) {
2050
+ const ret = getStringFromWasm0(arg0, arg1);
2051
+ return ret;
1770
2052
  };
1771
2053
 
1772
- export function __wbindgen_closure_wrapper1562(arg0, arg1, arg2) {
1773
- const ret = makeMutClosure(arg0, arg1, 631, __wbg_adapter_38);
1774
- return addHeapObject(ret);
2054
+ export function __wbindgen_throw(arg0, arg1) {
2055
+ throw new Error(getStringFromWasm0(arg0, arg1));
1775
2056
  };
1776
2057