@algo-wasm/algo-wasm 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/LICENSE +661 -0
- package/NOTICE +15 -0
- package/README.md +36 -0
- package/dist/AlgoWasmError.d.ts +8 -0
- package/dist/AlgoWasmError.d.ts.map +1 -0
- package/dist/AlgoWasmError.js +9 -0
- package/dist/AlgoWasmError.js.map +1 -0
- package/dist/AlgoWasmPlayer.d.ts +48 -0
- package/dist/AlgoWasmPlayer.d.ts.map +1 -0
- package/dist/AlgoWasmPlayer.js +375 -0
- package/dist/AlgoWasmPlayer.js.map +1 -0
- package/dist/algo_wasm.wasm +0 -0
- package/dist/events.d.ts +9 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +25 -0
- package/dist/events.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/phaser.d.ts +11 -0
- package/dist/integrations/phaser.d.ts.map +1 -0
- package/dist/integrations/phaser.js +16 -0
- package/dist/integrations/phaser.js.map +1 -0
- package/dist/integrations/react.d.ts +8 -0
- package/dist/integrations/react.d.ts.map +1 -0
- package/dist/integrations/react.js +28 -0
- package/dist/integrations/react.js.map +1 -0
- package/dist/integrations/svelte.d.ts +7 -0
- package/dist/integrations/svelte.d.ts.map +1 -0
- package/dist/integrations/svelte.js +17 -0
- package/dist/integrations/svelte.js.map +1 -0
- package/dist/integrations/vue.d.ts +8 -0
- package/dist/integrations/vue.d.ts.map +1 -0
- package/dist/integrations/vue.js +16 -0
- package/dist/integrations/vue.js.map +1 -0
- package/dist/loadWasm.d.ts +47 -0
- package/dist/loadWasm.d.ts.map +1 -0
- package/dist/loadWasm.js +229 -0
- package/dist/loadWasm.js.map +1 -0
- package/dist/profile-schema.json +464 -0
- package/dist/profile.d.ts +15 -0
- package/dist/profile.d.ts.map +1 -0
- package/dist/profile.js +525 -0
- package/dist/profile.js.map +1 -0
- package/dist/types.d.ts +189 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/worklet/algo-worklet.d.ts +83 -0
- package/dist/worklet/algo-worklet.d.ts.map +1 -0
- package/dist/worklet/algo-worklet.js +471 -0
- package/dist/worklet/algo-worklet.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://algo-wasm.invalid/schema/profile.schema.json",
|
|
4
|
+
"title": "AlgoWASM profile",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"id",
|
|
9
|
+
"displayName",
|
|
10
|
+
"version",
|
|
11
|
+
"tempo",
|
|
12
|
+
"scales",
|
|
13
|
+
"chordRules",
|
|
14
|
+
"rhythmRules",
|
|
15
|
+
"bassRules",
|
|
16
|
+
"melodyRules",
|
|
17
|
+
"arrangementRules",
|
|
18
|
+
"automationRules",
|
|
19
|
+
"patches",
|
|
20
|
+
"mixer",
|
|
21
|
+
"limits"
|
|
22
|
+
],
|
|
23
|
+
"properties": {
|
|
24
|
+
"id": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"minLength": 1
|
|
27
|
+
},
|
|
28
|
+
"displayName": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"minLength": 1
|
|
31
|
+
},
|
|
32
|
+
"version": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"minLength": 1
|
|
35
|
+
},
|
|
36
|
+
"tempo": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"required": [
|
|
39
|
+
"minBpm",
|
|
40
|
+
"maxBpm",
|
|
41
|
+
"defaultBpm"
|
|
42
|
+
],
|
|
43
|
+
"properties": {
|
|
44
|
+
"minBpm": {
|
|
45
|
+
"type": "number",
|
|
46
|
+
"minimum": 40
|
|
47
|
+
},
|
|
48
|
+
"maxBpm": {
|
|
49
|
+
"type": "number",
|
|
50
|
+
"maximum": 240
|
|
51
|
+
},
|
|
52
|
+
"defaultBpm": {
|
|
53
|
+
"type": "number"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"additionalProperties": false
|
|
57
|
+
},
|
|
58
|
+
"scales": {
|
|
59
|
+
"type": "array",
|
|
60
|
+
"minItems": 1,
|
|
61
|
+
"items": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"required": [
|
|
64
|
+
"name",
|
|
65
|
+
"weight"
|
|
66
|
+
],
|
|
67
|
+
"properties": {
|
|
68
|
+
"name": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"minLength": 1
|
|
71
|
+
},
|
|
72
|
+
"weight": {
|
|
73
|
+
"type": "integer",
|
|
74
|
+
"minimum": 1
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"additionalProperties": false
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"chordRules": {
|
|
81
|
+
"$ref": "#/$defs/chordRules"
|
|
82
|
+
},
|
|
83
|
+
"rhythmRules": {
|
|
84
|
+
"$ref": "#/$defs/rhythmRules"
|
|
85
|
+
},
|
|
86
|
+
"bassRules": {
|
|
87
|
+
"$ref": "#/$defs/bassRules"
|
|
88
|
+
},
|
|
89
|
+
"melodyRules": {
|
|
90
|
+
"$ref": "#/$defs/melodyRules"
|
|
91
|
+
},
|
|
92
|
+
"arrangementRules": {
|
|
93
|
+
"$ref": "#/$defs/arrangementRules"
|
|
94
|
+
},
|
|
95
|
+
"automationRules": {
|
|
96
|
+
"$ref": "#/$defs/automationRules"
|
|
97
|
+
},
|
|
98
|
+
"patches": {
|
|
99
|
+
"type": "array",
|
|
100
|
+
"minItems": 11,
|
|
101
|
+
"maxItems": 11,
|
|
102
|
+
"items": {
|
|
103
|
+
"$ref": "#/$defs/patch"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"mixer": {
|
|
107
|
+
"$ref": "#/$defs/mixer"
|
|
108
|
+
},
|
|
109
|
+
"limits": {
|
|
110
|
+
"$ref": "#/$defs/limits"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"$defs": {
|
|
114
|
+
"unit": {
|
|
115
|
+
"type": "number",
|
|
116
|
+
"minimum": 0,
|
|
117
|
+
"maximum": 1
|
|
118
|
+
},
|
|
119
|
+
"pan": {
|
|
120
|
+
"type": "number",
|
|
121
|
+
"minimum": -1,
|
|
122
|
+
"maximum": 1
|
|
123
|
+
},
|
|
124
|
+
"gain": {
|
|
125
|
+
"type": "number",
|
|
126
|
+
"minimum": 0,
|
|
127
|
+
"maximum": 2
|
|
128
|
+
},
|
|
129
|
+
"trackId": {
|
|
130
|
+
"enum": [
|
|
131
|
+
"kick",
|
|
132
|
+
"snare",
|
|
133
|
+
"closed_hat",
|
|
134
|
+
"open_hat",
|
|
135
|
+
"percussion",
|
|
136
|
+
"bass",
|
|
137
|
+
"chords",
|
|
138
|
+
"pad",
|
|
139
|
+
"lead",
|
|
140
|
+
"arp",
|
|
141
|
+
"fx"
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
"wave": {
|
|
145
|
+
"enum": [
|
|
146
|
+
"sine",
|
|
147
|
+
"triangle",
|
|
148
|
+
"saw",
|
|
149
|
+
"square",
|
|
150
|
+
"pulse",
|
|
151
|
+
"noise"
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
"chordRules": {
|
|
155
|
+
"type": "object",
|
|
156
|
+
"required": [
|
|
157
|
+
"cadenceWeight",
|
|
158
|
+
"movementWeight",
|
|
159
|
+
"suspendedChance",
|
|
160
|
+
"brightBorrowChance"
|
|
161
|
+
],
|
|
162
|
+
"properties": {
|
|
163
|
+
"cadenceWeight": {
|
|
164
|
+
"$ref": "#/$defs/unit"
|
|
165
|
+
},
|
|
166
|
+
"movementWeight": {
|
|
167
|
+
"$ref": "#/$defs/unit"
|
|
168
|
+
},
|
|
169
|
+
"suspendedChance": {
|
|
170
|
+
"$ref": "#/$defs/unit"
|
|
171
|
+
},
|
|
172
|
+
"brightBorrowChance": {
|
|
173
|
+
"$ref": "#/$defs/unit"
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"additionalProperties": false
|
|
177
|
+
},
|
|
178
|
+
"rhythmRules": {
|
|
179
|
+
"type": "object",
|
|
180
|
+
"required": [
|
|
181
|
+
"kickDensity",
|
|
182
|
+
"hatDensity",
|
|
183
|
+
"percussionDensity",
|
|
184
|
+
"fillChance"
|
|
185
|
+
],
|
|
186
|
+
"properties": {
|
|
187
|
+
"kickDensity": {
|
|
188
|
+
"$ref": "#/$defs/unit"
|
|
189
|
+
},
|
|
190
|
+
"hatDensity": {
|
|
191
|
+
"$ref": "#/$defs/unit"
|
|
192
|
+
},
|
|
193
|
+
"percussionDensity": {
|
|
194
|
+
"$ref": "#/$defs/unit"
|
|
195
|
+
},
|
|
196
|
+
"fillChance": {
|
|
197
|
+
"$ref": "#/$defs/unit"
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"additionalProperties": false
|
|
201
|
+
},
|
|
202
|
+
"bassRules": {
|
|
203
|
+
"type": "object",
|
|
204
|
+
"required": [
|
|
205
|
+
"density",
|
|
206
|
+
"slideChance",
|
|
207
|
+
"accentChance",
|
|
208
|
+
"octaveJumpChance"
|
|
209
|
+
],
|
|
210
|
+
"properties": {
|
|
211
|
+
"density": {
|
|
212
|
+
"$ref": "#/$defs/unit"
|
|
213
|
+
},
|
|
214
|
+
"slideChance": {
|
|
215
|
+
"$ref": "#/$defs/unit"
|
|
216
|
+
},
|
|
217
|
+
"accentChance": {
|
|
218
|
+
"$ref": "#/$defs/unit"
|
|
219
|
+
},
|
|
220
|
+
"octaveJumpChance": {
|
|
221
|
+
"$ref": "#/$defs/unit"
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"additionalProperties": false
|
|
225
|
+
},
|
|
226
|
+
"melodyRules": {
|
|
227
|
+
"type": "object",
|
|
228
|
+
"required": [
|
|
229
|
+
"density",
|
|
230
|
+
"mutationChance",
|
|
231
|
+
"callResponseChance",
|
|
232
|
+
"maxRangeSemitones"
|
|
233
|
+
],
|
|
234
|
+
"properties": {
|
|
235
|
+
"density": {
|
|
236
|
+
"$ref": "#/$defs/unit"
|
|
237
|
+
},
|
|
238
|
+
"mutationChance": {
|
|
239
|
+
"$ref": "#/$defs/unit"
|
|
240
|
+
},
|
|
241
|
+
"callResponseChance": {
|
|
242
|
+
"$ref": "#/$defs/unit"
|
|
243
|
+
},
|
|
244
|
+
"maxRangeSemitones": {
|
|
245
|
+
"type": "integer",
|
|
246
|
+
"minimum": 1,
|
|
247
|
+
"maximum": 36
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
"additionalProperties": false
|
|
251
|
+
},
|
|
252
|
+
"arrangementRules": {
|
|
253
|
+
"type": "object",
|
|
254
|
+
"required": [
|
|
255
|
+
"minSectionBars",
|
|
256
|
+
"maxSectionBars",
|
|
257
|
+
"futureBars",
|
|
258
|
+
"resetChance"
|
|
259
|
+
],
|
|
260
|
+
"properties": {
|
|
261
|
+
"minSectionBars": {
|
|
262
|
+
"type": "integer",
|
|
263
|
+
"minimum": 1
|
|
264
|
+
},
|
|
265
|
+
"maxSectionBars": {
|
|
266
|
+
"type": "integer",
|
|
267
|
+
"minimum": 1,
|
|
268
|
+
"maximum": 64
|
|
269
|
+
},
|
|
270
|
+
"futureBars": {
|
|
271
|
+
"type": "integer",
|
|
272
|
+
"minimum": 1,
|
|
273
|
+
"maximum": 64
|
|
274
|
+
},
|
|
275
|
+
"resetChance": {
|
|
276
|
+
"$ref": "#/$defs/unit"
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
"additionalProperties": false
|
|
280
|
+
},
|
|
281
|
+
"automationRules": {
|
|
282
|
+
"type": "object",
|
|
283
|
+
"required": [
|
|
284
|
+
"filterMotion",
|
|
285
|
+
"sendMotion",
|
|
286
|
+
"panMotion"
|
|
287
|
+
],
|
|
288
|
+
"properties": {
|
|
289
|
+
"filterMotion": {
|
|
290
|
+
"$ref": "#/$defs/unit"
|
|
291
|
+
},
|
|
292
|
+
"sendMotion": {
|
|
293
|
+
"$ref": "#/$defs/unit"
|
|
294
|
+
},
|
|
295
|
+
"panMotion": {
|
|
296
|
+
"$ref": "#/$defs/unit"
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
"additionalProperties": false
|
|
300
|
+
},
|
|
301
|
+
"patch": {
|
|
302
|
+
"type": "object",
|
|
303
|
+
"required": [
|
|
304
|
+
"track",
|
|
305
|
+
"wave",
|
|
306
|
+
"gain",
|
|
307
|
+
"pan",
|
|
308
|
+
"attackMs",
|
|
309
|
+
"decayMs",
|
|
310
|
+
"sustain",
|
|
311
|
+
"releaseMs",
|
|
312
|
+
"filterCutoff",
|
|
313
|
+
"resonance",
|
|
314
|
+
"delaySend",
|
|
315
|
+
"reverbSend"
|
|
316
|
+
],
|
|
317
|
+
"properties": {
|
|
318
|
+
"track": {
|
|
319
|
+
"$ref": "#/$defs/trackId"
|
|
320
|
+
},
|
|
321
|
+
"wave": {
|
|
322
|
+
"$ref": "#/$defs/wave"
|
|
323
|
+
},
|
|
324
|
+
"gain": {
|
|
325
|
+
"$ref": "#/$defs/gain"
|
|
326
|
+
},
|
|
327
|
+
"pan": {
|
|
328
|
+
"$ref": "#/$defs/pan"
|
|
329
|
+
},
|
|
330
|
+
"attackMs": {
|
|
331
|
+
"type": "number",
|
|
332
|
+
"minimum": 0
|
|
333
|
+
},
|
|
334
|
+
"decayMs": {
|
|
335
|
+
"type": "number",
|
|
336
|
+
"minimum": 0
|
|
337
|
+
},
|
|
338
|
+
"sustain": {
|
|
339
|
+
"$ref": "#/$defs/unit"
|
|
340
|
+
},
|
|
341
|
+
"releaseMs": {
|
|
342
|
+
"type": "number",
|
|
343
|
+
"minimum": 0
|
|
344
|
+
},
|
|
345
|
+
"filterCutoff": {
|
|
346
|
+
"type": "number",
|
|
347
|
+
"minimum": 20,
|
|
348
|
+
"maximum": 20000
|
|
349
|
+
},
|
|
350
|
+
"resonance": {
|
|
351
|
+
"$ref": "#/$defs/unit"
|
|
352
|
+
},
|
|
353
|
+
"delaySend": {
|
|
354
|
+
"$ref": "#/$defs/unit"
|
|
355
|
+
},
|
|
356
|
+
"reverbSend": {
|
|
357
|
+
"$ref": "#/$defs/unit"
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
"additionalProperties": false
|
|
361
|
+
},
|
|
362
|
+
"mixer": {
|
|
363
|
+
"type": "object",
|
|
364
|
+
"required": [
|
|
365
|
+
"masterGain",
|
|
366
|
+
"limiterDrive",
|
|
367
|
+
"delayFeedback",
|
|
368
|
+
"reverbMix",
|
|
369
|
+
"tracks"
|
|
370
|
+
],
|
|
371
|
+
"properties": {
|
|
372
|
+
"masterGain": {
|
|
373
|
+
"$ref": "#/$defs/gain"
|
|
374
|
+
},
|
|
375
|
+
"limiterDrive": {
|
|
376
|
+
"$ref": "#/$defs/gain"
|
|
377
|
+
},
|
|
378
|
+
"delayFeedback": {
|
|
379
|
+
"$ref": "#/$defs/unit"
|
|
380
|
+
},
|
|
381
|
+
"reverbMix": {
|
|
382
|
+
"$ref": "#/$defs/unit"
|
|
383
|
+
},
|
|
384
|
+
"tracks": {
|
|
385
|
+
"type": "array",
|
|
386
|
+
"minItems": 11,
|
|
387
|
+
"maxItems": 11,
|
|
388
|
+
"items": {
|
|
389
|
+
"type": "object",
|
|
390
|
+
"required": [
|
|
391
|
+
"track",
|
|
392
|
+
"gain",
|
|
393
|
+
"pan"
|
|
394
|
+
],
|
|
395
|
+
"properties": {
|
|
396
|
+
"track": {
|
|
397
|
+
"$ref": "#/$defs/trackId"
|
|
398
|
+
},
|
|
399
|
+
"gain": {
|
|
400
|
+
"$ref": "#/$defs/gain"
|
|
401
|
+
},
|
|
402
|
+
"pan": {
|
|
403
|
+
"$ref": "#/$defs/pan"
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
"additionalProperties": false
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
},
|
|
410
|
+
"additionalProperties": false
|
|
411
|
+
},
|
|
412
|
+
"limits": {
|
|
413
|
+
"type": "object",
|
|
414
|
+
"required": [
|
|
415
|
+
"minSampleRate",
|
|
416
|
+
"maxSampleRate",
|
|
417
|
+
"minBpm",
|
|
418
|
+
"maxBpm",
|
|
419
|
+
"maxTracks",
|
|
420
|
+
"maxVoices",
|
|
421
|
+
"maxBarsQueued",
|
|
422
|
+
"maxEventsPerBlock"
|
|
423
|
+
],
|
|
424
|
+
"properties": {
|
|
425
|
+
"minSampleRate": {
|
|
426
|
+
"type": "integer",
|
|
427
|
+
"minimum": 22050
|
|
428
|
+
},
|
|
429
|
+
"maxSampleRate": {
|
|
430
|
+
"type": "integer",
|
|
431
|
+
"maximum": 96000
|
|
432
|
+
},
|
|
433
|
+
"minBpm": {
|
|
434
|
+
"type": "number",
|
|
435
|
+
"minimum": 40
|
|
436
|
+
},
|
|
437
|
+
"maxBpm": {
|
|
438
|
+
"type": "number",
|
|
439
|
+
"maximum": 240
|
|
440
|
+
},
|
|
441
|
+
"maxTracks": {
|
|
442
|
+
"type": "integer",
|
|
443
|
+
"const": 11
|
|
444
|
+
},
|
|
445
|
+
"maxVoices": {
|
|
446
|
+
"type": "integer",
|
|
447
|
+
"minimum": 1,
|
|
448
|
+
"maximum": 64
|
|
449
|
+
},
|
|
450
|
+
"maxBarsQueued": {
|
|
451
|
+
"type": "integer",
|
|
452
|
+
"minimum": 1,
|
|
453
|
+
"maximum": 64
|
|
454
|
+
},
|
|
455
|
+
"maxEventsPerBlock": {
|
|
456
|
+
"type": "integer",
|
|
457
|
+
"minimum": 1,
|
|
458
|
+
"maximum": 512
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
"additionalProperties": false
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AlgoWasmProfile } from './types.js';
|
|
2
|
+
export declare const trackIds: readonly ["kick", "snare", "closed_hat", "open_hat", "percussion", "bass", "chords", "pad", "lead", "arp", "fx"];
|
|
3
|
+
export declare const builtInProfiles: {
|
|
4
|
+
amigaHouse95ish(): AlgoWasmProfile;
|
|
5
|
+
downtempoBreakbeat(): AlgoWasmProfile;
|
|
6
|
+
dubDeepHouse(): AlgoWasmProfile;
|
|
7
|
+
};
|
|
8
|
+
export declare function cloneProfile(profile: AlgoWasmProfile): AlgoWasmProfile;
|
|
9
|
+
export declare function validateProfile(profile: unknown): AlgoWasmProfile;
|
|
10
|
+
export declare function normaliseSeed(seed: bigint | number | string | undefined): bigint;
|
|
11
|
+
export declare function splitSeed(seed: bigint): {
|
|
12
|
+
high: number;
|
|
13
|
+
low: number;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAsC,MAAM,YAAY,CAAC;AAEtF,eAAO,MAAM,QAAQ,kHAY0B,CAAC;AAIhD,eAAO,MAAM,eAAe;uBACP,eAAe;0BAGZ,eAAe;oBAGrB,eAAe;CAGhC,CAAC;AAEF,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,eAAe,CAEtE;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,eAAe,CAoCjE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAyBhF;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAOrE"}
|