kordweb 0.7.0 → 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,
55
- }
56
- /**
57
- * An enum representing the extension of a chord.
58
- *
59
- * Extensions are not really "special" in the sense that they do not change how the
60
- * chord is interpreted by the system. E.g., an `add2` just adds a 2 to the chord,
61
- * and the chord is still interpreted as a major chord.
62
- */
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
+ */
63
10
  export enum KordExtension {
64
- /**
65
- * Sus2 extension.
66
- */
11
+ /**
12
+ * Sus2 extension.
13
+ */
67
14
  Sus2 = 0,
68
- /**
69
- * Sus4 extension.
70
- */
15
+ /**
16
+ * Sus4 extension.
17
+ */
71
18
  Sus4 = 1,
72
- /**
73
- * Flat 11 extension.
74
- */
19
+ /**
20
+ * Flat 11 extension.
21
+ */
75
22
  Flat11 = 2,
76
- /**
77
- * Flat 13 extension.
78
- */
79
- Flat13 = 3,
80
- /**
81
- * Sharp 13 extension.
82
- */
83
- Sharp13 = 4,
84
- /**
85
- * Add2 extension.
86
- */
87
- Add2 = 5,
88
- /**
89
- * Add4 extension.
90
- */
91
- Add4 = 6,
92
- /**
93
- * Add6 extension.
94
- */
95
- Add6 = 7,
96
- /**
97
- * Add9 extension.
98
- */
99
- Add9 = 8,
100
- /**
101
- * Add11 extension.
102
- */
103
- Add11 = 9,
104
- /**
105
- * Add13 extension.
106
- */
107
- Add13 = 10,
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,
108
51
  }
