kordweb 0.5.5 → 0.5.7
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 +42 -1
- package/klib.d.ts +510 -90
- package/klib.js +797 -361
- package/klib_bg.wasm +0 -0
- package/package.json +1 -1
package/klib.d.ts
CHANGED
|
@@ -1,6 +1,313 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
+
* The main entrypoint which sets up global state.
|
|
5
|
+
*/
|
|
6
|
+
export function main(): void;
|
|
7
|
+
/**
|
|
8
|
+
* An enum representing the interval between two notes.
|
|
9
|
+
*/
|
|
10
|
+
export enum KordInterval {
|
|
11
|
+
/**
|
|
12
|
+
* A perfect unison interval.
|
|
13
|
+
*/
|
|
14
|
+
PerfectUnison = 0,
|
|
15
|
+
/**
|
|
16
|
+
* A diminished second interval.
|
|
17
|
+
*/
|
|
18
|
+
DiminishedSecond = 1,
|
|
19
|
+
/**
|
|
20
|
+
* An augmented unison interval.
|
|
21
|
+
*/
|
|
22
|
+
AugmentedUnison = 2,
|
|
23
|
+
/**
|
|
24
|
+
* A minor second interval.
|
|
25
|
+
*/
|
|
26
|
+
MinorSecond = 3,
|
|
27
|
+
/**
|
|
28
|
+
* A major second interval.
|
|
29
|
+
*/
|
|
30
|
+
MajorSecond = 4,
|
|
31
|
+
/**
|
|
32
|
+
* A diminished third interval.
|
|
33
|
+
*/
|
|
34
|
+
DiminishedThird = 5,
|
|
35
|
+
/**
|
|
36
|
+
* An augmented second interval.
|
|
37
|
+
*/
|
|
38
|
+
AugmentedSecond = 6,
|
|
39
|
+
/**
|
|
40
|
+
* A minor third interval.
|
|
41
|
+
*/
|
|
42
|
+
MinorThird = 7,
|
|
43
|
+
/**
|
|
44
|
+
* A major third interval.
|
|
45
|
+
*/
|
|
46
|
+
MajorThird = 8,
|
|
47
|
+
/**
|
|
48
|
+
* A diminished fourth interval.
|
|
49
|
+
*/
|
|
50
|
+
DiminishedFourth = 9,
|
|
51
|
+
/**
|
|
52
|
+
* An augmented third interval.
|
|
53
|
+
*/
|
|
54
|
+
AugmentedThird = 10,
|
|
55
|
+
/**
|
|
56
|
+
* A perfect fourth interval.
|
|
57
|
+
*/
|
|
58
|
+
PerfectFourth = 11,
|
|
59
|
+
/**
|
|
60
|
+
* An augmented fourth interval.
|
|
61
|
+
*/
|
|
62
|
+
AugmentedFourth = 12,
|
|
63
|
+
/**
|
|
64
|
+
* A diminished fifth interval.
|
|
65
|
+
*/
|
|
66
|
+
DiminishedFifth = 13,
|
|
67
|
+
/**
|
|
68
|
+
* A perfect fifth interval.
|
|
69
|
+
*/
|
|
70
|
+
PerfectFifth = 14,
|
|
71
|
+
/**
|
|
72
|
+
* A diminished sixth interval.
|
|
73
|
+
*/
|
|
74
|
+
DiminishedSixth = 15,
|
|
75
|
+
/**
|
|
76
|
+
* An augmented fifth interval.
|
|
77
|
+
*/
|
|
78
|
+
AugmentedFifth = 16,
|
|
79
|
+
/**
|
|
80
|
+
* A minor sixth interval.
|
|
81
|
+
*/
|
|
82
|
+
MinorSixth = 17,
|
|
83
|
+
/**
|
|
84
|
+
* A major sixth interval.
|
|
85
|
+
*/
|
|
86
|
+
MajorSixth = 18,
|
|
87
|
+
/**
|
|
88
|
+
* A diminished seventh interval.
|
|
89
|
+
*/
|
|
90
|
+
DiminishedSeventh = 19,
|
|
91
|
+
/**
|
|
92
|
+
* An augmented sixth interval.
|
|
93
|
+
*/
|
|
94
|
+
AugmentedSixth = 20,
|
|
95
|
+
/**
|
|
96
|
+
* A minor seventh interval.
|
|
97
|
+
*/
|
|
98
|
+
MinorSeventh = 21,
|
|
99
|
+
/**
|
|
100
|
+
* A major seventh interval.
|
|
101
|
+
*/
|
|
102
|
+
MajorSeventh = 22,
|
|
103
|
+
/**
|
|
104
|
+
* A diminished octave interval.
|
|
105
|
+
*/
|
|
106
|
+
DiminishedOctave = 23,
|
|
107
|
+
/**
|
|
108
|
+
* An augmented seventh interval.
|
|
109
|
+
*/
|
|
110
|
+
AugmentedSeventh = 24,
|
|
111
|
+
/**
|
|
112
|
+
* A perfect octave interval.
|
|
113
|
+
*/
|
|
114
|
+
PerfectOctave = 25,
|
|
115
|
+
/**
|
|
116
|
+
* An minor ninth interval.
|
|
117
|
+
*/
|
|
118
|
+
MinorNinth = 26,
|
|
119
|
+
/**
|
|
120
|
+
* A major ninth interval.
|
|
121
|
+
*/
|
|
122
|
+
MajorNinth = 27,
|
|
123
|
+
/**
|
|
124
|
+
* An augmented ninth interval.
|
|
125
|
+
*/
|
|
126
|
+
AugmentedNinth = 28,
|
|
127
|
+
/**
|
|
128
|
+
* A diminished eleventh interval.
|
|
129
|
+
*/
|
|
130
|
+
DiminishedEleventh = 29,
|
|
131
|
+
/**
|
|
132
|
+
* A perfect eleventh interval.
|
|
133
|
+
*/
|
|
134
|
+
PerfectEleventh = 30,
|
|
135
|
+
/**
|
|
136
|
+
* An augmented eleventh interval.
|
|
137
|
+
*/
|
|
138
|
+
AugmentedEleventh = 31,
|
|
139
|
+
/**
|
|
140
|
+
* A minor thirteenth interval.
|
|
141
|
+
*/
|
|
142
|
+
MinorThirteenth = 32,
|
|
143
|
+
/**
|
|
144
|
+
* A major thirteenth interval.
|
|
145
|
+
*/
|
|
146
|
+
MajorThirteenth = 33,
|
|
147
|
+
/**
|
|
148
|
+
* An augmented thirteenth interval.
|
|
149
|
+
*/
|
|
150
|
+
AugmentedThirteenth = 34,
|
|
151
|
+
/**
|
|
152
|
+
* A perfect octave and perfect fifth interval.
|
|
153
|
+
*/
|
|
154
|
+
PerfectOctaveAndPerfectFifth = 35,
|
|
155
|
+
/**
|
|
156
|
+
* Two perfect octaves.
|
|
157
|
+
*/
|
|
158
|
+
TwoPerfectOctaves = 36,
|
|
159
|
+
/**
|
|
160
|
+
* Two perfect octaves and a major third.
|
|
161
|
+
*/
|
|
162
|
+
TwoPerfectOctavesAndMajorThird = 37,
|
|
163
|
+
/**
|
|
164
|
+
* Two perfect octaves and a perfect fifth.
|
|
165
|
+
*/
|
|
166
|
+
TwoPerfectOctavesAndPerfectFifth = 38,
|
|
167
|
+
/**
|
|
168
|
+
* Two perfect octaves and a minor sixth.
|
|
169
|
+
*/
|
|
170
|
+
TwoPerfectOctavesAndMinorSeventh = 39,
|
|
171
|
+
/**
|
|
172
|
+
* Three perfect octaves.
|
|
173
|
+
*/
|
|
174
|
+
ThreePerfectOctaves = 40,
|
|
175
|
+
/**
|
|
176
|
+
* Three perfect octaves and a major second.
|
|
177
|
+
*/
|
|
178
|
+
ThreePerfectOctavesAndMajorSecond = 41,
|
|
179
|
+
/**
|
|
180
|
+
* Three perfect octaves and a major third.
|
|
181
|
+
*/
|
|
182
|
+
ThreePerfectOctavesAndMajorThird = 42,
|
|
183
|
+
/**
|
|
184
|
+
* Three perfect octaves and an augmented fourth.
|
|
185
|
+
*/
|
|
186
|
+
ThreePerfectOctavesAndAugmentedFourth = 43,
|
|
187
|
+
/**
|
|
188
|
+
* Three perfect octaves and a perfect fifth.
|
|
189
|
+
*/
|
|
190
|
+
ThreePerfectOctavesAndPerfectFifth = 44,
|
|
191
|
+
/**
|
|
192
|
+
* Three perfect octaves and a minor sixth.
|
|
193
|
+
*/
|
|
194
|
+
ThreePerfectOctavesAndMinorSixth = 45,
|
|
195
|
+
/**
|
|
196
|
+
* Three perfect octaves and a minor seventh.
|
|
197
|
+
*/
|
|
198
|
+
ThreePerfectOctavesAndMinorSeventh = 46,
|
|
199
|
+
/**
|
|
200
|
+
* Three perfect octaves and a major seventh.
|
|
201
|
+
*/
|
|
202
|
+
ThreePerfectOctavesAndMajorSeventh = 47,
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* An enum representing the extension of a chord.
|
|
206
|
+
*
|
|
207
|
+
* Extensions are not really "special" in the sense that they do not change how the
|
|
208
|
+
* chord is interpreted by the system. E.g., an `add2` just adds a 2 to the chord,
|
|
209
|
+
* and the chord is still interpreted as a major chord.
|
|
210
|
+
*/
|
|
211
|
+
export enum KordExtension {
|
|
212
|
+
/**
|
|
213
|
+
* Sus2 extension.
|
|
214
|
+
*/
|
|
215
|
+
Sus2 = 0,
|
|
216
|
+
/**
|
|
217
|
+
* Sus4 extension.
|
|
218
|
+
*/
|
|
219
|
+
Sus4 = 1,
|
|
220
|
+
/**
|
|
221
|
+
* Flat 11 extension.
|
|
222
|
+
*/
|
|
223
|
+
Flat11 = 2,
|
|
224
|
+
/**
|
|
225
|
+
* Flat 13 extension.
|
|
226
|
+
*/
|
|
227
|
+
Flat13 = 3,
|
|
228
|
+
/**
|
|
229
|
+
* Sharp 13 extension.
|
|
230
|
+
*/
|
|
231
|
+
Sharp13 = 4,
|
|
232
|
+
/**
|
|
233
|
+
* Add2 extension.
|
|
234
|
+
*/
|
|
235
|
+
Add2 = 5,
|
|
236
|
+
/**
|
|
237
|
+
* Add4 extension.
|
|
238
|
+
*/
|
|
239
|
+
Add4 = 6,
|
|
240
|
+
/**
|
|
241
|
+
* Add6 extension.
|
|
242
|
+
*/
|
|
243
|
+
Add6 = 7,
|
|
244
|
+
/**
|
|
245
|
+
* Add9 extension.
|
|
246
|
+
*/
|
|
247
|
+
Add9 = 8,
|
|
248
|
+
/**
|
|
249
|
+
* Add11 extension.
|
|
250
|
+
*/
|
|
251
|
+
Add11 = 9,
|
|
252
|
+
/**
|
|
253
|
+
* Add13 extension.
|
|
254
|
+
*/
|
|
255
|
+
Add13 = 10,
|
|
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
|
+
/**
|
|
4
311
|
* The [`Chord`] wrapper.
|
|
5
312
|
*/
|
|
6
313
|
export class KordChord {
|
|
@@ -17,15 +324,15 @@ export class KordChord {
|
|
|
17
324
|
* The [`Note`]s should be represented as a space-separated string.
|
|
18
325
|
* E.g., `C E G`.
|
|
19
326
|
* @param {string} notes
|
|
20
|
-
* @returns {
|
|
327
|
+
* @returns {Array<any>}
|
|
21
328
|
*/
|
|
22
|
-
static fromNotesString(notes: string):
|
|
329
|
+
static fromNotesString(notes: string): Array<any>;
|
|
23
330
|
/**
|
|
24
331
|
* Creates a new [`Chord`] from a set of [`Note`]s.
|
|
25
|
-
* @param {
|
|
26
|
-
* @returns {
|
|
332
|
+
* @param {Array<any>} notes
|
|
333
|
+
* @returns {Array<any>}
|
|
27
334
|
*/
|
|
28
|
-
static fromNotes(notes:
|
|
335
|
+
static fromNotes(notes: Array<any>): Array<any>;
|
|
29
336
|
/**
|
|
30
337
|
* Returns the [`Chord`]'s friendly name.
|
|
31
338
|
* @returns {string}
|
|
@@ -73,9 +380,9 @@ export class KordChord {
|
|
|
73
380
|
isCrunchy(): boolean;
|
|
74
381
|
/**
|
|
75
382
|
* Returns the [`Chord`]'s chord tones.
|
|
76
|
-
* @returns {
|
|
383
|
+
* @returns {Array<any>}
|
|
77
384
|
*/
|
|
78
|
-
chord():
|
|
385
|
+
chord(): Array<any>;
|
|
79
386
|
/**
|
|
80
387
|
* Returns the [`Chord`]'s chord tones as a string.
|
|
81
388
|
* @returns {string}
|
|
@@ -83,15 +390,49 @@ export class KordChord {
|
|
|
83
390
|
chordString(): string;
|
|
84
391
|
/**
|
|
85
392
|
* Returns the [`Chord`]'s scale tones.
|
|
86
|
-
* @returns {
|
|
393
|
+
* @returns {Array<any>}
|
|
87
394
|
*/
|
|
88
|
-
scale():
|
|
395
|
+
scale(): Array<any>;
|
|
89
396
|
/**
|
|
90
397
|
* Returns the [`Chord`]'s scale tones as a string.
|
|
91
398
|
* @returns {string}
|
|
92
399
|
*/
|
|
93
400
|
scaleString(): string;
|
|
94
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
|
+
/**
|
|
95
436
|
* Plays the [`Chord`].
|
|
96
437
|
* @param {number} delay
|
|
97
438
|
* @param {number} length
|
|
@@ -99,48 +440,131 @@ export class KordChord {
|
|
|
99
440
|
* @returns {Promise<void>}
|
|
100
441
|
*/
|
|
101
442
|
play(delay: number, length: number, fade_in: number): Promise<void>;
|
|
102
|
-
}
|
|
103
443
|
/**
|
|
104
|
-
*
|
|
444
|
+
* Returns the clone of the [`Chord`].
|
|
445
|
+
* @returns {KordChord}
|
|
105
446
|
*/
|
|
106
|
-
|
|
107
|
-
free(): void;
|
|
447
|
+
copy(): KordChord;
|
|
108
448
|
/**
|
|
109
|
-
*
|
|
110
|
-
* @
|
|
111
|
-
* @returns {KordChord | undefined}
|
|
449
|
+
* Returns a new [`Chord`] with the `minor` modifier.
|
|
450
|
+
* @returns {KordChord}
|
|
112
451
|
*/
|
|
113
|
-
|
|
452
|
+
minor(): KordChord;
|
|
114
453
|
/**
|
|
115
|
-
* Returns
|
|
116
|
-
* @returns {
|
|
454
|
+
* Returns a new [`Chord`] with the `flat5` modifier.
|
|
455
|
+
* @returns {KordChord}
|
|
117
456
|
*/
|
|
118
|
-
|
|
457
|
+
flat5(): KordChord;
|
|
119
458
|
/**
|
|
120
|
-
* Returns
|
|
121
|
-
* @returns {
|
|
459
|
+
* Returns a new [`Chord`] with the `augmented` modifier.
|
|
460
|
+
* @returns {KordChord}
|
|
122
461
|
*/
|
|
123
|
-
|
|
462
|
+
aug(): KordChord;
|
|
124
463
|
/**
|
|
125
|
-
* Returns
|
|
126
|
-
* @returns {
|
|
464
|
+
* Returns a new [`Chord`] with the `maj7` modifier.
|
|
465
|
+
* @returns {KordChord}
|
|
127
466
|
*/
|
|
128
|
-
|
|
467
|
+
maj7(): KordChord;
|
|
129
468
|
/**
|
|
130
|
-
* Returns
|
|
469
|
+
* Returns a new [`Chord`] with the `dom7` modifier.
|
|
470
|
+
* @returns {KordChord}
|
|
131
471
|
*/
|
|
132
|
-
|
|
133
|
-
}
|
|
472
|
+
seven(): KordChord;
|
|
134
473
|
/**
|
|
135
|
-
*
|
|
474
|
+
* Returns a new [`Chord`] with the `dom9` modifier.
|
|
475
|
+
* @returns {KordChord}
|
|
136
476
|
*/
|
|
137
|
-
|
|
138
|
-
free(): void;
|
|
477
|
+
nine(): KordChord;
|
|
139
478
|
/**
|
|
140
|
-
*
|
|
141
|
-
* @returns {
|
|
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}
|
|
142
486
|
*/
|
|
143
|
-
|
|
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;
|
|
144
568
|
}
|
|
145
569
|
/**
|
|
146
570
|
* The [`Note`] wrapper.
|
|
@@ -157,16 +581,16 @@ export class KordNote {
|
|
|
157
581
|
* Returns [`Note`]s from audio data.
|
|
158
582
|
* @param {Float32Array} data
|
|
159
583
|
* @param {number} length_in_seconds
|
|
160
|
-
* @returns {
|
|
584
|
+
* @returns {Array<any>}
|
|
161
585
|
*/
|
|
162
|
-
static fromAudio(data: Float32Array, length_in_seconds: number):
|
|
586
|
+
static fromAudio(data: Float32Array, length_in_seconds: number): Array<any>;
|
|
163
587
|
/**
|
|
164
588
|
* Returns [`Note`]s from audio data using the ML inference algorithm.
|
|
165
589
|
* @param {Float32Array} data
|
|
166
590
|
* @param {number} length_in_seconds
|
|
167
|
-
* @returns {
|
|
591
|
+
* @returns {Array<any>}
|
|
168
592
|
*/
|
|
169
|
-
static fromAudioMl(data: Float32Array, length_in_seconds: number):
|
|
593
|
+
static fromAudioMl(data: Float32Array, length_in_seconds: number): Array<any>;
|
|
170
594
|
/**
|
|
171
595
|
* Returns the [`Note`]'s friendly name.
|
|
172
596
|
* @returns {string}
|
|
@@ -192,48 +616,24 @@ export class KordNote {
|
|
|
192
616
|
* @returns {number}
|
|
193
617
|
*/
|
|
194
618
|
frequency(): number;
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* The [`Note`]s wrapper.
|
|
198
|
-
*/
|
|
199
|
-
export class KordNotes {
|
|
200
|
-
free(): void;
|
|
201
|
-
/**
|
|
202
|
-
* Gets an item from the collection.
|
|
203
|
-
* @param {number} index
|
|
204
|
-
* @returns {KordNote | undefined}
|
|
205
|
-
*/
|
|
206
|
-
get(index: number): KordNote | undefined;
|
|
207
|
-
/**
|
|
208
|
-
* Returns the [`Note`]s as a space-separated string.
|
|
209
|
-
* @returns {string}
|
|
210
|
-
*/
|
|
211
|
-
toString(): string;
|
|
212
619
|
/**
|
|
213
|
-
*
|
|
214
|
-
*
|
|
620
|
+
* Adds the given interval to the [`Note`].
|
|
621
|
+
*
|
|
622
|
+
* Clones the underlying note before mutation, producing a _new_ [`KordNote`].
|
|
623
|
+
* @param {number} interval
|
|
624
|
+
* @returns {KordNote}
|
|
215
625
|
*/
|
|
216
|
-
|
|
626
|
+
addInterval(interval: number): KordNote;
|
|
217
627
|
/**
|
|
218
|
-
* Returns the [`Note`]
|
|
628
|
+
* Returns the primary (first 13) harmonic series of the [`Note`].
|
|
219
629
|
* @returns {Array<any>}
|
|
220
630
|
*/
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Returns the number of items in the collection.
|
|
224
|
-
*/
|
|
225
|
-
readonly length: number;
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* The [`Note`]s iterator.
|
|
229
|
-
*/
|
|
230
|
-
export class KordNotesIterator {
|
|
231
|
-
free(): void;
|
|
631
|
+
harmonicSeries(): Array<any>;
|
|
232
632
|
/**
|
|
233
|
-
*
|
|
234
|
-
* @returns {
|
|
633
|
+
* Returns the clone of the [`Note`].
|
|
634
|
+
* @returns {KordNote}
|
|
235
635
|
*/
|
|
236
|
-
|
|
636
|
+
copy(): KordNote;
|
|
237
637
|
}
|
|
238
638
|
|
|
239
639
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
@@ -249,13 +649,9 @@ export interface InitOutput {
|
|
|
249
649
|
readonly kordnote_pitch: (a: number, b: number) => void;
|
|
250
650
|
readonly kordnote_octave: (a: number) => number;
|
|
251
651
|
readonly kordnote_frequency: (a: number) => number;
|
|
252
|
-
readonly
|
|
253
|
-
readonly
|
|
254
|
-
readonly
|
|
255
|
-
readonly kordnotes_iterator: (a: number) => number;
|
|
256
|
-
readonly kordnotes_toArray: (a: number) => number;
|
|
257
|
-
readonly __wbg_kordnotesiterator_free: (a: number) => void;
|
|
258
|
-
readonly kordnotesiterator_next: (a: number, b: number) => void;
|
|
652
|
+
readonly kordnote_addInterval: (a: number, b: number, c: number) => void;
|
|
653
|
+
readonly kordnote_harmonicSeries: (a: number) => number;
|
|
654
|
+
readonly kordnote_copy: (a: number) => number;
|
|
259
655
|
readonly __wbg_kordchord_free: (a: number) => void;
|
|
260
656
|
readonly kordchord_parse: (a: number, b: number, c: number) => void;
|
|
261
657
|
readonly kordchord_fromNotesString: (a: number, b: number, c: number) => void;
|
|
@@ -272,17 +668,40 @@ export interface InitOutput {
|
|
|
272
668
|
readonly kordchord_chordString: (a: number, b: number) => void;
|
|
273
669
|
readonly kordchord_scale: (a: number) => number;
|
|
274
670
|
readonly kordchord_scaleString: (a: number, b: number) => void;
|
|
671
|
+
readonly kordchord_modifiers: (a: number) => number;
|
|
672
|
+
readonly kordchord_extensions: (a: number) => number;
|
|
673
|
+
readonly kordchord_withInversion: (a: number, b: number) => number;
|
|
674
|
+
readonly kordchord_withSlash: (a: number, b: number) => number;
|
|
675
|
+
readonly kordchord_withOctave: (a: number, b: number, c: number) => void;
|
|
676
|
+
readonly kordchord_withCrunchy: (a: number, b: number) => number;
|
|
275
677
|
readonly kordchord_play: (a: number, b: number, c: number, d: number) => number;
|
|
276
|
-
readonly
|
|
277
|
-
readonly
|
|
278
|
-
readonly
|
|
279
|
-
readonly
|
|
280
|
-
readonly
|
|
281
|
-
readonly
|
|
282
|
-
readonly
|
|
283
|
-
readonly
|
|
284
|
-
readonly
|
|
678
|
+
readonly kordchord_copy: (a: number) => number;
|
|
679
|
+
readonly kordchord_minor: (a: number) => number;
|
|
680
|
+
readonly kordchord_flat5: (a: number) => number;
|
|
681
|
+
readonly kordchord_aug: (a: number) => number;
|
|
682
|
+
readonly kordchord_maj7: (a: number) => number;
|
|
683
|
+
readonly kordchord_seven: (a: number) => number;
|
|
684
|
+
readonly kordchord_nine: (a: number) => number;
|
|
685
|
+
readonly kordchord_eleven: (a: number) => number;
|
|
686
|
+
readonly kordchord_thirteen: (a: number) => number;
|
|
687
|
+
readonly kordchord_flat9: (a: number) => number;
|
|
688
|
+
readonly kordchord_sharp9: (a: number) => number;
|
|
689
|
+
readonly kordchord_sharp11: (a: number) => number;
|
|
690
|
+
readonly kordchord_dim: (a: number) => number;
|
|
691
|
+
readonly kordchord_halfDim: (a: number) => number;
|
|
692
|
+
readonly kordchord_sus2: (a: number) => number;
|
|
693
|
+
readonly kordchord_sus4: (a: number) => number;
|
|
694
|
+
readonly kordchord_flat11: (a: number) => number;
|
|
695
|
+
readonly kordchord_flat13: (a: number) => number;
|
|
696
|
+
readonly kordchord_sharp13: (a: number) => number;
|
|
697
|
+
readonly kordchord_add2: (a: number) => number;
|
|
698
|
+
readonly kordchord_add4: (a: number) => number;
|
|
699
|
+
readonly kordchord_add6: (a: number) => number;
|
|
700
|
+
readonly kordchord_add9: (a: number) => number;
|
|
701
|
+
readonly kordchord_add11: (a: number) => number;
|
|
702
|
+
readonly kordchord_add13: (a: number) => number;
|
|
285
703
|
readonly kordchord_toString: (a: number, b: number) => void;
|
|
704
|
+
readonly main: () => void;
|
|
286
705
|
readonly __wbindgen_malloc: (a: number) => number;
|
|
287
706
|
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
|
288
707
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
@@ -292,6 +711,7 @@ export interface InitOutput {
|
|
|
292
711
|
readonly __wbindgen_free: (a: number, b: number) => void;
|
|
293
712
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
294
713
|
readonly wasm_bindgen__convert__closures__invoke2_mut__h768f6593dd414d73: (a: number, b: number, c: number, d: number) => void;
|
|
714
|
+
readonly __wbindgen_start: () => void;
|
|
295
715
|
}
|
|
296
716
|
|
|
297
717
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|