kordweb 0.5.19 → 0.6.0
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 +0 -756
- package/klib.js +4 -1697
- package/klib_bg.js +5 -0
- package/klib_bg.wasm +0 -0
- package/package.json +3 -1
package/klib.d.ts
CHANGED
|
@@ -1,758 +1,2 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* The main entrypoint which sets up global state.
|
|
5
|
-
*/
|
|
6
|
-
export function main(): void;
|
|
7
|
-
/**
|
|
8
|
-
* An enum representing the extension of a chord.
|
|
9
|
-
*
|
|
10
|
-
* Extensions are not really "special" in the sense that they do not change how the
|
|
11
|
-
* chord is interpreted by the system. E.g., an `add2` just adds a 2 to the chord,
|
|
12
|
-
* and the chord is still interpreted as a major chord.
|
|
13
|
-
*/
|
|
14
|
-
export enum KordExtension {
|
|
15
|
-
/**
|
|
16
|
-
* Sus2 extension.
|
|
17
|
-
*/
|
|
18
|
-
Sus2 = 0,
|
|
19
|
-
/**
|
|
20
|
-
* Sus4 extension.
|
|
21
|
-
*/
|
|
22
|
-
Sus4 = 1,
|
|
23
|
-
/**
|
|
24
|
-
* Flat 11 extension.
|
|
25
|
-
*/
|
|
26
|
-
Flat11 = 2,
|
|
27
|
-
/**
|
|
28
|
-
* Flat 13 extension.
|
|
29
|
-
*/
|
|
30
|
-
Flat13 = 3,
|
|
31
|
-
/**
|
|
32
|
-
* Sharp 13 extension.
|
|
33
|
-
*/
|
|
34
|
-
Sharp13 = 4,
|
|
35
|
-
/**
|
|
36
|
-
* Add2 extension.
|
|
37
|
-
*/
|
|
38
|
-
Add2 = 5,
|
|
39
|
-
/**
|
|
40
|
-
* Add4 extension.
|
|
41
|
-
*/
|
|
42
|
-
Add4 = 6,
|
|
43
|
-
/**
|
|
44
|
-
* Add6 extension.
|
|
45
|
-
*/
|
|
46
|
-
Add6 = 7,
|
|
47
|
-
/**
|
|
48
|
-
* Add9 extension.
|
|
49
|
-
*/
|
|
50
|
-
Add9 = 8,
|
|
51
|
-
/**
|
|
52
|
-
* Add11 extension.
|
|
53
|
-
*/
|
|
54
|
-
Add11 = 9,
|
|
55
|
-
/**
|
|
56
|
-
* Add13 extension.
|
|
57
|
-
*/
|
|
58
|
-
Add13 = 10,
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* An enum representing the interval between two notes.
|
|
62
|
-
*/
|
|
63
|
-
export enum KordInterval {
|
|
64
|
-
/**
|
|
65
|
-
* A perfect unison interval.
|
|
66
|
-
*/
|
|
67
|
-
PerfectUnison = 0,
|
|
68
|
-
/**
|
|
69
|
-
* A diminished second interval.
|
|
70
|
-
*/
|
|
71
|
-
DiminishedSecond = 1,
|
|
72
|
-
/**
|
|
73
|
-
* An augmented unison interval.
|
|
74
|
-
*/
|
|
75
|
-
AugmentedUnison = 2,
|
|
76
|
-
/**
|
|
77
|
-
* A minor second interval.
|
|
78
|
-
*/
|
|
79
|
-
MinorSecond = 3,
|
|
80
|
-
/**
|
|
81
|
-
* A major second interval.
|
|
82
|
-
*/
|
|
83
|
-
MajorSecond = 4,
|
|
84
|
-
/**
|
|
85
|
-
* A diminished third interval.
|
|
86
|
-
*/
|
|
87
|
-
DiminishedThird = 5,
|
|
88
|
-
/**
|
|
89
|
-
* An augmented second interval.
|
|
90
|
-
*/
|
|
91
|
-
AugmentedSecond = 6,
|
|
92
|
-
/**
|
|
93
|
-
* A minor third interval.
|
|
94
|
-
*/
|
|
95
|
-
MinorThird = 7,
|
|
96
|
-
/**
|
|
97
|
-
* A major third interval.
|
|
98
|
-
*/
|
|
99
|
-
MajorThird = 8,
|
|
100
|
-
/**
|
|
101
|
-
* A diminished fourth interval.
|
|
102
|
-
*/
|
|
103
|
-
DiminishedFourth = 9,
|
|
104
|
-
/**
|
|
105
|
-
* An augmented third interval.
|
|
106
|
-
*/
|
|
107
|
-
AugmentedThird = 10,
|
|
108
|
-
/**
|
|
109
|
-
* A perfect fourth interval.
|
|
110
|
-
*/
|
|
111
|
-
PerfectFourth = 11,
|
|
112
|
-
/**
|
|
113
|
-
* An augmented fourth interval.
|
|
114
|
-
*/
|
|
115
|
-
AugmentedFourth = 12,
|
|
116
|
-
/**
|
|
117
|
-
* A diminished fifth interval.
|
|
118
|
-
*/
|
|
119
|
-
DiminishedFifth = 13,
|
|
120
|
-
/**
|
|
121
|
-
* A perfect fifth interval.
|
|
122
|
-
*/
|
|
123
|
-
PerfectFifth = 14,
|
|
124
|
-
/**
|
|
125
|
-
* A diminished sixth interval.
|
|
126
|
-
*/
|
|
127
|
-
DiminishedSixth = 15,
|
|
128
|
-
/**
|
|
129
|
-
* An augmented fifth interval.
|
|
130
|
-
*/
|
|
131
|
-
AugmentedFifth = 16,
|
|
132
|
-
/**
|
|
133
|
-
* A minor sixth interval.
|
|
134
|
-
*/
|
|
135
|
-
MinorSixth = 17,
|
|
136
|
-
/**
|
|
137
|
-
* A major sixth interval.
|
|
138
|
-
*/
|
|
139
|
-
MajorSixth = 18,
|
|
140
|
-
/**
|
|
141
|
-
* A diminished seventh interval.
|
|
142
|
-
*/
|
|
143
|
-
DiminishedSeventh = 19,
|
|
144
|
-
/**
|
|
145
|
-
* An augmented sixth interval.
|
|
146
|
-
*/
|
|
147
|
-
AugmentedSixth = 20,
|
|
148
|
-
/**
|
|
149
|
-
* A minor seventh interval.
|
|
150
|
-
*/
|
|
151
|
-
MinorSeventh = 21,
|
|
152
|
-
/**
|
|
153
|
-
* A major seventh interval.
|
|
154
|
-
*/
|
|
155
|
-
MajorSeventh = 22,
|
|
156
|
-
/**
|
|
157
|
-
* A diminished octave interval.
|
|
158
|
-
*/
|
|
159
|
-
DiminishedOctave = 23,
|
|
160
|
-
/**
|
|
161
|
-
* An augmented seventh interval.
|
|
162
|
-
*/
|
|
163
|
-
AugmentedSeventh = 24,
|
|
164
|
-
/**
|
|
165
|
-
* A perfect octave interval.
|
|
166
|
-
*/
|
|
167
|
-
PerfectOctave = 25,
|
|
168
|
-
/**
|
|
169
|
-
* An minor ninth interval.
|
|
170
|
-
*/
|
|
171
|
-
MinorNinth = 26,
|
|
172
|
-
/**
|
|
173
|
-
* A major ninth interval.
|
|
174
|
-
*/
|
|
175
|
-
MajorNinth = 27,
|
|
176
|
-
/**
|
|
177
|
-
* An augmented ninth interval.
|
|
178
|
-
*/
|
|
179
|
-
AugmentedNinth = 28,
|
|
180
|
-
/**
|
|
181
|
-
* A diminished eleventh interval.
|
|
182
|
-
*/
|
|
183
|
-
DiminishedEleventh = 29,
|
|
184
|
-
/**
|
|
185
|
-
* A perfect eleventh interval.
|
|
186
|
-
*/
|
|
187
|
-
PerfectEleventh = 30,
|
|
188
|
-
/**
|
|
189
|
-
* An augmented eleventh interval.
|
|
190
|
-
*/
|
|
191
|
-
AugmentedEleventh = 31,
|
|
192
|
-
/**
|
|
193
|
-
* A minor thirteenth interval.
|
|
194
|
-
*/
|
|
195
|
-
MinorThirteenth = 32,
|
|
196
|
-
/**
|
|
197
|
-
* A major thirteenth interval.
|
|
198
|
-
*/
|
|
199
|
-
MajorThirteenth = 33,
|
|
200
|
-
/**
|
|
201
|
-
* An augmented thirteenth interval.
|
|
202
|
-
*/
|
|
203
|
-
AugmentedThirteenth = 34,
|
|
204
|
-
/**
|
|
205
|
-
* A perfect octave and perfect fifth interval.
|
|
206
|
-
*/
|
|
207
|
-
PerfectOctaveAndPerfectFifth = 35,
|
|
208
|
-
/**
|
|
209
|
-
* Two perfect octaves.
|
|
210
|
-
*/
|
|
211
|
-
TwoPerfectOctaves = 36,
|
|
212
|
-
/**
|
|
213
|
-
* Two perfect octaves and a major third.
|
|
214
|
-
*/
|
|
215
|
-
TwoPerfectOctavesAndMajorThird = 37,
|
|
216
|
-
/**
|
|
217
|
-
* Two perfect octaves and a perfect fifth.
|
|
218
|
-
*/
|
|
219
|
-
TwoPerfectOctavesAndPerfectFifth = 38,
|
|
220
|
-
/**
|
|
221
|
-
* Two perfect octaves and a minor sixth.
|
|
222
|
-
*/
|
|
223
|
-
TwoPerfectOctavesAndMinorSeventh = 39,
|
|
224
|
-
/**
|
|
225
|
-
* Three perfect octaves.
|
|
226
|
-
*/
|
|
227
|
-
ThreePerfectOctaves = 40,
|
|
228
|
-
/**
|
|
229
|
-
* Three perfect octaves and a major second.
|
|
230
|
-
*/
|
|
231
|
-
ThreePerfectOctavesAndMajorSecond = 41,
|
|
232
|
-
/**
|
|
233
|
-
* Three perfect octaves and a major third.
|
|
234
|
-
*/
|
|
235
|
-
ThreePerfectOctavesAndMajorThird = 42,
|
|
236
|
-
/**
|
|
237
|
-
* Three perfect octaves and an augmented fourth.
|
|
238
|
-
*/
|
|
239
|
-
ThreePerfectOctavesAndAugmentedFourth = 43,
|
|
240
|
-
/**
|
|
241
|
-
* Three perfect octaves and a perfect fifth.
|
|
242
|
-
*/
|
|
243
|
-
ThreePerfectOctavesAndPerfectFifth = 44,
|
|
244
|
-
/**
|
|
245
|
-
* Three perfect octaves and a minor sixth.
|
|
246
|
-
*/
|
|
247
|
-
ThreePerfectOctavesAndMinorSixth = 45,
|
|
248
|
-
/**
|
|
249
|
-
* Three perfect octaves and a minor seventh.
|
|
250
|
-
*/
|
|
251
|
-
ThreePerfectOctavesAndMinorSeventh = 46,
|
|
252
|
-
/**
|
|
253
|
-
* Three perfect octaves and a major seventh.
|
|
254
|
-
*/
|
|
255
|
-
ThreePerfectOctavesAndMajorSeventh = 47,
|
|
256
|
-
}
|
|
257
|
-
/**
|
|
258
|
-
* The chord modifiers.
|
|
259
|
-
*/
|
|
260
|
-
export enum KordModifier {
|
|
261
|
-
/**
|
|
262
|
-
* Minor modifier.
|
|
263
|
-
*/
|
|
264
|
-
Minor = 0,
|
|
265
|
-
/**
|
|
266
|
-
* Flat 5 modifier.
|
|
267
|
-
*/
|
|
268
|
-
Flat5 = 1,
|
|
269
|
-
/**
|
|
270
|
-
* Sharp 5 modifier.
|
|
271
|
-
*/
|
|
272
|
-
Augmented5 = 2,
|
|
273
|
-
/**
|
|
274
|
-
* Major 7 modifier.
|
|
275
|
-
*/
|
|
276
|
-
Major7 = 3,
|
|
277
|
-
/**
|
|
278
|
-
* Dominant 7 modifier.
|
|
279
|
-
*/
|
|
280
|
-
Dominant7 = 4,
|
|
281
|
-
/**
|
|
282
|
-
* Dominant 9 modifier.
|
|
283
|
-
*/
|
|
284
|
-
Dominant9 = 5,
|
|
285
|
-
/**
|
|
286
|
-
* Dominant 11 modifier.
|
|
287
|
-
*/
|
|
288
|
-
Dominant11 = 6,
|
|
289
|
-
/**
|
|
290
|
-
* Dominant 13 modifier.
|
|
291
|
-
*/
|
|
292
|
-
Dominant13 = 7,
|
|
293
|
-
/**
|
|
294
|
-
* Flat 9 modifier.
|
|
295
|
-
*/
|
|
296
|
-
Flat9 = 8,
|
|
297
|
-
/**
|
|
298
|
-
* Sharp 9 modifier.
|
|
299
|
-
*/
|
|
300
|
-
Sharp9 = 9,
|
|
301
|
-
/**
|
|
302
|
-
* Sharp 11 modifier.
|
|
303
|
-
*/
|
|
304
|
-
Sharp11 = 10,
|
|
305
|
-
/**
|
|
306
|
-
* Diminished modifier.
|
|
307
|
-
*/
|
|
308
|
-
Diminished = 11,
|
|
309
|
-
}
|
|
310
|
-
/**
|
|
311
|
-
* The [`Chord`] wrapper.
|
|
312
|
-
*/
|
|
313
|
-
export class KordChord {
|
|
314
|
-
free(): void;
|
|
315
|
-
/**
|
|
316
|
-
* Creates a new [`Chord`] from a frequency.
|
|
317
|
-
* @param {string} name
|
|
318
|
-
* @returns {KordChord}
|
|
319
|
-
*/
|
|
320
|
-
static parse(name: string): KordChord;
|
|
321
|
-
/**
|
|
322
|
-
* Creates a new [`Chord`] from a set of [`Note`]s.
|
|
323
|
-
*
|
|
324
|
-
* The [`Note`]s should be represented as a space-separated string.
|
|
325
|
-
* E.g., `C E G`.
|
|
326
|
-
* @param {string} notes
|
|
327
|
-
* @returns {Array<any>}
|
|
328
|
-
*/
|
|
329
|
-
static fromNotesString(notes: string): Array<any>;
|
|
330
|
-
/**
|
|
331
|
-
* Creates a new [`Chord`] from a set of [`Note`]s.
|
|
332
|
-
* @param {Array<any>} notes
|
|
333
|
-
* @returns {Array<any>}
|
|
334
|
-
*/
|
|
335
|
-
static fromNotes(notes: Array<any>): Array<any>;
|
|
336
|
-
/**
|
|
337
|
-
* Returns the [`Chord`]'s friendly name.
|
|
338
|
-
* @returns {string}
|
|
339
|
-
*/
|
|
340
|
-
name(): string;
|
|
341
|
-
/**
|
|
342
|
-
* Returns the [`Chord`]'s precise name.
|
|
343
|
-
* @returns {string}
|
|
344
|
-
*/
|
|
345
|
-
preciseName(): string;
|
|
346
|
-
/**
|
|
347
|
-
* Returns the [`Chord`] as a string (same as `precise_name`).
|
|
348
|
-
* @returns {string}
|
|
349
|
-
*/
|
|
350
|
-
toString(): string;
|
|
351
|
-
/**
|
|
352
|
-
* Returns the [`Chord`]'s description.
|
|
353
|
-
* @returns {string}
|
|
354
|
-
*/
|
|
355
|
-
description(): string;
|
|
356
|
-
/**
|
|
357
|
-
* Returns the [`Chord`]'s display text.
|
|
358
|
-
* @returns {string}
|
|
359
|
-
*/
|
|
360
|
-
display(): string;
|
|
361
|
-
/**
|
|
362
|
-
* Returns the [`Chord`]'s root note.
|
|
363
|
-
* @returns {string}
|
|
364
|
-
*/
|
|
365
|
-
root(): string;
|
|
366
|
-
/**
|
|
367
|
-
* Returns the [`Chord`]'s slash note.
|
|
368
|
-
* @returns {string}
|
|
369
|
-
*/
|
|
370
|
-
slash(): string;
|
|
371
|
-
/**
|
|
372
|
-
* Returns the [`Chord`]'s inversion.
|
|
373
|
-
* @returns {number}
|
|
374
|
-
*/
|
|
375
|
-
inversion(): number;
|
|
376
|
-
/**
|
|
377
|
-
* Returns whether or not the [`Chord`] is "crunchy".
|
|
378
|
-
* @returns {boolean}
|
|
379
|
-
*/
|
|
380
|
-
isCrunchy(): boolean;
|
|
381
|
-
/**
|
|
382
|
-
* Returns the [`Chord`]'s chord tones.
|
|
383
|
-
* @returns {Array<any>}
|
|
384
|
-
*/
|
|
385
|
-
chord(): Array<any>;
|
|
386
|
-
/**
|
|
387
|
-
* Returns the [`Chord`]'s chord tones as a string.
|
|
388
|
-
* @returns {string}
|
|
389
|
-
*/
|
|
390
|
-
chordString(): string;
|
|
391
|
-
/**
|
|
392
|
-
* Returns the [`Chord`]'s scale tones.
|
|
393
|
-
* @returns {Array<any>}
|
|
394
|
-
*/
|
|
395
|
-
scale(): Array<any>;
|
|
396
|
-
/**
|
|
397
|
-
* Returns the [`Chord`]'s scale tones as a string.
|
|
398
|
-
* @returns {string}
|
|
399
|
-
*/
|
|
400
|
-
scaleString(): string;
|
|
401
|
-
/**
|
|
402
|
-
* Returns the [`Chord`]'s modifiers.
|
|
403
|
-
* @returns {Array<any>}
|
|
404
|
-
*/
|
|
405
|
-
modifiers(): Array<any>;
|
|
406
|
-
/**
|
|
407
|
-
* Returns the [`Chord`]'s extensions.
|
|
408
|
-
* @returns {Array<any>}
|
|
409
|
-
*/
|
|
410
|
-
extensions(): Array<any>;
|
|
411
|
-
/**
|
|
412
|
-
* Returns a new [`Chord`] with the inversion set to the provided value.
|
|
413
|
-
* @param {number} inversion
|
|
414
|
-
* @returns {KordChord}
|
|
415
|
-
*/
|
|
416
|
-
withInversion(inversion: number): KordChord;
|
|
417
|
-
/**
|
|
418
|
-
* Returns a new [`Chord`] with the slash set to the provided value.
|
|
419
|
-
* @param {KordNote} slash
|
|
420
|
-
* @returns {KordChord}
|
|
421
|
-
*/
|
|
422
|
-
withSlash(slash: KordNote): KordChord;
|
|
423
|
-
/**
|
|
424
|
-
* Returns a new [`Chord`] with the octave of the root set to the provided value.
|
|
425
|
-
* @param {number} octave
|
|
426
|
-
* @returns {KordChord}
|
|
427
|
-
*/
|
|
428
|
-
withOctave(octave: number): KordChord;
|
|
429
|
-
/**
|
|
430
|
-
* Returns a new [`Chord`] with the "crunchiness" set to the provided value.
|
|
431
|
-
* @param {boolean} is_crunchy
|
|
432
|
-
* @returns {KordChord}
|
|
433
|
-
*/
|
|
434
|
-
withCrunchy(is_crunchy: boolean): KordChord;
|
|
435
|
-
/**
|
|
436
|
-
* Plays the [`Chord`].
|
|
437
|
-
* @param {number} delay
|
|
438
|
-
* @param {number} length
|
|
439
|
-
* @param {number} fade_in
|
|
440
|
-
* @returns {Promise<void>}
|
|
441
|
-
*/
|
|
442
|
-
play(delay: number, length: number, fade_in: number): Promise<void>;
|
|
443
|
-
/**
|
|
444
|
-
* Returns the clone of the [`Chord`].
|
|
445
|
-
* @returns {KordChord}
|
|
446
|
-
*/
|
|
447
|
-
copy(): KordChord;
|
|
448
|
-
/**
|
|
449
|
-
* Returns a new [`Chord`] with the `minor` modifier.
|
|
450
|
-
* @returns {KordChord}
|
|
451
|
-
*/
|
|
452
|
-
minor(): KordChord;
|
|
453
|
-
/**
|
|
454
|
-
* Returns a new [`Chord`] with the `flat5` modifier.
|
|
455
|
-
* @returns {KordChord}
|
|
456
|
-
*/
|
|
457
|
-
flat5(): KordChord;
|
|
458
|
-
/**
|
|
459
|
-
* Returns a new [`Chord`] with the `augmented` modifier.
|
|
460
|
-
* @returns {KordChord}
|
|
461
|
-
*/
|
|
462
|
-
aug(): KordChord;
|
|
463
|
-
/**
|
|
464
|
-
* Returns a new [`Chord`] with the `maj7` modifier.
|
|
465
|
-
* @returns {KordChord}
|
|
466
|
-
*/
|
|
467
|
-
maj7(): KordChord;
|
|
468
|
-
/**
|
|
469
|
-
* Returns a new [`Chord`] with the `dom7` modifier.
|
|
470
|
-
* @returns {KordChord}
|
|
471
|
-
*/
|
|
472
|
-
seven(): KordChord;
|
|
473
|
-
/**
|
|
474
|
-
* Returns a new [`Chord`] with the `dom9` modifier.
|
|
475
|
-
* @returns {KordChord}
|
|
476
|
-
*/
|
|
477
|
-
nine(): KordChord;
|
|
478
|
-
/**
|
|
479
|
-
* Returns a new [`Chord`] with the `dom11` modifier.
|
|
480
|
-
* @returns {KordChord}
|
|
481
|
-
*/
|
|
482
|
-
eleven(): KordChord;
|
|
483
|
-
/**
|
|
484
|
-
* Returns a new [`Chord`] with the `dom13` modifier.
|
|
485
|
-
* @returns {KordChord}
|
|
486
|
-
*/
|
|
487
|
-
thirteen(): KordChord;
|
|
488
|
-
/**
|
|
489
|
-
* Returns a new [`Chord`] with the `flat9` modifier.
|
|
490
|
-
* @returns {KordChord}
|
|
491
|
-
*/
|
|
492
|
-
flat9(): KordChord;
|
|
493
|
-
/**
|
|
494
|
-
* Returns a new [`Chord`] with the `sharp9` modifier.
|
|
495
|
-
* @returns {KordChord}
|
|
496
|
-
*/
|
|
497
|
-
sharp9(): KordChord;
|
|
498
|
-
/**
|
|
499
|
-
* Returns a new [`Chord`] with the `sharp11` modifier.
|
|
500
|
-
* @returns {KordChord}
|
|
501
|
-
*/
|
|
502
|
-
sharp11(): KordChord;
|
|
503
|
-
/**
|
|
504
|
-
* Returns a new [`Chord`] with the `dim` modifier.
|
|
505
|
-
* @returns {KordChord}
|
|
506
|
-
*/
|
|
507
|
-
dim(): KordChord;
|
|
508
|
-
/**
|
|
509
|
-
* Returns a new [`Chord`] with the `halfDim` modifier.
|
|
510
|
-
* @returns {KordChord}
|
|
511
|
-
*/
|
|
512
|
-
halfDim(): KordChord;
|
|
513
|
-
/**
|
|
514
|
-
* Returns a new [`Chord`] with the `sus2` extension.
|
|
515
|
-
* @returns {KordChord}
|
|
516
|
-
*/
|
|
517
|
-
sus2(): KordChord;
|
|
518
|
-
/**
|
|
519
|
-
* Returns a new [`Chord`] with the `sus4` extension.
|
|
520
|
-
* @returns {KordChord}
|
|
521
|
-
*/
|
|
522
|
-
sus4(): KordChord;
|
|
523
|
-
/**
|
|
524
|
-
* Returns a new [`Chord`] with the `flat11` extension.
|
|
525
|
-
* @returns {KordChord}
|
|
526
|
-
*/
|
|
527
|
-
flat11(): KordChord;
|
|
528
|
-
/**
|
|
529
|
-
* Returns a new [`Chord`] with the `flat13` extension.
|
|
530
|
-
* @returns {KordChord}
|
|
531
|
-
*/
|
|
532
|
-
flat13(): KordChord;
|
|
533
|
-
/**
|
|
534
|
-
* Returns a new [`Chord`] with the `sharp13` extension.
|
|
535
|
-
* @returns {KordChord}
|
|
536
|
-
*/
|
|
537
|
-
sharp13(): KordChord;
|
|
538
|
-
/**
|
|
539
|
-
* Returns a new [`Chord`] with the `add2` extension.
|
|
540
|
-
* @returns {KordChord}
|
|
541
|
-
*/
|
|
542
|
-
add2(): KordChord;
|
|
543
|
-
/**
|
|
544
|
-
* Returns a new [`Chord`] with the `add4` extension.
|
|
545
|
-
* @returns {KordChord}
|
|
546
|
-
*/
|
|
547
|
-
add4(): KordChord;
|
|
548
|
-
/**
|
|
549
|
-
* Returns a new [`Chord`] with the `add6` extension.
|
|
550
|
-
* @returns {KordChord}
|
|
551
|
-
*/
|
|
552
|
-
add6(): KordChord;
|
|
553
|
-
/**
|
|
554
|
-
* Returns a new [`Chord`] with the `add9` extension.
|
|
555
|
-
* @returns {KordChord}
|
|
556
|
-
*/
|
|
557
|
-
add9(): KordChord;
|
|
558
|
-
/**
|
|
559
|
-
* Returns a new [`Chord`] with the `add11` extension.
|
|
560
|
-
* @returns {KordChord}
|
|
561
|
-
*/
|
|
562
|
-
add11(): KordChord;
|
|
563
|
-
/**
|
|
564
|
-
* Returns a new [`Chord`] with the `add13` extension.
|
|
565
|
-
* @returns {KordChord}
|
|
566
|
-
*/
|
|
567
|
-
add13(): KordChord;
|
|
568
|
-
}
|
|
569
|
-
/**
|
|
570
|
-
* The [`Note`] wrapper.
|
|
571
|
-
*/
|
|
572
|
-
export class KordNote {
|
|
573
|
-
free(): void;
|
|
574
|
-
/**
|
|
575
|
-
* Creates a new [`Note`] from a frequency.
|
|
576
|
-
* @param {string} name
|
|
577
|
-
* @returns {KordNote}
|
|
578
|
-
*/
|
|
579
|
-
static parse(name: string): KordNote;
|
|
580
|
-
/**
|
|
581
|
-
* Returns [`Note`]s from audio data.
|
|
582
|
-
* @param {Float32Array} data
|
|
583
|
-
* @param {number} length_in_seconds
|
|
584
|
-
* @returns {Array<any>}
|
|
585
|
-
*/
|
|
586
|
-
static fromAudio(data: Float32Array, length_in_seconds: number): Array<any>;
|
|
587
|
-
/**
|
|
588
|
-
* Returns [`Note`]s from audio data using the ML inference algorithm.
|
|
589
|
-
* @param {Float32Array} data
|
|
590
|
-
* @param {number} length_in_seconds
|
|
591
|
-
* @returns {Array<any>}
|
|
592
|
-
*/
|
|
593
|
-
static fromAudioMl(data: Float32Array, length_in_seconds: number): Array<any>;
|
|
594
|
-
/**
|
|
595
|
-
* Returns the [`Note`]'s friendly name.
|
|
596
|
-
* @returns {string}
|
|
597
|
-
*/
|
|
598
|
-
name(): string;
|
|
599
|
-
/**
|
|
600
|
-
* Returns the [`Note`] represented as a string (same as `name`).
|
|
601
|
-
* @returns {string}
|
|
602
|
-
*/
|
|
603
|
-
toString(): string;
|
|
604
|
-
/**
|
|
605
|
-
* Returns the [`Note`]'s [`NamedPitch`].
|
|
606
|
-
* @returns {string}
|
|
607
|
-
*/
|
|
608
|
-
pitch(): string;
|
|
609
|
-
/**
|
|
610
|
-
* Returns the [`Note`]'s [`Octave`].
|
|
611
|
-
* @returns {number}
|
|
612
|
-
*/
|
|
613
|
-
octave(): number;
|
|
614
|
-
/**
|
|
615
|
-
* Returns the [`Note`]'s frequency.
|
|
616
|
-
* @returns {number}
|
|
617
|
-
*/
|
|
618
|
-
frequency(): number;
|
|
619
|
-
/**
|
|
620
|
-
* Adds the given interval to the [`Note`], producing a new [`Note`] instance.
|
|
621
|
-
* @param {number} interval
|
|
622
|
-
* @returns {KordNote}
|
|
623
|
-
*/
|
|
624
|
-
addInterval(interval: number): KordNote;
|
|
625
|
-
/**
|
|
626
|
-
* Subtracts the given interval from the [`Note`], producing a new [`Note`] instance.
|
|
627
|
-
* @param {number} interval
|
|
628
|
-
* @returns {KordNote}
|
|
629
|
-
*/
|
|
630
|
-
subInterval(interval: number): KordNote;
|
|
631
|
-
/**
|
|
632
|
-
* Computes the [`Interval`] distance between the [`Note`] and the given [`Note`].
|
|
633
|
-
* @param {KordNote} other
|
|
634
|
-
* @returns {number}
|
|
635
|
-
*/
|
|
636
|
-
distanceTo(other: KordNote): number;
|
|
637
|
-
/**
|
|
638
|
-
* Returns the primary (first 13) harmonic series of the [`Note`].
|
|
639
|
-
* @returns {Array<any>}
|
|
640
|
-
*/
|
|
641
|
-
harmonicSeries(): Array<any>;
|
|
642
|
-
/**
|
|
643
|
-
* Returns the clone of the [`Note`].
|
|
644
|
-
* @returns {KordNote}
|
|
645
|
-
*/
|
|
646
|
-
copy(): KordNote;
|
|
647
|
-
}
|
|
648
|
-
/**
|
|
649
|
-
* A handle to a [`Chord`] playback.
|
|
650
|
-
*
|
|
651
|
-
* Should be dropped to stop the playback, or after playback is finished.
|
|
652
|
-
*/
|
|
653
|
-
export class KordPlaybackHandle {
|
|
654
|
-
free(): void;
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
658
|
-
|
|
659
|
-
export interface InitOutput {
|
|
660
|
-
readonly memory: WebAssembly.Memory;
|
|
661
|
-
readonly __wbg_kordnote_free: (a: number) => void;
|
|
662
|
-
readonly kordnote_parse: (a: number, b: number, c: number) => void;
|
|
663
|
-
readonly kordnote_fromAudio: (a: number, b: number, c: number, d: number) => void;
|
|
664
|
-
readonly kordnote_fromAudioMl: (a: number, b: number, c: number, d: number) => void;
|
|
665
|
-
readonly kordnote_name: (a: number, b: number) => void;
|
|
666
|
-
readonly kordnote_toString: (a: number, b: number) => void;
|
|
667
|
-
readonly kordnote_pitch: (a: number, b: number) => void;
|
|
668
|
-
readonly kordnote_octave: (a: number) => number;
|
|
669
|
-
readonly kordnote_frequency: (a: number) => number;
|
|
670
|
-
readonly kordnote_addInterval: (a: number, b: number) => number;
|
|
671
|
-
readonly kordnote_subInterval: (a: number, b: number) => number;
|
|
672
|
-
readonly kordnote_distanceTo: (a: number, b: number) => number;
|
|
673
|
-
readonly kordnote_harmonicSeries: (a: number) => number;
|
|
674
|
-
readonly kordnote_copy: (a: number) => number;
|
|
675
|
-
readonly __wbg_kordchord_free: (a: number) => void;
|
|
676
|
-
readonly kordchord_parse: (a: number, b: number, c: number) => void;
|
|
677
|
-
readonly kordchord_fromNotesString: (a: number, b: number, c: number) => void;
|
|
678
|
-
readonly kordchord_fromNotes: (a: number, b: number) => void;
|
|
679
|
-
readonly kordchord_name: (a: number, b: number) => void;
|
|
680
|
-
readonly kordchord_preciseName: (a: number, b: number) => void;
|
|
681
|
-
readonly kordchord_description: (a: number, b: number) => void;
|
|
682
|
-
readonly kordchord_display: (a: number, b: number) => void;
|
|
683
|
-
readonly kordchord_root: (a: number, b: number) => void;
|
|
684
|
-
readonly kordchord_slash: (a: number, b: number) => void;
|
|
685
|
-
readonly kordchord_inversion: (a: number) => number;
|
|
686
|
-
readonly kordchord_isCrunchy: (a: number) => number;
|
|
687
|
-
readonly kordchord_chord: (a: number) => number;
|
|
688
|
-
readonly kordchord_chordString: (a: number, b: number) => void;
|
|
689
|
-
readonly kordchord_scale: (a: number) => number;
|
|
690
|
-
readonly kordchord_scaleString: (a: number, b: number) => void;
|
|
691
|
-
readonly kordchord_modifiers: (a: number) => number;
|
|
692
|
-
readonly kordchord_extensions: (a: number) => number;
|
|
693
|
-
readonly kordchord_withInversion: (a: number, b: number) => number;
|
|
694
|
-
readonly kordchord_withSlash: (a: number, b: number) => number;
|
|
695
|
-
readonly kordchord_withOctave: (a: number, b: number, c: number) => void;
|
|
696
|
-
readonly kordchord_withCrunchy: (a: number, b: number) => number;
|
|
697
|
-
readonly kordchord_play: (a: number, b: number, c: number, d: number) => number;
|
|
698
|
-
readonly kordchord_copy: (a: number) => number;
|
|
699
|
-
readonly __wbg_kordplaybackhandle_free: (a: number) => void;
|
|
700
|
-
readonly kordchord_minor: (a: number) => number;
|
|
701
|
-
readonly kordchord_flat5: (a: number) => number;
|
|
702
|
-
readonly kordchord_aug: (a: number) => number;
|
|
703
|
-
readonly kordchord_maj7: (a: number) => number;
|
|
704
|
-
readonly kordchord_seven: (a: number) => number;
|
|
705
|
-
readonly kordchord_nine: (a: number) => number;
|
|
706
|
-
readonly kordchord_eleven: (a: number) => number;
|
|
707
|
-
readonly kordchord_thirteen: (a: number) => number;
|
|
708
|
-
readonly kordchord_flat9: (a: number) => number;
|
|
709
|
-
readonly kordchord_sharp9: (a: number) => number;
|
|
710
|
-
readonly kordchord_sharp11: (a: number) => number;
|
|
711
|
-
readonly kordchord_dim: (a: number) => number;
|
|
712
|
-
readonly kordchord_halfDim: (a: number) => number;
|
|
713
|
-
readonly kordchord_sus2: (a: number) => number;
|
|
714
|
-
readonly kordchord_sus4: (a: number) => number;
|
|
715
|
-
readonly kordchord_flat11: (a: number) => number;
|
|
716
|
-
readonly kordchord_flat13: (a: number) => number;
|
|
717
|
-
readonly kordchord_sharp13: (a: number) => number;
|
|
718
|
-
readonly kordchord_add2: (a: number) => number;
|
|
719
|
-
readonly kordchord_add4: (a: number) => number;
|
|
720
|
-
readonly kordchord_add6: (a: number) => number;
|
|
721
|
-
readonly kordchord_add9: (a: number) => number;
|
|
722
|
-
readonly kordchord_add11: (a: number) => number;
|
|
723
|
-
readonly kordchord_add13: (a: number) => number;
|
|
724
|
-
readonly main: () => void;
|
|
725
|
-
readonly kordchord_toString: (a: number, b: number) => void;
|
|
726
|
-
readonly __wbindgen_malloc: (a: number) => number;
|
|
727
|
-
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
|
728
|
-
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
729
|
-
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4bf4f1a270d9cb63: (a: number, b: number, c: number) => void;
|
|
730
|
-
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__haff74cc1bdcde5c1: (a: number, b: number) => void;
|
|
731
|
-
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hfb32af8e4ede5824: (a: number, b: number) => void;
|
|
732
|
-
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
733
|
-
readonly __wbindgen_free: (a: number, b: number) => void;
|
|
734
|
-
readonly __wbindgen_exn_store: (a: number) => void;
|
|
735
|
-
readonly wasm_bindgen__convert__closures__invoke2_mut__h2d4abc1ddedd8c19: (a: number, b: number, c: number, d: number) => void;
|
|
736
|
-
readonly __wbindgen_start: () => void;
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
740
|
-
/**
|
|
741
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
742
|
-
* a precompiled `WebAssembly.Module`.
|
|
743
|
-
*
|
|
744
|
-
* @param {SyncInitInput} module
|
|
745
|
-
*
|
|
746
|
-
* @returns {InitOutput}
|
|
747
|
-
*/
|
|
748
|
-
export function initSync(module: SyncInitInput): InitOutput;
|
|
749
|
-
|
|
750
|
-
/**
|
|
751
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
752
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
753
|
-
*
|
|
754
|
-
* @param {InitInput | Promise<InitInput>} module_or_path
|
|
755
|
-
*
|
|
756
|
-
* @returns {Promise<InitOutput>}
|
|
757
|
-
*/
|
|
758
|
-
export default function init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
|