kordweb 0.5.4 → 0.5.6
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 +39 -1
- package/klib.d.ts +401 -69
- package/klib.js +618 -204
- package/klib_bg.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
# kord
|
|
11
11
|
|
|
12
|
-
A music theory binary and library for Rust ([capability playground](https://kord.twitchax.com/)).
|
|
12
|
+
A music theory binary and library for Rust / JS (via WASM) ([capability playground](https://kord.twitchax.com/)).
|
|
13
13
|
|
|
14
14
|
## Binary Usage
|
|
15
15
|
|
|
@@ -44,6 +44,12 @@ Cargo:
|
|
|
44
44
|
$ cargo install kord
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
+
NPM:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
$ npm install --save kordweb
|
|
51
|
+
```
|
|
52
|
+
|
|
47
53
|
### Help Docs
|
|
48
54
|
|
|
49
55
|
```bash
|
|
@@ -193,6 +199,38 @@ use klib::chord::*;
|
|
|
193
199
|
assert_eq!(C.into_chord().augmented().major7().chord(), vec![C, E, GSharp, B]);
|
|
194
200
|
```
|
|
195
201
|
|
|
202
|
+
## JS Usage
|
|
203
|
+
|
|
204
|
+
The npm package is available [here](https://www.npmjs.com/package/kordweb).
|
|
205
|
+
|
|
206
|
+
First, load the module as you would any other ES module.
|
|
207
|
+
|
|
208
|
+
```js
|
|
209
|
+
import init, { KordNote, KordChord } from 'kordweb/klib.js';
|
|
210
|
+
|
|
211
|
+
// Run `init` once.
|
|
212
|
+
await init();
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Then, you can use the library similarly as you would in Rust.
|
|
216
|
+
|
|
217
|
+
```js
|
|
218
|
+
// Create a note.
|
|
219
|
+
const note = KordNote.parse('C4');
|
|
220
|
+
|
|
221
|
+
note.name(); // C4
|
|
222
|
+
note.octave(); // 4
|
|
223
|
+
|
|
224
|
+
// Create a chord.
|
|
225
|
+
const chord = KordChord.parse('C7#9');
|
|
226
|
+
|
|
227
|
+
chord.name(); // C7(♯9)
|
|
228
|
+
chord.chordString(); // C4 E4 G4 Bb5 D#5
|
|
229
|
+
|
|
230
|
+
// Easy chaining.
|
|
231
|
+
KordChord.parse("C7b9").withOctave(2).chord().map(n => n.name()); // [ 'C2', 'D♭2', 'E2', 'G2', 'B♭2' ]
|
|
232
|
+
```
|
|
233
|
+
|
|
196
234
|
## Feature Flags
|
|
197
235
|
|
|
198
236
|
The library and binary both support various feature flags. Of most important note are:
|
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
|
+
* The chord modifiers.
|
|
206
|
+
*/
|
|
207
|
+
export enum KordModifier {
|
|
208
|
+
/**
|
|
209
|
+
* Minor modifier.
|
|
210
|
+
*/
|
|
211
|
+
Minor = 0,
|
|
212
|
+
/**
|
|
213
|
+
* Flat 5 modifier.
|
|
214
|
+
*/
|
|
215
|
+
Flat5 = 1,
|
|
216
|
+
/**
|
|
217
|
+
* Sharp 5 modifier.
|
|
218
|
+
*/
|
|
219
|
+
Augmented5 = 2,
|
|
220
|
+
/**
|
|
221
|
+
* Major 7 modifier.
|
|
222
|
+
*/
|
|
223
|
+
Major7 = 3,
|
|
224
|
+
/**
|
|
225
|
+
* Dominant 7 modifier.
|
|
226
|
+
*/
|
|
227
|
+
Dominant7 = 4,
|
|
228
|
+
/**
|
|
229
|
+
* Dominant 9 modifier.
|
|
230
|
+
*/
|
|
231
|
+
Dominant9 = 5,
|
|
232
|
+
/**
|
|
233
|
+
* Dominant 11 modifier.
|
|
234
|
+
*/
|
|
235
|
+
Dominant11 = 6,
|
|
236
|
+
/**
|
|
237
|
+
* Dominant 13 modifier.
|
|
238
|
+
*/
|
|
239
|
+
Dominant13 = 7,
|
|
240
|
+
/**
|
|
241
|
+
* Flat 9 modifier.
|
|
242
|
+
*/
|
|
243
|
+
Flat9 = 8,
|
|
244
|
+
/**
|
|
245
|
+
* Sharp 9 modifier.
|
|
246
|
+
*/
|
|
247
|
+
Sharp9 = 9,
|
|
248
|
+
/**
|
|
249
|
+
* Sharp 11 modifier.
|
|
250
|
+
*/
|
|
251
|
+
Sharp11 = 10,
|
|
252
|
+
/**
|
|
253
|
+
* Diminished modifier.
|
|
254
|
+
*/
|
|
255
|
+
Diminished = 11,
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* An enum representing the extension of a chord.
|
|
259
|
+
*
|
|
260
|
+
* Extensions are not really "special" in the sense that they do not change how the
|
|
261
|
+
* chord is interpreted by the system. E.g., an `add2` just adds a 2 to the chord,
|
|
262
|
+
* and the chord is still interpreted as a major chord.
|
|
263
|
+
*/
|
|
264
|
+
export enum KordExtension {
|
|
265
|
+
/**
|
|
266
|
+
* Sus2 extension.
|
|
267
|
+
*/
|
|
268
|
+
Sus2 = 0,
|
|
269
|
+
/**
|
|
270
|
+
* Sus4 extension.
|
|
271
|
+
*/
|
|
272
|
+
Sus4 = 1,
|
|
273
|
+
/**
|
|
274
|
+
* Flat 11 extension.
|
|
275
|
+
*/
|
|
276
|
+
Flat11 = 2,
|
|
277
|
+
/**
|
|
278
|
+
* Flat 13 extension.
|
|
279
|
+
*/
|
|
280
|
+
Flat13 = 3,
|
|
281
|
+
/**
|
|
282
|
+
* Sharp 13 extension.
|
|
283
|
+
*/
|
|
284
|
+
Sharp13 = 4,
|
|
285
|
+
/**
|
|
286
|
+
* Add2 extension.
|
|
287
|
+
*/
|
|
288
|
+
Add2 = 5,
|
|
289
|
+
/**
|
|
290
|
+
* Add4 extension.
|
|
291
|
+
*/
|
|
292
|
+
Add4 = 6,
|
|
293
|
+
/**
|
|
294
|
+
* Add6 extension.
|
|
295
|
+
*/
|
|
296
|
+
Add6 = 7,
|
|
297
|
+
/**
|
|
298
|
+
* Add9 extension.
|
|
299
|
+
*/
|
|
300
|
+
Add9 = 8,
|
|
301
|
+
/**
|
|
302
|
+
* Add11 extension.
|
|
303
|
+
*/
|
|
304
|
+
Add11 = 9,
|
|
305
|
+
/**
|
|
306
|
+
* Add13 extension.
|
|
307
|
+
*/
|
|
308
|
+
Add13 = 10,
|
|
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
|
|
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
|
|
335
|
+
static fromNotes(notes: Array<any>): Array<any>;
|
|
29
336
|
/**
|
|
30
337
|
* Returns the [`Chord`]'s friendly name.
|
|
31
338
|
* @returns {string}
|
|
@@ -35,7 +342,12 @@ export class KordChord {
|
|
|
35
342
|
* Returns the [`Chord`]'s precise name.
|
|
36
343
|
* @returns {string}
|
|
37
344
|
*/
|
|
38
|
-
|
|
345
|
+
preciseName(): string;
|
|
346
|
+
/**
|
|
347
|
+
* Returns the [`Chord`] as a string (same as `precise_name`).
|
|
348
|
+
* @returns {string}
|
|
349
|
+
*/
|
|
350
|
+
toString(): string;
|
|
39
351
|
/**
|
|
40
352
|
* Returns the [`Chord`]'s description.
|
|
41
353
|
* @returns {string}
|
|
@@ -65,56 +377,74 @@ export class KordChord {
|
|
|
65
377
|
* Returns whether or not the [`Chord`] is "crunchy".
|
|
66
378
|
* @returns {boolean}
|
|
67
379
|
*/
|
|
68
|
-
|
|
380
|
+
isCrunchy(): boolean;
|
|
69
381
|
/**
|
|
70
382
|
* Returns the [`Chord`]'s chord tones.
|
|
71
|
-
* @returns {
|
|
383
|
+
* @returns {Array<any>}
|
|
72
384
|
*/
|
|
73
|
-
chord():
|
|
385
|
+
chord(): Array<any>;
|
|
74
386
|
/**
|
|
75
387
|
* Returns the [`Chord`]'s chord tones as a string.
|
|
76
388
|
* @returns {string}
|
|
77
389
|
*/
|
|
78
|
-
|
|
390
|
+
chordString(): string;
|
|
79
391
|
/**
|
|
80
392
|
* Returns the [`Chord`]'s scale tones.
|
|
81
|
-
* @returns {
|
|
393
|
+
* @returns {Array<any>}
|
|
82
394
|
*/
|
|
83
|
-
scale():
|
|
395
|
+
scale(): Array<any>;
|
|
84
396
|
/**
|
|
85
397
|
* Returns the [`Chord`]'s scale tones as a string.
|
|
86
398
|
* @returns {string}
|
|
87
399
|
*/
|
|
88
|
-
|
|
400
|
+
scaleString(): string;
|
|
89
401
|
/**
|
|
90
|
-
*
|
|
91
|
-
* @
|
|
92
|
-
* @param {number} length
|
|
93
|
-
* @param {number} fade_in
|
|
94
|
-
* @returns {Promise<void>}
|
|
402
|
+
* Returns the [`Chord`]'s modifiers.
|
|
403
|
+
* @returns {Array<any>}
|
|
95
404
|
*/
|
|
96
|
-
|
|
97
|
-
}
|
|
405
|
+
modifiers(): Array<any>;
|
|
98
406
|
/**
|
|
99
|
-
*
|
|
407
|
+
* Returns the [`Chord`]'s extensions.
|
|
408
|
+
* @returns {Array<any>}
|
|
100
409
|
*/
|
|
101
|
-
|
|
102
|
-
free(): void;
|
|
410
|
+
extensions(): Array<any>;
|
|
103
411
|
/**
|
|
104
|
-
*
|
|
105
|
-
* @param {number}
|
|
106
|
-
* @returns {KordChord
|
|
412
|
+
* Returns a new [`Chord`] with the inversion set to the provided value.
|
|
413
|
+
* @param {number} inversion
|
|
414
|
+
* @returns {KordChord}
|
|
107
415
|
*/
|
|
108
|
-
|
|
416
|
+
withInversion(inversion: number): KordChord;
|
|
109
417
|
/**
|
|
110
|
-
* Returns
|
|
111
|
-
* @
|
|
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}
|
|
112
427
|
*/
|
|
113
|
-
|
|
428
|
+
withOctave(octave: number): KordChord;
|
|
114
429
|
/**
|
|
115
|
-
* Returns
|
|
430
|
+
* Returns a new [`Chord`] with the "crunchiness" 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}
|
|
116
446
|
*/
|
|
117
|
-
|
|
447
|
+
copy(): KordChord;
|
|
118
448
|
}
|
|
119
449
|
/**
|
|
120
450
|
* The [`Note`] wrapper.
|
|
@@ -131,22 +461,27 @@ export class KordNote {
|
|
|
131
461
|
* Returns [`Note`]s from audio data.
|
|
132
462
|
* @param {Float32Array} data
|
|
133
463
|
* @param {number} length_in_seconds
|
|
134
|
-
* @returns {
|
|
464
|
+
* @returns {Array<any>}
|
|
135
465
|
*/
|
|
136
|
-
static
|
|
466
|
+
static fromAudio(data: Float32Array, length_in_seconds: number): Array<any>;
|
|
137
467
|
/**
|
|
138
468
|
* Returns [`Note`]s from audio data using the ML inference algorithm.
|
|
139
469
|
* @param {Float32Array} data
|
|
140
470
|
* @param {number} length_in_seconds
|
|
141
|
-
* @returns {
|
|
471
|
+
* @returns {Array<any>}
|
|
142
472
|
*/
|
|
143
|
-
static
|
|
473
|
+
static fromAudioMl(data: Float32Array, length_in_seconds: number): Array<any>;
|
|
144
474
|
/**
|
|
145
475
|
* Returns the [`Note`]'s friendly name.
|
|
146
476
|
* @returns {string}
|
|
147
477
|
*/
|
|
148
478
|
name(): string;
|
|
149
479
|
/**
|
|
480
|
+
* Returns the [`Note`] represented as a string (same as `name`).
|
|
481
|
+
* @returns {string}
|
|
482
|
+
*/
|
|
483
|
+
toString(): string;
|
|
484
|
+
/**
|
|
150
485
|
* Returns the [`Note`]'s [`NamedPitch`].
|
|
151
486
|
* @returns {string}
|
|
152
487
|
*/
|
|
@@ -161,27 +496,19 @@ export class KordNote {
|
|
|
161
496
|
* @returns {number}
|
|
162
497
|
*/
|
|
163
498
|
frequency(): number;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* The [`Note`]s wrapper.
|
|
167
|
-
*/
|
|
168
|
-
export class KordNotes {
|
|
169
|
-
free(): void;
|
|
170
|
-
/**
|
|
171
|
-
* Gets an item from the collection.
|
|
172
|
-
* @param {number} index
|
|
173
|
-
* @returns {KordNote | undefined}
|
|
174
|
-
*/
|
|
175
|
-
get(index: number): KordNote | undefined;
|
|
176
499
|
/**
|
|
177
|
-
*
|
|
178
|
-
*
|
|
500
|
+
* Adds the given interval to the [`Note`].
|
|
501
|
+
*
|
|
502
|
+
* Clones the underlying note before mutation, producing a _new_ [`KordNote`].
|
|
503
|
+
* @param {number} interval
|
|
504
|
+
* @returns {KordNote}
|
|
179
505
|
*/
|
|
180
|
-
|
|
506
|
+
addInterval(interval: number): KordNote;
|
|
181
507
|
/**
|
|
182
|
-
* Returns the
|
|
508
|
+
* Returns the clone of the [`Note`].
|
|
509
|
+
* @returns {KordNote}
|
|
183
510
|
*/
|
|
184
|
-
|
|
511
|
+
copy(): KordNote;
|
|
185
512
|
}
|
|
186
513
|
|
|
187
514
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
@@ -190,37 +517,41 @@ export interface InitOutput {
|
|
|
190
517
|
readonly memory: WebAssembly.Memory;
|
|
191
518
|
readonly __wbg_kordnote_free: (a: number) => void;
|
|
192
519
|
readonly kordnote_parse: (a: number, b: number, c: number) => void;
|
|
193
|
-
readonly
|
|
194
|
-
readonly
|
|
520
|
+
readonly kordnote_fromAudio: (a: number, b: number, c: number, d: number) => void;
|
|
521
|
+
readonly kordnote_fromAudioMl: (a: number, b: number, c: number, d: number) => void;
|
|
195
522
|
readonly kordnote_name: (a: number, b: number) => void;
|
|
523
|
+
readonly kordnote_toString: (a: number, b: number) => void;
|
|
196
524
|
readonly kordnote_pitch: (a: number, b: number) => void;
|
|
197
525
|
readonly kordnote_octave: (a: number) => number;
|
|
198
526
|
readonly kordnote_frequency: (a: number) => number;
|
|
199
|
-
readonly
|
|
200
|
-
readonly
|
|
201
|
-
readonly kordnotes_to_string: (a: number, b: number) => void;
|
|
527
|
+
readonly kordnote_addInterval: (a: number, b: number, c: number) => void;
|
|
528
|
+
readonly kordnote_copy: (a: number) => number;
|
|
202
529
|
readonly __wbg_kordchord_free: (a: number) => void;
|
|
203
530
|
readonly kordchord_parse: (a: number, b: number, c: number) => void;
|
|
204
|
-
readonly
|
|
205
|
-
readonly
|
|
531
|
+
readonly kordchord_fromNotesString: (a: number, b: number, c: number) => void;
|
|
532
|
+
readonly kordchord_fromNotes: (a: number, b: number) => void;
|
|
206
533
|
readonly kordchord_name: (a: number, b: number) => void;
|
|
207
|
-
readonly
|
|
534
|
+
readonly kordchord_preciseName: (a: number, b: number) => void;
|
|
208
535
|
readonly kordchord_description: (a: number, b: number) => void;
|
|
209
536
|
readonly kordchord_display: (a: number, b: number) => void;
|
|
210
537
|
readonly kordchord_root: (a: number, b: number) => void;
|
|
211
538
|
readonly kordchord_slash: (a: number, b: number) => void;
|
|
212
539
|
readonly kordchord_inversion: (a: number) => number;
|
|
213
|
-
readonly
|
|
540
|
+
readonly kordchord_isCrunchy: (a: number) => number;
|
|
214
541
|
readonly kordchord_chord: (a: number) => number;
|
|
215
|
-
readonly
|
|
542
|
+
readonly kordchord_chordString: (a: number, b: number) => void;
|
|
216
543
|
readonly kordchord_scale: (a: number) => number;
|
|
217
|
-
readonly
|
|
544
|
+
readonly kordchord_scaleString: (a: number, b: number) => void;
|
|
545
|
+
readonly kordchord_modifiers: (a: number) => number;
|
|
546
|
+
readonly kordchord_extensions: (a: number) => number;
|
|
547
|
+
readonly kordchord_withInversion: (a: number, b: number) => number;
|
|
548
|
+
readonly kordchord_withSlash: (a: number, b: number) => number;
|
|
549
|
+
readonly kordchord_withOctave: (a: number, b: number, c: number) => void;
|
|
550
|
+
readonly kordchord_withCrunchy: (a: number, b: number) => number;
|
|
218
551
|
readonly kordchord_play: (a: number, b: number, c: number, d: number) => number;
|
|
219
|
-
readonly
|
|
220
|
-
readonly
|
|
221
|
-
readonly
|
|
222
|
-
readonly kordchords_to_string: (a: number, b: number) => void;
|
|
223
|
-
readonly kordnotes_length: (a: number) => number;
|
|
552
|
+
readonly kordchord_copy: (a: number) => number;
|
|
553
|
+
readonly kordchord_toString: (a: number, b: number) => void;
|
|
554
|
+
readonly main: () => void;
|
|
224
555
|
readonly __wbindgen_malloc: (a: number) => number;
|
|
225
556
|
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
|
226
557
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
@@ -230,6 +561,7 @@ export interface InitOutput {
|
|
|
230
561
|
readonly __wbindgen_free: (a: number, b: number) => void;
|
|
231
562
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
232
563
|
readonly wasm_bindgen__convert__closures__invoke2_mut__h768f6593dd414d73: (a: number, b: number, c: number, d: number) => void;
|
|
564
|
+
readonly __wbindgen_start: () => void;
|
|
233
565
|
}
|
|
234
566
|
|
|
235
567
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|