109
52
  /**
110
- * An enum representing the interval between two notes.
111
- */
53
+ * An enum representing the interval between two notes.
54
+ */
112
55
  export enum KordInterval {
113
- /**
114
- * A perfect unison interval.
115
- */
56
+ /**
57
+ * A perfect unison interval.
58
+ */
116
59
  PerfectUnison = 0,
117
- /**
118
- * A diminished second interval.
119
- */
60
+ /**
61
+ * A diminished second interval.
62
+ */
120
63
  DiminishedSecond = 1,
121
- /**
122
- * An augmented unison interval.
123
- */
64
+ /**
65
+ * An augmented unison interval.
66
+ */
124
67
  AugmentedUnison = 2,
125
- /**
126
- * A minor second interval.
127
- */
68
+ /**
69
+ * A minor second interval.
70
+ */
128
71
  MinorSecond = 3,
129
- /**
130
- * A major second interval.
131
- */
72
+ /**
73
+ * A major second interval.
74
+ */
132
75
  MajorSecond = 4,
133
- /**
134
- * A diminished third interval.
135
- */
76
+ /**
77
+ * A diminished third interval.
78
+ */
136
79
  DiminishedThird = 5,
137
- /**
138
- * An augmented second interval.
139
- */
80
+ /**
81
+ * An augmented second interval.
82
+ */
140
83
  AugmentedSecond = 6,
141
- /**
142
- * A minor third interval.
143
- */
84
+ /**
85
+ * A minor third interval.
86
+ */
144
87
  MinorThird = 7,
145
- /**
146
- * A major third interval.
147
- */
88
+ /**
89
+ * A major third interval.
90
+ */
148
91
  MajorThird = 8,
149
- /**
150
- * A diminished fourth interval.
151
- */
92
+ /**
93
+ * A diminished fourth interval.
94
+ */
152
95
  DiminishedFourth = 9,
153
- /**
154
- * An augmented third interval.
155
- */
96
+ /**
97
+ * An augmented third interval.
98
+ */
156
99
  AugmentedThird = 10,
157
- /**
158
- * A perfect fourth interval.
159
- */
100
+ /**
101
+ * A perfect fourth interval.
102
+ */
160
103
  PerfectFourth = 11,
161
- /**
162
- * An augmented fourth interval.
163
- */
104
+ /**
105
+ * An augmented fourth interval.
106
+ */
164
107
  AugmentedFourth = 12,
165
- /**
166
- * A diminished fifth interval.
167
- */
108
+ /**
109
+ * A diminished fifth interval.
110
+ */
168
111
  DiminishedFifth = 13,
169
- /**
170
- * A perfect fifth interval.
171
- */
112
+ /**
113
+ * A perfect fifth interval.
114
+ */
172
115
  PerfectFifth = 14,
173
- /**
174
- * A diminished sixth interval.
175
- */
116
+ /**
117
+ * A diminished sixth interval.
118
+ */
176
119
  DiminishedSixth = 15,
177
- /**
178
- * An augmented fifth interval.
179
- */
120
+ /**
121
+ * An augmented fifth interval.
122
+ */
180
123
  AugmentedFifth = 16,
181
- /**
182
- * A minor sixth interval.
183
- */
124
+ /**
125
+ * A minor sixth interval.
126
+ */
184
127
  MinorSixth = 17,
185
- /**
186
- * A major sixth interval.
187
- */
128
+ /**
129
+ * A major sixth interval.
130
+ */
188
131
  MajorSixth = 18,
189
- /**
190
- * A diminished seventh interval.
191
- */
132
+ /**
133
+ * A diminished seventh interval.
134
+ */
192
135
  DiminishedSeventh = 19,
193
- /**
194
- * An augmented sixth interval.
195
- */
136
+ /**
137
+ * An augmented sixth interval.
138
+ */
196
139
  AugmentedSixth = 20,
197
- /**
198
- * A minor seventh interval.
199
- */
140
+ /**
141
+ * A minor seventh interval.
142
+ */
200
143
  MinorSeventh = 21,
201
- /**
202
- * A major seventh interval.
203
- */
144
+ /**
145
+ * A major seventh interval.
146
+ */
204
147
  MajorSeventh = 22,
205
- /**
206
- * A diminished octave interval.
207
- */
148
+ /**
149
+ * A diminished octave interval.
150
+ */
208
151
  DiminishedOctave = 23,
209
- /**
210
- * An augmented seventh interval.
211
- */
152
+ /**
153
+ * An augmented seventh interval.
154
+ */
212
155
  AugmentedSeventh = 24,
213
- /**
214
- * A perfect octave interval.
215
- */
156
+ /**
157
+ * A perfect octave interval.
158
+ */
216
159
  PerfectOctave = 25,
217
- /**
218
- * An minor ninth interval.
219
- */
160
+ /**
161
+ * An minor ninth interval.
162
+ */
220
163
  MinorNinth = 26,
221
- /**
222
- * A major ninth interval.
223
- */
164
+ /**
165
+ * A major ninth interval.
166
+ */
224
167
  MajorNinth = 27,
225
- /**
226
- * An augmented ninth interval.
227
- */
168
+ /**
169
+ * An augmented ninth interval.
170
+ */
228
171
  AugmentedNinth = 28,
229
- /**
230
- * A diminished eleventh interval.
231
- */
172
+ /**
173
+ * A diminished eleventh interval.
174
+ */
232
175
  DiminishedEleventh = 29,
233
- /**
234
- * A perfect eleventh interval.
235
- */
176
+ /**
177
+ * A perfect eleventh interval.
178
+ */
236
179
  PerfectEleventh = 30,
237
- /**
238
- * An augmented eleventh interval.
239
- */
180
+ /**
181
+ * An augmented eleventh interval.
182
+ */
240
183
  AugmentedEleventh = 31,
241
- /**
242
- * A minor thirteenth interval.
243
- */
184
+ /**
185
+ * A minor thirteenth interval.
186
+ */
244
187
  MinorThirteenth = 32,
245
- /**
246
- * A major thirteenth interval.
247
- */
188
+ /**
189
+ * A major thirteenth interval.
190
+ */
248
191
  MajorThirteenth = 33,
249
- /**
250
- * An augmented thirteenth interval.
251
- */
192
+ /**
193
+ * An augmented thirteenth interval.
194
+ */
252
195
  AugmentedThirteenth = 34,
253
- /**
254
- * A perfect octave and perfect fifth interval.
255
- */
196
+ /**
197
+ * A perfect octave and perfect fifth interval.
198
+ */
256
199
  PerfectOctaveAndPerfectFifth = 35,
257
- /**
258
- * Two perfect octaves.
259
- */
200
+ /**
201
+ * Two perfect octaves.
202
+ */
260
203
  TwoPerfectOctaves = 36,
261
- /**
262
- * Two perfect octaves and a major third.
263
- */
204
+ /**
205
+ * Two perfect octaves and a major third.
206
+ */
264
207
  TwoPerfectOctavesAndMajorThird = 37,
265
- /**
266
- * Two perfect octaves and a perfect fifth.
267
- */
208
+ /**
209
+ * Two perfect octaves and a perfect fifth.
210
+ */
268
211
  TwoPerfectOctavesAndPerfectFifth = 38,
269
- /**
270
- * Two perfect octaves and a minor sixth.
271
- */
212
+ /**
213
+ * Two perfect octaves and a minor sixth.
214
+ */
272
215
  TwoPerfectOctavesAndMinorSeventh = 39,
273
- /**
274
- * Three perfect octaves.
275
- */
216
+ /**
217
+ * Three perfect octaves.
218
+ */
276
219
  ThreePerfectOctaves = 40,
277
- /**
278
- * Three perfect octaves and a major second.
279
- */
220
+ /**
221
+ * Three perfect octaves and a major second.
222
+ */
280
223
  ThreePerfectOctavesAndMajorSecond = 41,
281
- /**
282
- * Three perfect octaves and a major third.
283
- */
224
+ /**
225
+ * Three perfect octaves and a major third.
226
+ */
284
227
  ThreePerfectOctavesAndMajorThird = 42,
285
- /**
286
- * Three perfect octaves and an augmented fourth.
287
- */
228
+ /**
229
+ * Three perfect octaves and an augmented fourth.
230
+ */
288
231
  ThreePerfectOctavesAndAugmentedFourth = 43,
289
- /**
290
- * Three perfect octaves and a perfect fifth.
291
- */
232
+ /**
233
+ * Three perfect octaves and a perfect fifth.
234
+ */
292
235
  ThreePerfectOctavesAndPerfectFifth = 44,
293
- /**
294
- * Three perfect octaves and a minor sixth.
295
- */
236
+ /**
237
+ * Three perfect octaves and a minor sixth.
238
+ */
296
239
  ThreePerfectOctavesAndMinorSixth = 45,
297
- /**
298
- * Three perfect octaves and a minor seventh.
299
- */
240
+ /**
241
+ * Three perfect octaves and a minor seventh.
242
+ */
300
243
  ThreePerfectOctavesAndMinorSeventh = 46,
301
- /**
302
- * Three perfect octaves and a major seventh.
303
- */
244
+ /**
245
+ * Three perfect octaves and a major seventh.
246
+ */
304
247
  ThreePerfectOctavesAndMajorSeventh = 47,
305
248
  }
306
249
  /**
307
- * The [`Chord`] wrapper.
308
- */
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,
301
+ }
302
+ /**
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
  }