kordweb 0.7.1 → 0.8.1

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