kordweb 0.5.19 → 0.6.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/README.md +2 -3
- package/klib.d.ts +55 -162
- package/klib.js +4 -1697
- package/klib_bg.js +1636 -0
- package/klib_bg.wasm +0 -0
- package/package.json +3 -1
package/klib_bg.js
ADDED
|
@@ -0,0 +1,1636 @@
|
|
|
1
|
+
const lAudioContext = (typeof AudioContext !== 'undefined' ? AudioContext : (typeof webkitAudioContext !== 'undefined' ? webkitAudioContext : undefined));
|
|
2
|
+
let wasm;
|
|
3
|
+
export function __wbg_set_wasm(val) {
|
|
4
|
+
wasm = val;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
const heap = new Array(128).fill(undefined);
|
|
9
|
+
|
|
10
|
+
heap.push(undefined, null, true, false);
|
|
11
|
+
|
|
12
|
+
function getObject(idx) { return heap[idx]; }
|
|
13
|
+
|
|
14
|
+
let heap_next = heap.length;
|
|
15
|
+
|
|
16
|
+
function dropObject(idx) {
|
|
17
|
+
if (idx < 132) return;
|
|
18
|
+
heap[idx] = heap_next;
|
|
19
|
+
heap_next = idx;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function takeObject(idx) {
|
|
23
|
+
const ret = getObject(idx);
|
|
24
|
+
dropObject(idx);
|
|
25
|
+
return ret;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
|
|
29
|
+
|
|
30
|
+
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
31
|
+
|
|
32
|
+
cachedTextDecoder.decode();
|
|
33
|
+
|
|
34
|
+
let cachedUint8Memory0 = null;
|
|
35
|
+
|
|
36
|
+
function getUint8Memory0() {
|
|
37
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
38
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
39
|
+
}
|
|
40
|
+
return cachedUint8Memory0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function getStringFromWasm0(ptr, len) {
|
|
44
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function addHeapObject(obj) {
|
|
48
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
49
|
+
const idx = heap_next;
|
|
50
|
+
heap_next = heap[idx];
|
|
51
|
+
|
|
52
|
+
heap[idx] = obj;
|
|
53
|
+
return idx;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function isLikeNone(x) {
|
|
57
|
+
return x === undefined || x === null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
let cachedFloat64Memory0 = null;
|
|
61
|
+
|
|
62
|
+
function getFloat64Memory0() {
|
|
63
|
+
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
64
|
+
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
65
|
+
}
|
|
66
|
+
return cachedFloat64Memory0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
let cachedInt32Memory0 = null;
|
|
70
|
+
|
|
71
|
+
function getInt32Memory0() {
|
|
72
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
73
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
74
|
+
}
|
|
75
|
+
return cachedInt32Memory0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
let WASM_VECTOR_LEN = 0;
|
|
79
|
+
|
|
80
|
+
const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
|
|
81
|
+
|
|
82
|
+
let cachedTextEncoder = new lTextEncoder('utf-8');
|
|
83
|
+
|
|
84
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
85
|
+
? function (arg, view) {
|
|
86
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
87
|
+
}
|
|
88
|
+
: function (arg, view) {
|
|
89
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
90
|
+
view.set(buf);
|
|
91
|
+
return {
|
|
92
|
+
read: arg.length,
|
|
93
|
+
written: buf.length
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
98
|
+
|
|
99
|
+
if (realloc === undefined) {
|
|
100
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
101
|
+
const ptr = malloc(buf.length);
|
|
102
|
+
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
103
|
+
WASM_VECTOR_LEN = buf.length;
|
|
104
|
+
return ptr;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
let len = arg.length;
|
|
108
|
+
let ptr = malloc(len);
|
|
109
|
+
|
|
110
|
+
const mem = getUint8Memory0();
|
|
111
|
+
|
|
112
|
+
let offset = 0;
|
|
113
|
+
|
|
114
|
+
for (; offset < len; offset++) {
|
|
115
|
+
const code = arg.charCodeAt(offset);
|
|
116
|
+
if (code > 0x7F) break;
|
|
117
|
+
mem[ptr + offset] = code;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (offset !== len) {
|
|
121
|
+
if (offset !== 0) {
|
|
122
|
+
arg = arg.slice(offset);
|
|
123
|
+
}
|
|
124
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3);
|
|
125
|
+
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
126
|
+
const ret = encodeString(arg, view);
|
|
127
|
+
|
|
128
|
+
offset += ret.written;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
WASM_VECTOR_LEN = offset;
|
|
132
|
+
return ptr;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function debugString(val) {
|
|
136
|
+
// primitive types
|
|
137
|
+
const type = typeof val;
|
|
138
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
139
|
+
return `${val}`;
|
|
140
|
+
}
|
|
141
|
+
if (type == 'string') {
|
|
142
|
+
return `"${val}"`;
|
|
143
|
+
}
|
|
144
|
+
if (type == 'symbol') {
|
|
145
|
+
const description = val.description;
|
|
146
|
+
if (description == null) {
|
|
147
|
+
return 'Symbol';
|
|
148
|
+
} else {
|
|
149
|
+
return `Symbol(${description})`;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (type == 'function') {
|
|
153
|
+
const name = val.name;
|
|
154
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
155
|
+
return `Function(${name})`;
|
|
156
|
+
} else {
|
|
157
|
+
return 'Function';
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
// objects
|
|
161
|
+
if (Array.isArray(val)) {
|
|
162
|
+
const length = val.length;
|
|
163
|
+
let debug = '[';
|
|
164
|
+
if (length > 0) {
|
|
165
|
+
debug += debugString(val[0]);
|
|
166
|
+
}
|
|
167
|
+
for(let i = 1; i < length; i++) {
|
|
168
|
+
debug += ', ' + debugString(val[i]);
|
|
169
|
+
}
|
|
170
|
+
debug += ']';
|
|
171
|
+
return debug;
|
|
172
|
+
}
|
|
173
|
+
// Test for built-in
|
|
174
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
175
|
+
let className;
|
|
176
|
+
if (builtInMatches.length > 1) {
|
|
177
|
+
className = builtInMatches[1];
|
|
178
|
+
} else {
|
|
179
|
+
// Failed to match the standard '[object ClassName]'
|
|
180
|
+
return toString.call(val);
|
|
181
|
+
}
|
|
182
|
+
if (className == 'Object') {
|
|
183
|
+
// we're a user defined class or Object
|
|
184
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
185
|
+
// easier than looping through ownProperties of `val`.
|
|
186
|
+
try {
|
|
187
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
188
|
+
} catch (_) {
|
|
189
|
+
return 'Object';
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
// errors
|
|
193
|
+
if (val instanceof Error) {
|
|
194
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
195
|
+
}
|
|
196
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
197
|
+
return className;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
201
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
202
|
+
const real = (...args) => {
|
|
203
|
+
// First up with a closure we increment the internal reference
|
|
204
|
+
// count. This ensures that the Rust closure environment won't
|
|
205
|
+
// be deallocated while we're invoking it.
|
|
206
|
+
state.cnt++;
|
|
207
|
+
const a = state.a;
|
|
208
|
+
state.a = 0;
|
|
209
|
+
try {
|
|
210
|
+
return f(a, state.b, ...args);
|
|
211
|
+
} finally {
|
|
212
|
+
if (--state.cnt === 0) {
|
|
213
|
+
wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
|
|
214
|
+
|
|
215
|
+
} else {
|
|
216
|
+
state.a = a;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
real.original = state;
|
|
221
|
+
|
|
222
|
+
return real;
|
|
223
|
+
}
|
|
224
|
+
function __wbg_adapter_24(arg0, arg1, arg2) {
|
|
225
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hd89e07a20df44f6c(arg0, arg1, addHeapObject(arg2));
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function __wbg_adapter_27(arg0, arg1) {
|
|
229
|
+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4320fa94c250e6e8(arg0, arg1);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function __wbg_adapter_30(arg0, arg1) {
|
|
233
|
+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb0a694f6559bced1(arg0, arg1);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
let cachedFloat32Memory0 = null;
|
|
237
|
+
|
|
238
|
+
function getFloat32Memory0() {
|
|
239
|
+
if (cachedFloat32Memory0 === null || cachedFloat32Memory0.byteLength === 0) {
|
|
240
|
+
cachedFloat32Memory0 = new Float32Array(wasm.memory.buffer);
|
|
241
|
+
}
|
|
242
|
+
return cachedFloat32Memory0;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function passArrayF32ToWasm0(arg, malloc) {
|
|
246
|
+
const ptr = malloc(arg.length * 4);
|
|
247
|
+
getFloat32Memory0().set(arg, ptr / 4);
|
|
248
|
+
WASM_VECTOR_LEN = arg.length;
|
|
249
|
+
return ptr;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function _assertClass(instance, klass) {
|
|
253
|
+
if (!(instance instanceof klass)) {
|
|
254
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
255
|
+
}
|
|
256
|
+
return instance.ptr;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
function handleError(f, args) {
|
|
260
|
+
try {
|
|
261
|
+
return f.apply(this, args);
|
|
262
|
+
} catch (e) {
|
|
263
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function getArrayF32FromWasm0(ptr, len) {
|
|
268
|
+
return getFloat32Memory0().subarray(ptr / 4, ptr / 4 + len);
|
|
269
|
+
}
|
|
270
|
+
function __wbg_adapter_152(arg0, arg1, arg2, arg3) {
|
|
271
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h3d8a4431f50cb521(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* The chord modifiers.
|
|
276
|
+
*/
|
|
277
|
+
export const KordModifier = Object.freeze({
|
|
278
|
+
/**
|
|
279
|
+
* Minor modifier.
|
|
280
|
+
*/
|
|
281
|
+
Minor:0,"0":"Minor",
|
|
282
|
+
/**
|
|
283
|
+
* Flat 5 modifier.
|
|
284
|
+
*/
|
|
285
|
+
Flat5:1,"1":"Flat5",
|
|
286
|
+
/**
|
|
287
|
+
* Sharp 5 modifier.
|
|
288
|
+
*/
|
|
289
|
+
Augmented5:2,"2":"Augmented5",
|
|
290
|
+
/**
|
|
291
|
+
* Major 7 modifier.
|
|
292
|
+
*/
|
|
293
|
+
Major7:3,"3":"Major7",
|
|
294
|
+
/**
|
|
295
|
+
* Dominant 7 modifier.
|
|
296
|
+
*/
|
|
297
|
+
Dominant7:4,"4":"Dominant7",
|
|
298
|
+
/**
|
|
299
|
+
* Dominant 9 modifier.
|
|
300
|
+
*/
|
|
301
|
+
Dominant9:5,"5":"Dominant9",
|
|
302
|
+
/**
|
|
303
|
+
* Dominant 11 modifier.
|
|
304
|
+
*/
|
|
305
|
+
Dominant11:6,"6":"Dominant11",
|
|
306
|
+
/**
|
|
307
|
+
* Dominant 13 modifier.
|
|
308
|
+
*/
|
|
309
|
+
Dominant13:7,"7":"Dominant13",
|
|
310
|
+
/**
|
|
311
|
+
* Flat 9 modifier.
|
|
312
|
+
*/
|
|
313
|
+
Flat9:8,"8":"Flat9",
|
|
314
|
+
/**
|
|
315
|
+
* Sharp 9 modifier.
|
|
316
|
+
*/
|
|
317
|
+
Sharp9:9,"9":"Sharp9",
|
|
318
|
+
/**
|
|
319
|
+
* Sharp 11 modifier.
|
|
320
|
+
*/
|
|
321
|
+
Sharp11:10,"10":"Sharp11",
|
|
322
|
+
/**
|
|
323
|
+
* Diminished modifier.
|
|
324
|
+
*/
|
|
325
|
+
Diminished:11,"11":"Diminished", });
|
|
326
|
+
/**
|
|
327
|
+
* An enum representing the interval between two notes.
|
|
328
|
+
*/
|
|
329
|
+
export const KordInterval = Object.freeze({
|
|
330
|
+
/**
|
|
331
|
+
* A perfect unison interval.
|
|
332
|
+
*/
|
|
333
|
+
PerfectUnison:0,"0":"PerfectUnison",
|
|
334
|
+
/**
|
|
335
|
+
* A diminished second interval.
|
|
336
|
+
*/
|
|
337
|
+
DiminishedSecond:1,"1":"DiminishedSecond",
|
|
338
|
+
/**
|
|
339
|
+
* An augmented unison interval.
|
|
340
|
+
*/
|
|
341
|
+
AugmentedUnison:2,"2":"AugmentedUnison",
|
|
342
|
+
/**
|
|
343
|
+
* A minor second interval.
|
|
344
|
+
*/
|
|
345
|
+
MinorSecond:3,"3":"MinorSecond",
|
|
346
|
+
/**
|
|
347
|
+
* A major second interval.
|
|
348
|
+
*/
|
|
349
|
+
MajorSecond:4,"4":"MajorSecond",
|
|
350
|
+
/**
|
|
351
|
+
* A diminished third interval.
|
|
352
|
+
*/
|
|
353
|
+
DiminishedThird:5,"5":"DiminishedThird",
|
|
354
|
+
/**
|
|
355
|
+
* An augmented second interval.
|
|
356
|
+
*/
|
|
357
|
+
AugmentedSecond:6,"6":"AugmentedSecond",
|
|
358
|
+
/**
|
|
359
|
+
* A minor third interval.
|
|
360
|
+
*/
|
|
361
|
+
MinorThird:7,"7":"MinorThird",
|
|
362
|
+
/**
|
|
363
|
+
* A major third interval.
|
|
364
|
+
*/
|
|
365
|
+
MajorThird:8,"8":"MajorThird",
|
|
366
|
+
/**
|
|
367
|
+
* A diminished fourth interval.
|
|
368
|
+
*/
|
|
369
|
+
DiminishedFourth:9,"9":"DiminishedFourth",
|
|
370
|
+
/**
|
|
371
|
+
* An augmented third interval.
|
|
372
|
+
*/
|
|
373
|
+
AugmentedThird:10,"10":"AugmentedThird",
|
|
374
|
+
/**
|
|
375
|
+
* A perfect fourth interval.
|
|
376
|
+
*/
|
|
377
|
+
PerfectFourth:11,"11":"PerfectFourth",
|
|
378
|
+
/**
|
|
379
|
+
* An augmented fourth interval.
|
|
380
|
+
*/
|
|
381
|
+
AugmentedFourth:12,"12":"AugmentedFourth",
|
|
382
|
+
/**
|
|
383
|
+
* A diminished fifth interval.
|
|
384
|
+
*/
|
|
385
|
+
DiminishedFifth:13,"13":"DiminishedFifth",
|
|
386
|
+
/**
|
|
387
|
+
* A perfect fifth interval.
|
|
388
|
+
*/
|
|
389
|
+
PerfectFifth:14,"14":"PerfectFifth",
|
|
390
|
+
/**
|
|
391
|
+
* A diminished sixth interval.
|
|
392
|
+
*/
|
|
393
|
+
DiminishedSixth:15,"15":"DiminishedSixth",
|
|
394
|
+
/**
|
|
395
|
+
* An augmented fifth interval.
|
|
396
|
+
*/
|
|
397
|
+
AugmentedFifth:16,"16":"AugmentedFifth",
|
|
398
|
+
/**
|
|
399
|
+
* A minor sixth interval.
|
|
400
|
+
*/
|
|
401
|
+
MinorSixth:17,"17":"MinorSixth",
|
|
402
|
+
/**
|
|
403
|
+
* A major sixth interval.
|
|
404
|
+
*/
|
|
405
|
+
MajorSixth:18,"18":"MajorSixth",
|
|
406
|
+
/**
|
|
407
|
+
* A diminished seventh interval.
|
|
408
|
+
*/
|
|
409
|
+
DiminishedSeventh:19,"19":"DiminishedSeventh",
|
|
410
|
+
/**
|
|
411
|
+
* An augmented sixth interval.
|
|
412
|
+
*/
|
|
413
|
+
AugmentedSixth:20,"20":"AugmentedSixth",
|
|
414
|
+
/**
|
|
415
|
+
* A minor seventh interval.
|
|
416
|
+
*/
|
|
417
|
+
MinorSeventh:21,"21":"MinorSeventh",
|
|
418
|
+
/**
|
|
419
|
+
* A major seventh interval.
|
|
420
|
+
*/
|
|
421
|
+
MajorSeventh:22,"22":"MajorSeventh",
|
|
422
|
+
/**
|
|
423
|
+
* A diminished octave interval.
|
|
424
|
+
*/
|
|
425
|
+
DiminishedOctave:23,"23":"DiminishedOctave",
|
|
426
|
+
/**
|
|
427
|
+
* An augmented seventh interval.
|
|
428
|
+
*/
|
|
429
|
+
AugmentedSeventh:24,"24":"AugmentedSeventh",
|
|
430
|
+
/**
|
|
431
|
+
* A perfect octave interval.
|
|
432
|
+
*/
|
|
433
|
+
PerfectOctave:25,"25":"PerfectOctave",
|
|
434
|
+
/**
|
|
435
|
+
* An minor ninth interval.
|
|
436
|
+
*/
|
|
437
|
+
MinorNinth:26,"26":"MinorNinth",
|
|
438
|
+
/**
|
|
439
|
+
* A major ninth interval.
|
|
440
|
+
*/
|
|
441
|
+
MajorNinth:27,"27":"MajorNinth",
|
|
442
|
+
/**
|
|
443
|
+
* An augmented ninth interval.
|
|
444
|
+
*/
|
|
445
|
+
AugmentedNinth:28,"28":"AugmentedNinth",
|
|
446
|
+
/**
|
|
447
|
+
* A diminished eleventh interval.
|
|
448
|
+
*/
|
|
449
|
+
DiminishedEleventh:29,"29":"DiminishedEleventh",
|
|
450
|
+
/**
|
|
451
|
+
* A perfect eleventh interval.
|
|
452
|
+
*/
|
|
453
|
+
PerfectEleventh:30,"30":"PerfectEleventh",
|
|
454
|
+
/**
|
|
455
|
+
* An augmented eleventh interval.
|
|
456
|
+
*/
|
|
457
|
+
AugmentedEleventh:31,"31":"AugmentedEleventh",
|
|
458
|
+
/**
|
|
459
|
+
* A minor thirteenth interval.
|
|
460
|
+
*/
|
|
461
|
+
MinorThirteenth:32,"32":"MinorThirteenth",
|
|
462
|
+
/**
|
|
463
|
+
* A major thirteenth interval.
|
|
464
|
+
*/
|
|
465
|
+
MajorThirteenth:33,"33":"MajorThirteenth",
|
|
466
|
+
/**
|
|
467
|
+
* An augmented thirteenth interval.
|
|
468
|
+
*/
|
|
469
|
+
AugmentedThirteenth:34,"34":"AugmentedThirteenth",
|
|
470
|
+
/**
|
|
471
|
+
* A perfect octave and perfect fifth interval.
|
|
472
|
+
*/
|
|
473
|
+
PerfectOctaveAndPerfectFifth:35,"35":"PerfectOctaveAndPerfectFifth",
|
|
474
|
+
/**
|
|
475
|
+
* Two perfect octaves.
|
|
476
|
+
*/
|
|
477
|
+
TwoPerfectOctaves:36,"36":"TwoPerfectOctaves",
|
|
478
|
+
/**
|
|
479
|
+
* Two perfect octaves and a major third.
|
|
480
|
+
*/
|
|
481
|
+
TwoPerfectOctavesAndMajorThird:37,"37":"TwoPerfectOctavesAndMajorThird",
|
|
482
|
+
/**
|
|
483
|
+
* Two perfect octaves and a perfect fifth.
|
|
484
|
+
*/
|
|
485
|
+
TwoPerfectOctavesAndPerfectFifth:38,"38":"TwoPerfectOctavesAndPerfectFifth",
|
|
486
|
+
/**
|
|
487
|
+
* Two perfect octaves and a minor sixth.
|
|
488
|
+
*/
|
|
489
|
+
TwoPerfectOctavesAndMinorSeventh:39,"39":"TwoPerfectOctavesAndMinorSeventh",
|
|
490
|
+
/**
|
|
491
|
+
* Three perfect octaves.
|
|
492
|
+
*/
|
|
493
|
+
ThreePerfectOctaves:40,"40":"ThreePerfectOctaves",
|
|
494
|
+
/**
|
|
495
|
+
* Three perfect octaves and a major second.
|
|
496
|
+
*/
|
|
497
|
+
ThreePerfectOctavesAndMajorSecond:41,"41":"ThreePerfectOctavesAndMajorSecond",
|
|
498
|
+
/**
|
|
499
|
+
* Three perfect octaves and a major third.
|
|
500
|
+
*/
|
|
501
|
+
ThreePerfectOctavesAndMajorThird:42,"42":"ThreePerfectOctavesAndMajorThird",
|
|
502
|
+
/**
|
|
503
|
+
* Three perfect octaves and an augmented fourth.
|
|
504
|
+
*/
|
|
505
|
+
ThreePerfectOctavesAndAugmentedFourth:43,"43":"ThreePerfectOctavesAndAugmentedFourth",
|
|
506
|
+
/**
|
|
507
|
+
* Three perfect octaves and a perfect fifth.
|
|
508
|
+
*/
|
|
509
|
+
ThreePerfectOctavesAndPerfectFifth:44,"44":"ThreePerfectOctavesAndPerfectFifth",
|
|
510
|
+
/**
|
|
511
|
+
* Three perfect octaves and a minor sixth.
|
|
512
|
+
*/
|
|
513
|
+
ThreePerfectOctavesAndMinorSixth:45,"45":"ThreePerfectOctavesAndMinorSixth",
|
|
514
|
+
/**
|
|
515
|
+
* Three perfect octaves and a minor seventh.
|
|
516
|
+
*/
|
|
517
|
+
ThreePerfectOctavesAndMinorSeventh:46,"46":"ThreePerfectOctavesAndMinorSeventh",
|
|
518
|
+
/**
|
|
519
|
+
* Three perfect octaves and a major seventh.
|
|
520
|
+
*/
|
|
521
|
+
ThreePerfectOctavesAndMajorSeventh:47,"47":"ThreePerfectOctavesAndMajorSeventh", });
|
|
522
|
+
/**
|
|
523
|
+
* An enum representing the extension of a chord.
|
|
524
|
+
*
|
|
525
|
+
* Extensions are not really "special" in the sense that they do not change how the
|
|
526
|
+
* chord is interpreted by the system. E.g., an `add2` just adds a 2 to the chord,
|
|
527
|
+
* and the chord is still interpreted as a major chord.
|
|
528
|
+
*/
|
|
529
|
+
export const KordExtension = Object.freeze({
|
|
530
|
+
/**
|
|
531
|
+
* Sus2 extension.
|
|
532
|
+
*/
|
|
533
|
+
Sus2:0,"0":"Sus2",
|
|
534
|
+
/**
|
|
535
|
+
* Sus4 extension.
|
|
536
|
+
*/
|
|
537
|
+
Sus4:1,"1":"Sus4",
|
|
538
|
+
/**
|
|
539
|
+
* Flat 11 extension.
|
|
540
|
+
*/
|
|
541
|
+
Flat11:2,"2":"Flat11",
|
|
542
|
+
/**
|
|
543
|
+
* Flat 13 extension.
|
|
544
|
+
*/
|
|
545
|
+
Flat13:3,"3":"Flat13",
|
|
546
|
+
/**
|
|
547
|
+
* Sharp 13 extension.
|
|
548
|
+
*/
|
|
549
|
+
Sharp13:4,"4":"Sharp13",
|
|
550
|
+
/**
|
|
551
|
+
* Add2 extension.
|
|
552
|
+
*/
|
|
553
|
+
Add2:5,"5":"Add2",
|
|
554
|
+
/**
|
|
555
|
+
* Add4 extension.
|
|
556
|
+
*/
|
|
557
|
+
Add4:6,"6":"Add4",
|
|
558
|
+
/**
|
|
559
|
+
* Add6 extension.
|
|
560
|
+
*/
|
|
561
|
+
Add6:7,"7":"Add6",
|
|
562
|
+
/**
|
|
563
|
+
* Add9 extension.
|
|
564
|
+
*/
|
|
565
|
+
Add9:8,"8":"Add9",
|
|
566
|
+
/**
|
|
567
|
+
* Add11 extension.
|
|
568
|
+
*/
|
|
569
|
+
Add11:9,"9":"Add11",
|
|
570
|
+
/**
|
|
571
|
+
* Add13 extension.
|
|
572
|
+
*/
|
|
573
|
+
Add13:10,"10":"Add13", });
|
|
574
|
+
/**
|
|
575
|
+
* The [`Chord`] wrapper.
|
|
576
|
+
*/
|
|
577
|
+
export class KordChord {
|
|
578
|
+
|
|
579
|
+
static __wrap(ptr) {
|
|
580
|
+
const obj = Object.create(KordChord.prototype);
|
|
581
|
+
obj.ptr = ptr;
|
|
582
|
+
|
|
583
|
+
return obj;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
__destroy_into_raw() {
|
|
587
|
+
const ptr = this.ptr;
|
|
588
|
+
this.ptr = 0;
|
|
589
|
+
|
|
590
|
+
return ptr;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
free() {
|
|
594
|
+
const ptr = this.__destroy_into_raw();
|
|
595
|
+
wasm.__wbg_kordchord_free(ptr);
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Creates a new [`Chord`] from a frequency.
|
|
599
|
+
* @param {string} name
|
|
600
|
+
* @returns {KordChord}
|
|
601
|
+
*/
|
|
602
|
+
static parse(name) {
|
|
603
|
+
try {
|
|
604
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
605
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
606
|
+
const len0 = WASM_VECTOR_LEN;
|
|
607
|
+
wasm.kordchord_parse(retptr, ptr0, len0);
|
|
608
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
609
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
610
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
611
|
+
if (r2) {
|
|
612
|
+
throw takeObject(r1);
|
|
613
|
+
}
|
|
614
|
+
return KordChord.__wrap(r0);
|
|
615
|
+
} finally {
|
|
616
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Creates a new [`Chord`] from a set of [`Note`]s.
|
|
621
|
+
*
|
|
622
|
+
* The [`Note`]s should be represented as a space-separated string.
|
|
623
|
+
* E.g., `C E G`.
|
|
624
|
+
* @param {string} notes
|
|
625
|
+
* @returns {Array<any>}
|
|
626
|
+
*/
|
|
627
|
+
static fromNotesString(notes) {
|
|
628
|
+
try {
|
|
629
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
630
|
+
const ptr0 = passStringToWasm0(notes, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
631
|
+
const len0 = WASM_VECTOR_LEN;
|
|
632
|
+
wasm.kordchord_fromNotesString(retptr, ptr0, len0);
|
|
633
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
634
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
635
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
636
|
+
if (r2) {
|
|
637
|
+
throw takeObject(r1);
|
|
638
|
+
}
|
|
639
|
+
return takeObject(r0);
|
|
640
|
+
} finally {
|
|
641
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* Creates a new [`Chord`] from a set of [`Note`]s.
|
|
646
|
+
* @param {Array<any>} notes
|
|
647
|
+
* @returns {Array<any>}
|
|
648
|
+
*/
|
|
649
|
+
static fromNotes(notes) {
|
|
650
|
+
try {
|
|
651
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
652
|
+
wasm.kordchord_fromNotes(retptr, addHeapObject(notes));
|
|
653
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
654
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
655
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
656
|
+
if (r2) {
|
|
657
|
+
throw takeObject(r1);
|
|
658
|
+
}
|
|
659
|
+
return takeObject(r0);
|
|
660
|
+
} finally {
|
|
661
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* Returns the [`Chord`]'s friendly name.
|
|
666
|
+
* @returns {string}
|
|
667
|
+
*/
|
|
668
|
+
name() {
|
|
669
|
+
try {
|
|
670
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
671
|
+
wasm.kordchord_name(retptr, this.ptr);
|
|
672
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
673
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
674
|
+
return getStringFromWasm0(r0, r1);
|
|
675
|
+
} finally {
|
|
676
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
677
|
+
wasm.__wbindgen_free(r0, r1);
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Returns the [`Chord`]'s precise name.
|
|
682
|
+
* @returns {string}
|
|
683
|
+
*/
|
|
684
|
+
preciseName() {
|
|
685
|
+
try {
|
|
686
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
687
|
+
wasm.kordchord_preciseName(retptr, this.ptr);
|
|
688
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
689
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
690
|
+
return getStringFromWasm0(r0, r1);
|
|
691
|
+
} finally {
|
|
692
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
693
|
+
wasm.__wbindgen_free(r0, r1);
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
/**
|
|
697
|
+
* Returns the [`Chord`] as a string (same as `precise_name`).
|
|
698
|
+
* @returns {string}
|
|
699
|
+
*/
|
|
700
|
+
toString() {
|
|
701
|
+
try {
|
|
702
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
703
|
+
wasm.kordchord_preciseName(retptr, this.ptr);
|
|
704
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
705
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
706
|
+
return getStringFromWasm0(r0, r1);
|
|
707
|
+
} finally {
|
|
708
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
709
|
+
wasm.__wbindgen_free(r0, r1);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* Returns the [`Chord`]'s description.
|
|
714
|
+
* @returns {string}
|
|
715
|
+
*/
|
|
716
|
+
description() {
|
|
717
|
+
try {
|
|
718
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
719
|
+
wasm.kordchord_description(retptr, this.ptr);
|
|
720
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
721
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
722
|
+
return getStringFromWasm0(r0, r1);
|
|
723
|
+
} finally {
|
|
724
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
725
|
+
wasm.__wbindgen_free(r0, r1);
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
/**
|
|
729
|
+
* Returns the [`Chord`]'s display text.
|
|
730
|
+
* @returns {string}
|
|
731
|
+
*/
|
|
732
|
+
display() {
|
|
733
|
+
try {
|
|
734
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
735
|
+
wasm.kordchord_display(retptr, this.ptr);
|
|
736
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
737
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
738
|
+
return getStringFromWasm0(r0, r1);
|
|
739
|
+
} finally {
|
|
740
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
741
|
+
wasm.__wbindgen_free(r0, r1);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* Returns the [`Chord`]'s root note.
|
|
746
|
+
* @returns {string}
|
|
747
|
+
*/
|
|
748
|
+
root() {
|
|
749
|
+
try {
|
|
750
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
751
|
+
wasm.kordchord_root(retptr, this.ptr);
|
|
752
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
753
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
754
|
+
return getStringFromWasm0(r0, r1);
|
|
755
|
+
} finally {
|
|
756
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
757
|
+
wasm.__wbindgen_free(r0, r1);
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* Returns the [`Chord`]'s slash note.
|
|
762
|
+
* @returns {string}
|
|
763
|
+
*/
|
|
764
|
+
slash() {
|
|
765
|
+
try {
|
|
766
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
767
|
+
wasm.kordchord_slash(retptr, this.ptr);
|
|
768
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
769
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
770
|
+
return getStringFromWasm0(r0, r1);
|
|
771
|
+
} finally {
|
|
772
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
773
|
+
wasm.__wbindgen_free(r0, r1);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* Returns the [`Chord`]'s inversion.
|
|
778
|
+
* @returns {number}
|
|
779
|
+
*/
|
|
780
|
+
inversion() {
|
|
781
|
+
const ret = wasm.kordchord_inversion(this.ptr);
|
|
782
|
+
return ret;
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* Returns whether or not the [`Chord`] is "crunchy".
|
|
786
|
+
* @returns {boolean}
|
|
787
|
+
*/
|
|
788
|
+
isCrunchy() {
|
|
789
|
+
const ret = wasm.kordchord_isCrunchy(this.ptr);
|
|
790
|
+
return ret !== 0;
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Returns the [`Chord`]'s chord tones.
|
|
794
|
+
* @returns {Array<any>}
|
|
795
|
+
*/
|
|
796
|
+
chord() {
|
|
797
|
+
const ret = wasm.kordchord_chord(this.ptr);
|
|
798
|
+
return takeObject(ret);
|
|
799
|
+
}
|
|
800
|
+
/**
|
|
801
|
+
* Returns the [`Chord`]'s chord tones as a string.
|
|
802
|
+
* @returns {string}
|
|
803
|
+
*/
|
|
804
|
+
chordString() {
|
|
805
|
+
try {
|
|
806
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
807
|
+
wasm.kordchord_chordString(retptr, this.ptr);
|
|
808
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
809
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
810
|
+
return getStringFromWasm0(r0, r1);
|
|
811
|
+
} finally {
|
|
812
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
813
|
+
wasm.__wbindgen_free(r0, r1);
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
/**
|
|
817
|
+
* Returns the [`Chord`]'s scale tones.
|
|
818
|
+
* @returns {Array<any>}
|
|
819
|
+
*/
|
|
820
|
+
scale() {
|
|
821
|
+
const ret = wasm.kordchord_scale(this.ptr);
|
|
822
|
+
return takeObject(ret);
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* Returns the [`Chord`]'s scale tones as a string.
|
|
826
|
+
* @returns {string}
|
|
827
|
+
*/
|
|
828
|
+
scaleString() {
|
|
829
|
+
try {
|
|
830
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
831
|
+
wasm.kordchord_scaleString(retptr, this.ptr);
|
|
832
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
833
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
834
|
+
return getStringFromWasm0(r0, r1);
|
|
835
|
+
} finally {
|
|
836
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
837
|
+
wasm.__wbindgen_free(r0, r1);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* Returns the [`Chord`]'s modifiers.
|
|
842
|
+
* @returns {Array<any>}
|
|
843
|
+
*/
|
|
844
|
+
modifiers() {
|
|
845
|
+
const ret = wasm.kordchord_modifiers(this.ptr);
|
|
846
|
+
return takeObject(ret);
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* Returns the [`Chord`]'s extensions.
|
|
850
|
+
* @returns {Array<any>}
|
|
851
|
+
*/
|
|
852
|
+
extensions() {
|
|
853
|
+
const ret = wasm.kordchord_extensions(this.ptr);
|
|
854
|
+
return takeObject(ret);
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* Returns a new [`Chord`] with the inversion set to the provided value.
|
|
858
|
+
* @param {number} inversion
|
|
859
|
+
* @returns {KordChord}
|
|
860
|
+
*/
|
|
861
|
+
withInversion(inversion) {
|
|
862
|
+
const ret = wasm.kordchord_withInversion(this.ptr, inversion);
|
|
863
|
+
return KordChord.__wrap(ret);
|
|
864
|
+
}
|
|
865
|
+
/**
|
|
866
|
+
* Returns a new [`Chord`] with the slash set to the provided value.
|
|
867
|
+
* @param {KordNote} slash
|
|
868
|
+
* @returns {KordChord}
|
|
869
|
+
*/
|
|
870
|
+
withSlash(slash) {
|
|
871
|
+
_assertClass(slash, KordNote);
|
|
872
|
+
const ret = wasm.kordchord_withSlash(this.ptr, slash.ptr);
|
|
873
|
+
return KordChord.__wrap(ret);
|
|
874
|
+
}
|
|
875
|
+
/**
|
|
876
|
+
* Returns a new [`Chord`] with the octave of the root set to the provided value.
|
|
877
|
+
* @param {number} octave
|
|
878
|
+
* @returns {KordChord}
|
|
879
|
+
*/
|
|
880
|
+
withOctave(octave) {
|
|
881
|
+
try {
|
|
882
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
883
|
+
wasm.kordchord_withOctave(retptr, this.ptr, octave);
|
|
884
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
885
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
886
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
887
|
+
if (r2) {
|
|
888
|
+
throw takeObject(r1);
|
|
889
|
+
}
|
|
890
|
+
return KordChord.__wrap(r0);
|
|
891
|
+
} finally {
|
|
892
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
/**
|
|
896
|
+
* Returns a new [`Chord`] with the "crunchiness" set to the provided value.
|
|
897
|
+
* @param {boolean} is_crunchy
|
|
898
|
+
* @returns {KordChord}
|
|
899
|
+
*/
|
|
900
|
+
withCrunchy(is_crunchy) {
|
|
901
|
+
const ret = wasm.kordchord_withCrunchy(this.ptr, is_crunchy);
|
|
902
|
+
return KordChord.__wrap(ret);
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* Plays the [`Chord`].
|
|
906
|
+
* @param {number} delay
|
|
907
|
+
* @param {number} length
|
|
908
|
+
* @param {number} fade_in
|
|
909
|
+
* @returns {Promise<void>}
|
|
910
|
+
*/
|
|
911
|
+
play(delay, length, fade_in) {
|
|
912
|
+
const ret = wasm.kordchord_play(this.ptr, delay, length, fade_in);
|
|
913
|
+
return takeObject(ret);
|
|
914
|
+
}
|
|
915
|
+
/**
|
|
916
|
+
* Returns the clone of the [`Chord`].
|
|
917
|
+
* @returns {KordChord}
|
|
918
|
+
*/
|
|
919
|
+
copy() {
|
|
920
|
+
const ret = wasm.kordchord_copy(this.ptr);
|
|
921
|
+
return KordChord.__wrap(ret);
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* Returns a new [`Chord`] with the `minor` modifier.
|
|
925
|
+
* @returns {KordChord}
|
|
926
|
+
*/
|
|
927
|
+
minor() {
|
|
928
|
+
const ret = wasm.kordchord_minor(this.ptr);
|
|
929
|
+
return KordChord.__wrap(ret);
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* Returns a new [`Chord`] with the `flat5` modifier.
|
|
933
|
+
* @returns {KordChord}
|
|
934
|
+
*/
|
|
935
|
+
flat5() {
|
|
936
|
+
const ret = wasm.kordchord_flat5(this.ptr);
|
|
937
|
+
return KordChord.__wrap(ret);
|
|
938
|
+
}
|
|
939
|
+
/**
|
|
940
|
+
* Returns a new [`Chord`] with the `augmented` modifier.
|
|
941
|
+
* @returns {KordChord}
|
|
942
|
+
*/
|
|
943
|
+
aug() {
|
|
944
|
+
const ret = wasm.kordchord_aug(this.ptr);
|
|
945
|
+
return KordChord.__wrap(ret);
|
|
946
|
+
}
|
|
947
|
+
/**
|
|
948
|
+
* Returns a new [`Chord`] with the `maj7` modifier.
|
|
949
|
+
* @returns {KordChord}
|
|
950
|
+
*/
|
|
951
|
+
maj7() {
|
|
952
|
+
const ret = wasm.kordchord_maj7(this.ptr);
|
|
953
|
+
return KordChord.__wrap(ret);
|
|
954
|
+
}
|
|
955
|
+
/**
|
|
956
|
+
* Returns a new [`Chord`] with the `dom7` modifier.
|
|
957
|
+
* @returns {KordChord}
|
|
958
|
+
*/
|
|
959
|
+
seven() {
|
|
960
|
+
const ret = wasm.kordchord_seven(this.ptr);
|
|
961
|
+
return KordChord.__wrap(ret);
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* Returns a new [`Chord`] with the `dom9` modifier.
|
|
965
|
+
* @returns {KordChord}
|
|
966
|
+
*/
|
|
967
|
+
nine() {
|
|
968
|
+
const ret = wasm.kordchord_nine(this.ptr);
|
|
969
|
+
return KordChord.__wrap(ret);
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* Returns a new [`Chord`] with the `dom11` modifier.
|
|
973
|
+
* @returns {KordChord}
|
|
974
|
+
*/
|
|
975
|
+
eleven() {
|
|
976
|
+
const ret = wasm.kordchord_eleven(this.ptr);
|
|
977
|
+
return KordChord.__wrap(ret);
|
|
978
|
+
}
|
|
979
|
+
/**
|
|
980
|
+
* Returns a new [`Chord`] with the `dom13` modifier.
|
|
981
|
+
* @returns {KordChord}
|
|
982
|
+
*/
|
|
983
|
+
thirteen() {
|
|
984
|
+
const ret = wasm.kordchord_thirteen(this.ptr);
|
|
985
|
+
return KordChord.__wrap(ret);
|
|
986
|
+
}
|
|
987
|
+
/**
|
|
988
|
+
* Returns a new [`Chord`] with the `flat9` modifier.
|
|
989
|
+
* @returns {KordChord}
|
|
990
|
+
*/
|
|
991
|
+
flat9() {
|
|
992
|
+
const ret = wasm.kordchord_flat9(this.ptr);
|
|
993
|
+
return KordChord.__wrap(ret);
|
|
994
|
+
}
|
|
995
|
+
/**
|
|
996
|
+
* Returns a new [`Chord`] with the `sharp9` modifier.
|
|
997
|
+
* @returns {KordChord}
|
|
998
|
+
*/
|
|
999
|
+
sharp9() {
|
|
1000
|
+
const ret = wasm.kordchord_sharp9(this.ptr);
|
|
1001
|
+
return KordChord.__wrap(ret);
|
|
1002
|
+
}
|
|
1003
|
+
/**
|
|
1004
|
+
* Returns a new [`Chord`] with the `sharp11` modifier.
|
|
1005
|
+
* @returns {KordChord}
|
|
1006
|
+
*/
|
|
1007
|
+
sharp11() {
|
|
1008
|
+
const ret = wasm.kordchord_sharp11(this.ptr);
|
|
1009
|
+
return KordChord.__wrap(ret);
|
|
1010
|
+
}
|
|
1011
|
+
/**
|
|
1012
|
+
* Returns a new [`Chord`] with the `dim` modifier.
|
|
1013
|
+
* @returns {KordChord}
|
|
1014
|
+
*/
|
|
1015
|
+
dim() {
|
|
1016
|
+
const ret = wasm.kordchord_dim(this.ptr);
|
|
1017
|
+
return KordChord.__wrap(ret);
|
|
1018
|
+
}
|
|
1019
|
+
/**
|
|
1020
|
+
* Returns a new [`Chord`] with the `halfDim` modifier.
|
|
1021
|
+
* @returns {KordChord}
|
|
1022
|
+
*/
|
|
1023
|
+
halfDim() {
|
|
1024
|
+
const ret = wasm.kordchord_halfDim(this.ptr);
|
|
1025
|
+
return KordChord.__wrap(ret);
|
|
1026
|
+
}
|
|
1027
|
+
/**
|
|
1028
|
+
* Returns a new [`Chord`] with the `sus2` extension.
|
|
1029
|
+
* @returns {KordChord}
|
|
1030
|
+
*/
|
|
1031
|
+
sus2() {
|
|
1032
|
+
const ret = wasm.kordchord_sus2(this.ptr);
|
|
1033
|
+
return KordChord.__wrap(ret);
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
* Returns a new [`Chord`] with the `sus4` extension.
|
|
1037
|
+
* @returns {KordChord}
|
|
1038
|
+
*/
|
|
1039
|
+
sus4() {
|
|
1040
|
+
const ret = wasm.kordchord_sus4(this.ptr);
|
|
1041
|
+
return KordChord.__wrap(ret);
|
|
1042
|
+
}
|
|
1043
|
+
/**
|
|
1044
|
+
* Returns a new [`Chord`] with the `flat11` extension.
|
|
1045
|
+
* @returns {KordChord}
|
|
1046
|
+
*/
|
|
1047
|
+
flat11() {
|
|
1048
|
+
const ret = wasm.kordchord_flat11(this.ptr);
|
|
1049
|
+
return KordChord.__wrap(ret);
|
|
1050
|
+
}
|
|
1051
|
+
/**
|
|
1052
|
+
* Returns a new [`Chord`] with the `flat13` extension.
|
|
1053
|
+
* @returns {KordChord}
|
|
1054
|
+
*/
|
|
1055
|
+
flat13() {
|
|
1056
|
+
const ret = wasm.kordchord_flat13(this.ptr);
|
|
1057
|
+
return KordChord.__wrap(ret);
|
|
1058
|
+
}
|
|
1059
|
+
/**
|
|
1060
|
+
* Returns a new [`Chord`] with the `sharp13` extension.
|
|
1061
|
+
* @returns {KordChord}
|
|
1062
|
+
*/
|
|
1063
|
+
sharp13() {
|
|
1064
|
+
const ret = wasm.kordchord_sharp13(this.ptr);
|
|
1065
|
+
return KordChord.__wrap(ret);
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* Returns a new [`Chord`] with the `add2` extension.
|
|
1069
|
+
* @returns {KordChord}
|
|
1070
|
+
*/
|
|
1071
|
+
add2() {
|
|
1072
|
+
const ret = wasm.kordchord_add2(this.ptr);
|
|
1073
|
+
return KordChord.__wrap(ret);
|
|
1074
|
+
}
|
|
1075
|
+
/**
|
|
1076
|
+
* Returns a new [`Chord`] with the `add4` extension.
|
|
1077
|
+
* @returns {KordChord}
|
|
1078
|
+
*/
|
|
1079
|
+
add4() {
|
|
1080
|
+
const ret = wasm.kordchord_add4(this.ptr);
|
|
1081
|
+
return KordChord.__wrap(ret);
|
|
1082
|
+
}
|
|
1083
|
+
/**
|
|
1084
|
+
* Returns a new [`Chord`] with the `add6` extension.
|
|
1085
|
+
* @returns {KordChord}
|
|
1086
|
+
*/
|
|
1087
|
+
add6() {
|
|
1088
|
+
const ret = wasm.kordchord_add6(this.ptr);
|
|
1089
|
+
return KordChord.__wrap(ret);
|
|
1090
|
+
}
|
|
1091
|
+
/**
|
|
1092
|
+
* Returns a new [`Chord`] with the `add9` extension.
|
|
1093
|
+
* @returns {KordChord}
|
|
1094
|
+
*/
|
|
1095
|
+
add9() {
|
|
1096
|
+
const ret = wasm.kordchord_add9(this.ptr);
|
|
1097
|
+
return KordChord.__wrap(ret);
|
|
1098
|
+
}
|
|
1099
|
+
/**
|
|
1100
|
+
* Returns a new [`Chord`] with the `add11` extension.
|
|
1101
|
+
* @returns {KordChord}
|
|
1102
|
+
*/
|
|
1103
|
+
add11() {
|
|
1104
|
+
const ret = wasm.kordchord_add11(this.ptr);
|
|
1105
|
+
return KordChord.__wrap(ret);
|
|
1106
|
+
}
|
|
1107
|
+
/**
|
|
1108
|
+
* Returns a new [`Chord`] with the `add13` extension.
|
|
1109
|
+
* @returns {KordChord}
|
|
1110
|
+
*/
|
|
1111
|
+
add13() {
|
|
1112
|
+
const ret = wasm.kordchord_add13(this.ptr);
|
|
1113
|
+
return KordChord.__wrap(ret);
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
/**
|
|
1117
|
+
* The [`Note`] wrapper.
|
|
1118
|
+
*/
|
|
1119
|
+
export class KordNote {
|
|
1120
|
+
|
|
1121
|
+
static __wrap(ptr) {
|
|
1122
|
+
const obj = Object.create(KordNote.prototype);
|
|
1123
|
+
obj.ptr = ptr;
|
|
1124
|
+
|
|
1125
|
+
return obj;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
__destroy_into_raw() {
|
|
1129
|
+
const ptr = this.ptr;
|
|
1130
|
+
this.ptr = 0;
|
|
1131
|
+
|
|
1132
|
+
return ptr;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
free() {
|
|
1136
|
+
const ptr = this.__destroy_into_raw();
|
|
1137
|
+
wasm.__wbg_kordnote_free(ptr);
|
|
1138
|
+
}
|
|
1139
|
+
/**
|
|
1140
|
+
* Creates a new [`Note`] from a frequency.
|
|
1141
|
+
* @param {string} name
|
|
1142
|
+
* @returns {KordNote}
|
|
1143
|
+
*/
|
|
1144
|
+
static parse(name) {
|
|
1145
|
+
try {
|
|
1146
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1147
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1148
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1149
|
+
wasm.kordnote_parse(retptr, ptr0, len0);
|
|
1150
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1151
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1152
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1153
|
+
if (r2) {
|
|
1154
|
+
throw takeObject(r1);
|
|
1155
|
+
}
|
|
1156
|
+
return KordNote.__wrap(r0);
|
|
1157
|
+
} finally {
|
|
1158
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
/**
|
|
1162
|
+
* Returns [`Note`]s from audio data.
|
|
1163
|
+
* @param {Float32Array} data
|
|
1164
|
+
* @param {number} length_in_seconds
|
|
1165
|
+
* @returns {Array<any>}
|
|
1166
|
+
*/
|
|
1167
|
+
static fromAudio(data, length_in_seconds) {
|
|
1168
|
+
try {
|
|
1169
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1170
|
+
const ptr0 = passArrayF32ToWasm0(data, wasm.__wbindgen_malloc);
|
|
1171
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1172
|
+
wasm.kordnote_fromAudio(retptr, ptr0, len0, length_in_seconds);
|
|
1173
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1174
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1175
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1176
|
+
if (r2) {
|
|
1177
|
+
throw takeObject(r1);
|
|
1178
|
+
}
|
|
1179
|
+
return takeObject(r0);
|
|
1180
|
+
} finally {
|
|
1181
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
/**
|
|
1185
|
+
* Returns [`Note`]s from audio data using the ML inference algorithm.
|
|
1186
|
+
* @param {Float32Array} data
|
|
1187
|
+
* @param {number} length_in_seconds
|
|
1188
|
+
* @returns {Array<any>}
|
|
1189
|
+
*/
|
|
1190
|
+
static fromAudioMl(data, length_in_seconds) {
|
|
1191
|
+
try {
|
|
1192
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1193
|
+
const ptr0 = passArrayF32ToWasm0(data, wasm.__wbindgen_malloc);
|
|
1194
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1195
|
+
wasm.kordnote_fromAudioMl(retptr, ptr0, len0, length_in_seconds);
|
|
1196
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1197
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1198
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1199
|
+
if (r2) {
|
|
1200
|
+
throw takeObject(r1);
|
|
1201
|
+
}
|
|
1202
|
+
return takeObject(r0);
|
|
1203
|
+
} finally {
|
|
1204
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
/**
|
|
1208
|
+
* Returns the [`Note`]'s friendly name.
|
|
1209
|
+
* @returns {string}
|
|
1210
|
+
*/
|
|
1211
|
+
name() {
|
|
1212
|
+
try {
|
|
1213
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1214
|
+
wasm.kordnote_name(retptr, this.ptr);
|
|
1215
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1216
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1217
|
+
return getStringFromWasm0(r0, r1);
|
|
1218
|
+
} finally {
|
|
1219
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1220
|
+
wasm.__wbindgen_free(r0, r1);
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
/**
|
|
1224
|
+
* Returns the [`Note`] represented as a string (same as `name`).
|
|
1225
|
+
* @returns {string}
|
|
1226
|
+
*/
|
|
1227
|
+
toString() {
|
|
1228
|
+
try {
|
|
1229
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1230
|
+
wasm.kordnote_toString(retptr, this.ptr);
|
|
1231
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1232
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1233
|
+
return getStringFromWasm0(r0, r1);
|
|
1234
|
+
} finally {
|
|
1235
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1236
|
+
wasm.__wbindgen_free(r0, r1);
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
/**
|
|
1240
|
+
* Returns the [`Note`]'s [`NamedPitch`].
|
|
1241
|
+
* @returns {string}
|
|
1242
|
+
*/
|
|
1243
|
+
pitch() {
|
|
1244
|
+
try {
|
|
1245
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1246
|
+
wasm.kordnote_pitch(retptr, this.ptr);
|
|
1247
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1248
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1249
|
+
return getStringFromWasm0(r0, r1);
|
|
1250
|
+
} finally {
|
|
1251
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1252
|
+
wasm.__wbindgen_free(r0, r1);
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
/**
|
|
1256
|
+
* Returns the [`Note`]'s [`Octave`].
|
|
1257
|
+
* @returns {number}
|
|
1258
|
+
*/
|
|
1259
|
+
octave() {
|
|
1260
|
+
const ret = wasm.kordnote_octave(this.ptr);
|
|
1261
|
+
return ret;
|
|
1262
|
+
}
|
|
1263
|
+
/**
|
|
1264
|
+
* Returns the [`Note`]'s frequency.
|
|
1265
|
+
* @returns {number}
|
|
1266
|
+
*/
|
|
1267
|
+
frequency() {
|
|
1268
|
+
const ret = wasm.kordnote_frequency(this.ptr);
|
|
1269
|
+
return ret;
|
|
1270
|
+
}
|
|
1271
|
+
/**
|
|
1272
|
+
* Adds the given interval to the [`Note`], producing a new [`Note`] instance.
|
|
1273
|
+
* @param {number} interval
|
|
1274
|
+
* @returns {KordNote}
|
|
1275
|
+
*/
|
|
1276
|
+
addInterval(interval) {
|
|
1277
|
+
const ret = wasm.kordnote_addInterval(this.ptr, interval);
|
|
1278
|
+
return KordNote.__wrap(ret);
|
|
1279
|
+
}
|
|
1280
|
+
/**
|
|
1281
|
+
* Subtracts the given interval from the [`Note`], producing a new [`Note`] instance.
|
|
1282
|
+
* @param {number} interval
|
|
1283
|
+
* @returns {KordNote}
|
|
1284
|
+
*/
|
|
1285
|
+
subInterval(interval) {
|
|
1286
|
+
const ret = wasm.kordnote_subInterval(this.ptr, interval);
|
|
1287
|
+
return KordNote.__wrap(ret);
|
|
1288
|
+
}
|
|
1289
|
+
/**
|
|
1290
|
+
* Computes the [`Interval`] distance between the [`Note`] and the given [`Note`].
|
|
1291
|
+
* @param {KordNote} other
|
|
1292
|
+
* @returns {number}
|
|
1293
|
+
*/
|
|
1294
|
+
distanceTo(other) {
|
|
1295
|
+
_assertClass(other, KordNote);
|
|
1296
|
+
var ptr0 = other.__destroy_into_raw();
|
|
1297
|
+
const ret = wasm.kordnote_distanceTo(this.ptr, ptr0);
|
|
1298
|
+
return ret >>> 0;
|
|
1299
|
+
}
|
|
1300
|
+
/**
|
|
1301
|
+
* Returns the primary (first 13) harmonic series of the [`Note`].
|
|
1302
|
+
* @returns {Array<any>}
|
|
1303
|
+
*/
|
|
1304
|
+
harmonicSeries() {
|
|
1305
|
+
const ret = wasm.kordnote_harmonicSeries(this.ptr);
|
|
1306
|
+
return takeObject(ret);
|
|
1307
|
+
}
|
|
1308
|
+
/**
|
|
1309
|
+
* Returns the clone of the [`Note`].
|
|
1310
|
+
* @returns {KordNote}
|
|
1311
|
+
*/
|
|
1312
|
+
copy() {
|
|
1313
|
+
const ret = wasm.kordnote_copy(this.ptr);
|
|
1314
|
+
return KordNote.__wrap(ret);
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
/**
|
|
1318
|
+
* A handle to a [`Chord`] playback.
|
|
1319
|
+
*
|
|
1320
|
+
* Should be dropped to stop the playback, or after playback is finished.
|
|
1321
|
+
*/
|
|
1322
|
+
export class KordPlaybackHandle {
|
|
1323
|
+
|
|
1324
|
+
__destroy_into_raw() {
|
|
1325
|
+
const ptr = this.ptr;
|
|
1326
|
+
this.ptr = 0;
|
|
1327
|
+
|
|
1328
|
+
return ptr;
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
free() {
|
|
1332
|
+
const ptr = this.__destroy_into_raw();
|
|
1333
|
+
wasm.__wbg_kordplaybackhandle_free(ptr);
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
export function __wbindgen_cb_drop(arg0) {
|
|
1338
|
+
const obj = takeObject(arg0).original;
|
|
1339
|
+
if (obj.cnt-- == 1) {
|
|
1340
|
+
obj.a = 0;
|
|
1341
|
+
return true;
|
|
1342
|
+
}
|
|
1343
|
+
const ret = false;
|
|
1344
|
+
return ret;
|
|
1345
|
+
};
|
|
1346
|
+
|
|
1347
|
+
export function __wbindgen_object_drop_ref(arg0) {
|
|
1348
|
+
takeObject(arg0);
|
|
1349
|
+
};
|
|
1350
|
+
|
|
1351
|
+
export function __wbindgen_string_new(arg0, arg1) {
|
|
1352
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1353
|
+
return addHeapObject(ret);
|
|
1354
|
+
};
|
|
1355
|
+
|
|
1356
|
+
export function __wbindgen_number_get(arg0, arg1) {
|
|
1357
|
+
const obj = getObject(arg1);
|
|
1358
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
1359
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
1360
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
1361
|
+
};
|
|
1362
|
+
|
|
1363
|
+
export function __wbg_kordnote_new(arg0) {
|
|
1364
|
+
const ret = KordNote.__wrap(arg0);
|
|
1365
|
+
return addHeapObject(ret);
|
|
1366
|
+
};
|
|
1367
|
+
|
|
1368
|
+
export function __wbg_kordchord_new(arg0) {
|
|
1369
|
+
const ret = KordChord.__wrap(arg0);
|
|
1370
|
+
return addHeapObject(ret);
|
|
1371
|
+
};
|
|
1372
|
+
|
|
1373
|
+
export function __wbg_clearTimeout_76877dbc010e786d(arg0) {
|
|
1374
|
+
const ret = clearTimeout(takeObject(arg0));
|
|
1375
|
+
return addHeapObject(ret);
|
|
1376
|
+
};
|
|
1377
|
+
|
|
1378
|
+
export function __wbg_setTimeout_75cb9b6991a4031d() { return handleError(function (arg0, arg1) {
|
|
1379
|
+
const ret = setTimeout(getObject(arg0), arg1);
|
|
1380
|
+
return addHeapObject(ret);
|
|
1381
|
+
}, arguments) };
|
|
1382
|
+
|
|
1383
|
+
export function __wbindgen_boolean_get(arg0) {
|
|
1384
|
+
const v = getObject(arg0);
|
|
1385
|
+
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
1386
|
+
return ret;
|
|
1387
|
+
};
|
|
1388
|
+
|
|
1389
|
+
export function __wbg_instanceof_Window_e266f02eee43b570(arg0) {
|
|
1390
|
+
let result;
|
|
1391
|
+
try {
|
|
1392
|
+
result = getObject(arg0) instanceof Window;
|
|
1393
|
+
} catch {
|
|
1394
|
+
result = false;
|
|
1395
|
+
}
|
|
1396
|
+
const ret = result;
|
|
1397
|
+
return ret;
|
|
1398
|
+
};
|
|
1399
|
+
|
|
1400
|
+
export function __wbg_setTimeout_6609c9aa64f32bfc() { return handleError(function (arg0, arg1, arg2) {
|
|
1401
|
+
const ret = getObject(arg0).setTimeout(getObject(arg1), arg2);
|
|
1402
|
+
return ret;
|
|
1403
|
+
}, arguments) };
|
|
1404
|
+
|
|
1405
|
+
export function __wbg_destination_5dfc354bcf2eb941(arg0) {
|
|
1406
|
+
const ret = getObject(arg0).destination;
|
|
1407
|
+
return addHeapObject(ret);
|
|
1408
|
+
};
|
|
1409
|
+
|
|
1410
|
+
export function __wbg_currentTime_d94729a1b5fd59a5(arg0) {
|
|
1411
|
+
const ret = getObject(arg0).currentTime;
|
|
1412
|
+
return ret;
|
|
1413
|
+
};
|
|
1414
|
+
|
|
1415
|
+
export function __wbg_newwithcontextoptions_6c6a79a71ed7efa3() { return handleError(function (arg0) {
|
|
1416
|
+
const ret = new lAudioContext(getObject(arg0));
|
|
1417
|
+
return addHeapObject(ret);
|
|
1418
|
+
}, arguments) };
|
|
1419
|
+
|
|
1420
|
+
export function __wbg_close_82409a9d656a7c26() { return handleError(function (arg0) {
|
|
1421
|
+
const ret = getObject(arg0).close();
|
|
1422
|
+
return addHeapObject(ret);
|
|
1423
|
+
}, arguments) };
|
|
1424
|
+
|
|
1425
|
+
export function __wbg_createBuffer_d142e00390bff447() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1426
|
+
const ret = getObject(arg0).createBuffer(arg1 >>> 0, arg2 >>> 0, arg3);
|
|
1427
|
+
return addHeapObject(ret);
|
|
1428
|
+
}, arguments) };
|
|
1429
|
+
|
|
1430
|
+
export function __wbg_createBufferSource_1473226efd418a08() { return handleError(function (arg0) {
|
|
1431
|
+
const ret = getObject(arg0).createBufferSource();
|
|
1432
|
+
return addHeapObject(ret);
|
|
1433
|
+
}, arguments) };
|
|
1434
|
+
|
|
1435
|
+
export function __wbg_resume_72fe7cd3e68b861a() { return handleError(function (arg0) {
|
|
1436
|
+
const ret = getObject(arg0).resume();
|
|
1437
|
+
return addHeapObject(ret);
|
|
1438
|
+
}, arguments) };
|
|
1439
|
+
|
|
1440
|
+
export function __wbindgen_string_get(arg0, arg1) {
|
|
1441
|
+
const obj = getObject(arg1);
|
|
1442
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1443
|
+
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1444
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1445
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
1446
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
1447
|
+
};
|
|
1448
|
+
|
|
1449
|
+
export function __wbindgen_number_new(arg0) {
|
|
1450
|
+
const ret = arg0;
|
|
1451
|
+
return addHeapObject(ret);
|
|
1452
|
+
};
|
|
1453
|
+
|
|
1454
|
+
export function __wbg_setbuffer_bad384d1628a8306(arg0, arg1) {
|
|
1455
|
+
getObject(arg0).buffer = getObject(arg1);
|
|
1456
|
+
};
|
|
1457
|
+
|
|
1458
|
+
export function __wbg_setonended_15b13187aec41ac9(arg0, arg1) {
|
|
1459
|
+
getObject(arg0).onended = getObject(arg1);
|
|
1460
|
+
};
|
|
1461
|
+
|
|
1462
|
+
export function __wbg_start_9169e040a16354b9() { return handleError(function (arg0, arg1) {
|
|
1463
|
+
getObject(arg0).start(arg1);
|
|
1464
|
+
}, arguments) };
|
|
1465
|
+
|
|
1466
|
+
export function __wbg_connect_77f2f818a74097e1() { return handleError(function (arg0, arg1) {
|
|
1467
|
+
const ret = getObject(arg0).connect(getObject(arg1));
|
|
1468
|
+
return addHeapObject(ret);
|
|
1469
|
+
}, arguments) };
|
|
1470
|
+
|
|
1471
|
+
export function __wbg_copyToChannel_9babe9bf308bffc3() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1472
|
+
getObject(arg0).copyToChannel(getArrayF32FromWasm0(arg1, arg2), arg3);
|
|
1473
|
+
}, arguments) };
|
|
1474
|
+
|
|
1475
|
+
export function __wbg_get_27fe3dac1c4d0224(arg0, arg1) {
|
|
1476
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
1477
|
+
return addHeapObject(ret);
|
|
1478
|
+
};
|
|
1479
|
+
|
|
1480
|
+
export function __wbg_length_e498fbc24f9c1d4f(arg0) {
|
|
1481
|
+
const ret = getObject(arg0).length;
|
|
1482
|
+
return ret;
|
|
1483
|
+
};
|
|
1484
|
+
|
|
1485
|
+
export function __wbg_new_b525de17f44a8943() {
|
|
1486
|
+
const ret = new Array();
|
|
1487
|
+
return addHeapObject(ret);
|
|
1488
|
+
};
|
|
1489
|
+
|
|
1490
|
+
export function __wbg_newnoargs_2b8b6bd7753c76ba(arg0, arg1) {
|
|
1491
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
1492
|
+
return addHeapObject(ret);
|
|
1493
|
+
};
|
|
1494
|
+
|
|
1495
|
+
export function __wbg_get_baf4855f9a986186() { return handleError(function (arg0, arg1) {
|
|
1496
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
1497
|
+
return addHeapObject(ret);
|
|
1498
|
+
}, arguments) };
|
|
1499
|
+
|
|
1500
|
+
export function __wbg_call_95d1ea488d03e4e8() { return handleError(function (arg0, arg1) {
|
|
1501
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
1502
|
+
return addHeapObject(ret);
|
|
1503
|
+
}, arguments) };
|
|
1504
|
+
|
|
1505
|
+
export function __wbg_new_f9876326328f45ed() {
|
|
1506
|
+
const ret = new Object();
|
|
1507
|
+
return addHeapObject(ret);
|
|
1508
|
+
};
|
|
1509
|
+
|
|
1510
|
+
export function __wbindgen_object_clone_ref(arg0) {
|
|
1511
|
+
const ret = getObject(arg0);
|
|
1512
|
+
return addHeapObject(ret);
|
|
1513
|
+
};
|
|
1514
|
+
|
|
1515
|
+
export function __wbg_self_e7c1f827057f6584() { return handleError(function () {
|
|
1516
|
+
const ret = self.self;
|
|
1517
|
+
return addHeapObject(ret);
|
|
1518
|
+
}, arguments) };
|
|
1519
|
+
|
|
1520
|
+
export function __wbg_window_a09ec664e14b1b81() { return handleError(function () {
|
|
1521
|
+
const ret = window.window;
|
|
1522
|
+
return addHeapObject(ret);
|
|
1523
|
+
}, arguments) };
|
|
1524
|
+
|
|
1525
|
+
export function __wbg_globalThis_87cbb8506fecf3a9() { return handleError(function () {
|
|
1526
|
+
const ret = globalThis.globalThis;
|
|
1527
|
+
return addHeapObject(ret);
|
|
1528
|
+
}, arguments) };
|
|
1529
|
+
|
|
1530
|
+
export function __wbg_global_c85a9259e621f3db() { return handleError(function () {
|
|
1531
|
+
const ret = global.global;
|
|
1532
|
+
return addHeapObject(ret);
|
|
1533
|
+
}, arguments) };
|
|
1534
|
+
|
|
1535
|
+
export function __wbindgen_is_undefined(arg0) {
|
|
1536
|
+
const ret = getObject(arg0) === undefined;
|
|
1537
|
+
return ret;
|
|
1538
|
+
};
|
|
1539
|
+
|
|
1540
|
+
export function __wbg_eval_be0434aab6074e1e() { return handleError(function (arg0, arg1) {
|
|
1541
|
+
const ret = eval(getStringFromWasm0(arg0, arg1));
|
|
1542
|
+
return addHeapObject(ret);
|
|
1543
|
+
}, arguments) };
|
|
1544
|
+
|
|
1545
|
+
export function __wbg_push_49c286f04dd3bf59(arg0, arg1) {
|
|
1546
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
1547
|
+
return ret;
|
|
1548
|
+
};
|
|
1549
|
+
|
|
1550
|
+
export function __wbg_call_9495de66fdbe016b() { return handleError(function (arg0, arg1, arg2) {
|
|
1551
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
1552
|
+
return addHeapObject(ret);
|
|
1553
|
+
}, arguments) };
|
|
1554
|
+
|
|
1555
|
+
export function __wbg_name_4e66d4cfa3e9270a(arg0) {
|
|
1556
|
+
const ret = getObject(arg0).name;
|
|
1557
|
+
return addHeapObject(ret);
|
|
1558
|
+
};
|
|
1559
|
+
|
|
1560
|
+
export function __wbg_instanceof_Object_f5a826c4da0d4a94(arg0) {
|
|
1561
|
+
let result;
|
|
1562
|
+
try {
|
|
1563
|
+
result = getObject(arg0) instanceof Object;
|
|
1564
|
+
} catch {
|
|
1565
|
+
result = false;
|
|
1566
|
+
}
|
|
1567
|
+
const ret = result;
|
|
1568
|
+
return ret;
|
|
1569
|
+
};
|
|
1570
|
+
|
|
1571
|
+
export function __wbg_constructor_0c9828c8a7cf1dc6(arg0) {
|
|
1572
|
+
const ret = getObject(arg0).constructor;
|
|
1573
|
+
return addHeapObject(ret);
|
|
1574
|
+
};
|
|
1575
|
+
|
|
1576
|
+
export function __wbg_new_9d3a9ce4282a18a8(arg0, arg1) {
|
|
1577
|
+
try {
|
|
1578
|
+
var state0 = {a: arg0, b: arg1};
|
|
1579
|
+
var cb0 = (arg0, arg1) => {
|
|
1580
|
+
const a = state0.a;
|
|
1581
|
+
state0.a = 0;
|
|
1582
|
+
try {
|
|
1583
|
+
return __wbg_adapter_152(a, state0.b, arg0, arg1);
|
|
1584
|
+
} finally {
|
|
1585
|
+
state0.a = a;
|
|
1586
|
+
}
|
|
1587
|
+
};
|
|
1588
|
+
const ret = new Promise(cb0);
|
|
1589
|
+
return addHeapObject(ret);
|
|
1590
|
+
} finally {
|
|
1591
|
+
state0.a = state0.b = 0;
|
|
1592
|
+
}
|
|
1593
|
+
};
|
|
1594
|
+
|
|
1595
|
+
export function __wbg_resolve_fd40f858d9db1a04(arg0) {
|
|
1596
|
+
const ret = Promise.resolve(getObject(arg0));
|
|
1597
|
+
return addHeapObject(ret);
|
|
1598
|
+
};
|
|
1599
|
+
|
|
1600
|
+
export function __wbg_then_ec5db6d509eb475f(arg0, arg1) {
|
|
1601
|
+
const ret = getObject(arg0).then(getObject(arg1));
|
|
1602
|
+
return addHeapObject(ret);
|
|
1603
|
+
};
|
|
1604
|
+
|
|
1605
|
+
export function __wbg_set_6aa458a4ebdb65cb() { return handleError(function (arg0, arg1, arg2) {
|
|
1606
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
1607
|
+
return ret;
|
|
1608
|
+
}, arguments) };
|
|
1609
|
+
|
|
1610
|
+
export function __wbindgen_debug_string(arg0, arg1) {
|
|
1611
|
+
const ret = debugString(getObject(arg1));
|
|
1612
|
+
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1613
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1614
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
1615
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
1616
|
+
};
|
|
1617
|
+
|
|
1618
|
+
export function __wbindgen_throw(arg0, arg1) {
|
|
1619
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1620
|
+
};
|
|
1621
|
+
|
|
1622
|
+
export function __wbindgen_closure_wrapper1065(arg0, arg1, arg2) {
|
|
1623
|
+
const ret = makeMutClosure(arg0, arg1, 458, __wbg_adapter_24);
|
|
1624
|
+
return addHeapObject(ret);
|
|
1625
|
+
};
|
|
1626
|
+
|
|
1627
|
+
export function __wbindgen_closure_wrapper1117(arg0, arg1, arg2) {
|
|
1628
|
+
const ret = makeMutClosure(arg0, arg1, 494, __wbg_adapter_27);
|
|
1629
|
+
return addHeapObject(ret);
|
|
1630
|
+
};
|
|
1631
|
+
|
|
1632
|
+
export function __wbindgen_closure_wrapper1404(arg0, arg1, arg2) {
|
|
1633
|
+
const ret = makeMutClosure(arg0, arg1, 600, __wbg_adapter_30);
|
|
1634
|
+
return addHeapObject(ret);
|
|
1635
|
+
};
|
|
1636
|
+
|