@grame/faustwasm 0.0.28 → 0.0.30
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 +32 -10
- package/assets/standalone/faustwasm/index.js +18 -19
- package/assets/standalone/faustwasm/index.js.map +2 -2
- package/dist/cjs/index.js +17 -18
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs-bundle/index.js +1287 -3016
- package/dist/cjs-bundle/index.js.map +3 -3
- package/dist/esm/index.js +18 -19
- package/dist/esm/index.js.map +2 -2
- package/dist/esm-bundle/index.js +1287 -3016
- package/dist/esm-bundle/index.js.map +3 -3
- package/libfaust-wasm/libfaust-wasm.data +0 -0
- package/libfaust-wasm/libfaust-wasm.js +3 -4
- package/libfaust-wasm/libfaust-wasm.wasm +0 -0
- package/package.json +1 -1
- package/src/FaustDspGenerator.ts +13 -13
- package/src/FaustDspInstance.ts +1 -3
- package/src/FaustWasmInstantiator.ts +1 -1
- package/src/exports.ts +24 -24
- package/test/faustlive-wasm/faustwasm/index.js +18 -19
- package/test/faustlive-wasm/faustwasm/index.js.map +2 -2
- package/test/greyhole.dsp +8 -0
- package/test/jprev.dsp +8 -0
- package/test/soundmachine.dsp +52 -0
- package/test/t1.cjs +46 -0
- package/test/t1.js +46 -0
|
Binary file
|
package/package.json
CHANGED
package/src/FaustDspGenerator.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FaustMonoAudioWorkletNode, FaustPolyAudioWorkletNode } from "./FaustAudioWorkletNode";
|
|
2
2
|
import getFaustAudioWorkletProcessor, { FaustData } from "./FaustAudioWorkletProcessor";
|
|
3
3
|
import getFaustFFTAudioWorkletProcessor, { FaustFFTData, FaustFFTOptionsData } from "./FaustFFTAudioWorkletProcessor";
|
|
4
|
-
import FaustDspInstance from "./FaustDspInstance";
|
|
4
|
+
import { FaustDspInstance } from "./FaustDspInstance";
|
|
5
5
|
import FaustWasmInstantiator from "./FaustWasmInstantiator";
|
|
6
6
|
import { FaustMonoOfflineProcessor, FaustPolyOfflineProcessor, IFaustMonoOfflineProcessor, IFaustPolyOfflineProcessor } from "./FaustOfflineProcessor";
|
|
7
7
|
import { FaustMonoScriptProcessorNode, FaustPolyScriptProcessorNode } from "./FaustScriptProcessorNode";
|
|
@@ -185,15 +185,15 @@ const faustData = ${JSON.stringify({
|
|
|
185
185
|
poly: false
|
|
186
186
|
} as FaustData)};
|
|
187
187
|
// Implementation needed classes of functions
|
|
188
|
-
const ${FaustDspInstance.name}
|
|
188
|
+
const ${FaustDspInstance.name} = ${FaustDspInstance.toString()}
|
|
189
189
|
const ${FaustBaseWebAudioDsp.name} = ${FaustBaseWebAudioDsp.toString()}
|
|
190
190
|
const ${FaustMonoWebAudioDsp.name} = ${FaustMonoWebAudioDsp.toString()}
|
|
191
191
|
const ${FaustWasmInstantiator.name} = ${FaustWasmInstantiator.toString()}
|
|
192
192
|
// Put them in dependencies
|
|
193
193
|
const dependencies = {
|
|
194
|
-
${FaustBaseWebAudioDsp.name},
|
|
195
|
-
${FaustMonoWebAudioDsp.name},
|
|
196
|
-
${FaustWasmInstantiator.name}
|
|
194
|
+
FaustBaseWebAudioDsp: ${FaustBaseWebAudioDsp.name},
|
|
195
|
+
FaustMonoWebAudioDsp: ${FaustMonoWebAudioDsp.name},
|
|
196
|
+
FaustWasmInstantiator: ${FaustWasmInstantiator.name}
|
|
197
197
|
};
|
|
198
198
|
// Generate the actual AudioWorkletProcessor code
|
|
199
199
|
(${getFaustAudioWorkletProcessor.toString()})(dependencies, faustData);
|
|
@@ -238,16 +238,16 @@ const faustData = ${JSON.stringify({
|
|
|
238
238
|
fftOptions
|
|
239
239
|
} as FaustFFTData)};
|
|
240
240
|
// Implementation needed classes of functions
|
|
241
|
-
const ${FaustDspInstance.name}
|
|
241
|
+
const ${FaustDspInstance.name} = ${FaustDspInstance.toString()}
|
|
242
242
|
const ${FaustBaseWebAudioDsp.name} = ${FaustBaseWebAudioDsp.toString()}
|
|
243
243
|
const ${FaustMonoWebAudioDsp.name} = ${FaustMonoWebAudioDsp.toString()}
|
|
244
244
|
const ${FaustWasmInstantiator.name} = ${FaustWasmInstantiator.toString()}
|
|
245
245
|
const FFTUtils = ${fftUtils.toString()}
|
|
246
246
|
// Put them in dependencies
|
|
247
247
|
const dependencies = {
|
|
248
|
-
${FaustBaseWebAudioDsp.name},
|
|
249
|
-
${FaustMonoWebAudioDsp.name},
|
|
250
|
-
${FaustWasmInstantiator.name},
|
|
248
|
+
FaustBaseWebAudioDsp: ${FaustBaseWebAudioDsp.name},
|
|
249
|
+
FaustMonoWebAudioDsp: ${FaustMonoWebAudioDsp.name},
|
|
250
|
+
FaustWasmInstantiator: ${FaustWasmInstantiator.name},
|
|
251
251
|
FFTUtils
|
|
252
252
|
};
|
|
253
253
|
// Generate the actual AudioWorkletProcessor code
|
|
@@ -412,16 +412,16 @@ const faustData = ${JSON.stringify({
|
|
|
412
412
|
effectMeta
|
|
413
413
|
} as FaustData)};
|
|
414
414
|
// Implementation needed classes of functions
|
|
415
|
-
const ${FaustDspInstance.name}
|
|
415
|
+
const ${FaustDspInstance.name} = ${FaustDspInstance.toString()}
|
|
416
416
|
const ${FaustBaseWebAudioDsp.name} = ${FaustBaseWebAudioDsp.toString()}
|
|
417
417
|
const ${FaustPolyWebAudioDsp.name} = ${FaustPolyWebAudioDsp.toString()}
|
|
418
418
|
const ${FaustWebAudioDspVoice.name} = ${FaustWebAudioDspVoice.toString()}
|
|
419
419
|
const ${FaustWasmInstantiator.name} = ${FaustWasmInstantiator.toString()}
|
|
420
420
|
// Put them in dependencies
|
|
421
421
|
const dependencies = {
|
|
422
|
-
${FaustBaseWebAudioDsp.name},
|
|
423
|
-
${FaustPolyWebAudioDsp.name},
|
|
424
|
-
${FaustWasmInstantiator.name}
|
|
422
|
+
FaustBaseWebAudioDsp: ${FaustBaseWebAudioDsp.name},
|
|
423
|
+
FaustPolyWebAudioDsp: ${FaustPolyWebAudioDsp.name},
|
|
424
|
+
FaustWasmInstantiator: ${FaustWasmInstantiator.name}
|
|
425
425
|
};
|
|
426
426
|
// Generate the actual AudioWorkletProcessor code
|
|
427
427
|
(${getFaustAudioWorkletProcessor.toString()})(dependencies, faustData);
|
package/src/FaustDspInstance.ts
CHANGED
|
@@ -120,7 +120,7 @@ export interface FaustPolyDspInstance {
|
|
|
120
120
|
effectJSON?: string;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
class FaustDspInstance implements IFaustDspInstance {
|
|
123
|
+
export class FaustDspInstance implements IFaustDspInstance {
|
|
124
124
|
private readonly fExports: IFaustDspInstance;
|
|
125
125
|
|
|
126
126
|
constructor(exports: IFaustDspInstance) { this.fExports = exports; }
|
|
@@ -137,5 +137,3 @@ class FaustDspInstance implements IFaustDspInstance {
|
|
|
137
137
|
instanceResetUserInterface($dsp: number) { this.fExports.instanceResetUserInterface($dsp); }
|
|
138
138
|
setParamValue($dsp: number, index: number, value: number) { this.fExports.setParamValue($dsp, index, value); }
|
|
139
139
|
}
|
|
140
|
-
|
|
141
|
-
export default FaustDspInstance;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import FaustDspInstance,
|
|
1
|
+
import { FaustDspInstance, FaustMonoDspInstance, FaustPolyDspInstance, IFaustDspInstance, IFaustMixerInstance } from "./FaustDspInstance";
|
|
2
2
|
import type { FaustDspFactory, FaustDspMeta, LooseFaustDspFactory } from "./types";
|
|
3
3
|
|
|
4
4
|
class FaustWasmInstantiator {
|
package/src/exports.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
export { default as instantiateFaustModuleFromFile } from "./instantiateFaustModuleFromFile";
|
|
2
|
-
export { default as getFaustAudioWorkletProcessor } from "./FaustAudioWorkletProcessor";
|
|
3
|
-
export { default as getFaustFFTAudioWorkletProcessor } from "./FaustFFTAudioWorkletProcessor";
|
|
4
|
-
export { default as FaustCompiler } from "./FaustCompiler";
|
|
5
|
-
export {
|
|
6
|
-
export { default as FaustWasmInstantiator } from "./FaustWasmInstantiator";
|
|
7
|
-
export { default as FaustOfflineProcessor } from "./FaustOfflineProcessor";
|
|
8
|
-
export { default as FaustSvgDiagrams } from "./FaustSvgDiagrams";
|
|
9
|
-
export { default as LibFaust } from "./LibFaust";
|
|
10
|
-
export { default as WavEncoder } from "./WavEncoder";
|
|
11
|
-
export { default as WavDecoder } from "./WavDecoder";
|
|
12
|
-
|
|
13
|
-
export * from "./FaustAudioWorkletNode";
|
|
14
|
-
export * from "./FaustAudioWorkletProcessor";
|
|
15
|
-
export * from "./FaustFFTAudioWorkletProcessor";
|
|
16
|
-
export * from "./FaustCompiler";
|
|
17
|
-
export * from "./FaustDspInstance";
|
|
18
|
-
export * from "./FaustOfflineProcessor";
|
|
19
|
-
export * from "./FaustScriptProcessorNode";
|
|
20
|
-
export * from "./FaustWebAudioDsp";
|
|
21
|
-
export * from "./FaustDspGenerator";
|
|
22
|
-
export * from "./LibFaust";
|
|
23
|
-
|
|
24
|
-
export * from "./types";
|
|
1
|
+
export { default as instantiateFaustModuleFromFile } from "./instantiateFaustModuleFromFile";
|
|
2
|
+
export { default as getFaustAudioWorkletProcessor } from "./FaustAudioWorkletProcessor";
|
|
3
|
+
export { default as getFaustFFTAudioWorkletProcessor } from "./FaustFFTAudioWorkletProcessor";
|
|
4
|
+
export { default as FaustCompiler } from "./FaustCompiler";
|
|
5
|
+
export { FaustDspInstance } from "./FaustDspInstance";
|
|
6
|
+
export { default as FaustWasmInstantiator } from "./FaustWasmInstantiator";
|
|
7
|
+
export { default as FaustOfflineProcessor } from "./FaustOfflineProcessor";
|
|
8
|
+
export { default as FaustSvgDiagrams } from "./FaustSvgDiagrams";
|
|
9
|
+
export { default as LibFaust } from "./LibFaust";
|
|
10
|
+
export { default as WavEncoder } from "./WavEncoder";
|
|
11
|
+
export { default as WavDecoder } from "./WavDecoder";
|
|
12
|
+
|
|
13
|
+
export * from "./FaustAudioWorkletNode";
|
|
14
|
+
export * from "./FaustAudioWorkletProcessor";
|
|
15
|
+
export * from "./FaustFFTAudioWorkletProcessor";
|
|
16
|
+
export * from "./FaustCompiler";
|
|
17
|
+
export * from "./FaustDspInstance";
|
|
18
|
+
export * from "./FaustOfflineProcessor";
|
|
19
|
+
export * from "./FaustScriptProcessorNode";
|
|
20
|
+
export * from "./FaustWebAudioDsp";
|
|
21
|
+
export * from "./FaustDspGenerator";
|
|
22
|
+
export * from "./LibFaust";
|
|
23
|
+
|
|
24
|
+
export * from "./types";
|
|
@@ -1723,7 +1723,6 @@ var FaustDspInstance = class {
|
|
|
1723
1723
|
this.fExports.setParamValue($dsp, index, value);
|
|
1724
1724
|
}
|
|
1725
1725
|
};
|
|
1726
|
-
var FaustDspInstance_default = FaustDspInstance;
|
|
1727
1726
|
|
|
1728
1727
|
// src/FaustWasmInstantiator.ts
|
|
1729
1728
|
var FaustWasmInstantiator = class {
|
|
@@ -1813,7 +1812,7 @@ var FaustWasmInstantiator = class {
|
|
|
1813
1812
|
}
|
|
1814
1813
|
static createMonoDSPInstanceAux(instance, json) {
|
|
1815
1814
|
const functions = instance.exports;
|
|
1816
|
-
const api = new
|
|
1815
|
+
const api = new FaustDspInstance(functions);
|
|
1817
1816
|
const memory = instance.exports.memory;
|
|
1818
1817
|
return { memory, api, json };
|
|
1819
1818
|
}
|
|
@@ -1876,12 +1875,12 @@ var FaustWasmInstantiator = class {
|
|
|
1876
1875
|
const memory = this.createMemoryAux(voices, voiceFactory, effectFactory);
|
|
1877
1876
|
const voiceInstance = await WebAssembly.instantiate(voiceFactory.module, this.createWasmImport(memory));
|
|
1878
1877
|
const voiceFunctions = voiceInstance.exports;
|
|
1879
|
-
const voiceAPI = new
|
|
1878
|
+
const voiceAPI = new FaustDspInstance(voiceFunctions);
|
|
1880
1879
|
const mixerAPI = this.createMixerAux(mixerModule, memory);
|
|
1881
1880
|
if (effectFactory) {
|
|
1882
1881
|
const effectInstance = await WebAssembly.instantiate(effectFactory.module, this.createWasmImport(memory));
|
|
1883
1882
|
const effectFunctions = effectInstance.exports;
|
|
1884
|
-
const effectAPI = new
|
|
1883
|
+
const effectAPI = new FaustDspInstance(effectFunctions);
|
|
1885
1884
|
return {
|
|
1886
1885
|
memory,
|
|
1887
1886
|
voices,
|
|
@@ -1905,12 +1904,12 @@ var FaustWasmInstantiator = class {
|
|
|
1905
1904
|
const memory = this.createMemoryAux(voices, voiceFactory, effectFactory);
|
|
1906
1905
|
const voiceInstance = new WebAssembly.Instance(voiceFactory.module, this.createWasmImport(memory));
|
|
1907
1906
|
const voiceFunctions = voiceInstance.exports;
|
|
1908
|
-
const voiceAPI = new
|
|
1907
|
+
const voiceAPI = new FaustDspInstance(voiceFunctions);
|
|
1909
1908
|
const mixerAPI = this.createMixerAux(mixerModule, memory);
|
|
1910
1909
|
if (effectFactory) {
|
|
1911
1910
|
const effectInstance = new WebAssembly.Instance(effectFactory.module, this.createWasmImport(memory));
|
|
1912
1911
|
const effectFunctions = effectInstance.exports;
|
|
1913
|
-
const effectAPI = new
|
|
1912
|
+
const effectAPI = new FaustDspInstance(effectFunctions);
|
|
1914
1913
|
return {
|
|
1915
1914
|
memory,
|
|
1916
1915
|
voices,
|
|
@@ -3499,15 +3498,15 @@ const faustData = ${JSON.stringify({
|
|
|
3499
3498
|
poly: false
|
|
3500
3499
|
})};
|
|
3501
3500
|
// Implementation needed classes of functions
|
|
3502
|
-
const ${
|
|
3501
|
+
const ${FaustDspInstance.name} = ${FaustDspInstance.toString()}
|
|
3503
3502
|
const ${FaustBaseWebAudioDsp.name} = ${FaustBaseWebAudioDsp.toString()}
|
|
3504
3503
|
const ${FaustMonoWebAudioDsp.name} = ${FaustMonoWebAudioDsp.toString()}
|
|
3505
3504
|
const ${FaustWasmInstantiator_default.name} = ${FaustWasmInstantiator_default.toString()}
|
|
3506
3505
|
// Put them in dependencies
|
|
3507
3506
|
const dependencies = {
|
|
3508
|
-
${FaustBaseWebAudioDsp.name},
|
|
3509
|
-
${FaustMonoWebAudioDsp.name},
|
|
3510
|
-
${FaustWasmInstantiator_default.name}
|
|
3507
|
+
FaustBaseWebAudioDsp: ${FaustBaseWebAudioDsp.name},
|
|
3508
|
+
FaustMonoWebAudioDsp: ${FaustMonoWebAudioDsp.name},
|
|
3509
|
+
FaustWasmInstantiator: ${FaustWasmInstantiator_default.name}
|
|
3511
3510
|
};
|
|
3512
3511
|
// Generate the actual AudioWorkletProcessor code
|
|
3513
3512
|
(${FaustAudioWorkletProcessor_default.toString()})(dependencies, faustData);
|
|
@@ -3542,16 +3541,16 @@ const faustData = ${JSON.stringify({
|
|
|
3542
3541
|
fftOptions
|
|
3543
3542
|
})};
|
|
3544
3543
|
// Implementation needed classes of functions
|
|
3545
|
-
const ${
|
|
3544
|
+
const ${FaustDspInstance.name} = ${FaustDspInstance.toString()}
|
|
3546
3545
|
const ${FaustBaseWebAudioDsp.name} = ${FaustBaseWebAudioDsp.toString()}
|
|
3547
3546
|
const ${FaustMonoWebAudioDsp.name} = ${FaustMonoWebAudioDsp.toString()}
|
|
3548
3547
|
const ${FaustWasmInstantiator_default.name} = ${FaustWasmInstantiator_default.toString()}
|
|
3549
3548
|
const FFTUtils = ${fftUtils.toString()}
|
|
3550
3549
|
// Put them in dependencies
|
|
3551
3550
|
const dependencies = {
|
|
3552
|
-
${FaustBaseWebAudioDsp.name},
|
|
3553
|
-
${FaustMonoWebAudioDsp.name},
|
|
3554
|
-
${FaustWasmInstantiator_default.name},
|
|
3551
|
+
FaustBaseWebAudioDsp: ${FaustBaseWebAudioDsp.name},
|
|
3552
|
+
FaustMonoWebAudioDsp: ${FaustMonoWebAudioDsp.name},
|
|
3553
|
+
FaustWasmInstantiator: ${FaustWasmInstantiator_default.name},
|
|
3555
3554
|
FFTUtils
|
|
3556
3555
|
};
|
|
3557
3556
|
// Generate the actual AudioWorkletProcessor code
|
|
@@ -3678,16 +3677,16 @@ const faustData = ${JSON.stringify({
|
|
|
3678
3677
|
effectMeta
|
|
3679
3678
|
})};
|
|
3680
3679
|
// Implementation needed classes of functions
|
|
3681
|
-
const ${
|
|
3680
|
+
const ${FaustDspInstance.name} = ${FaustDspInstance.toString()}
|
|
3682
3681
|
const ${FaustBaseWebAudioDsp.name} = ${FaustBaseWebAudioDsp.toString()}
|
|
3683
3682
|
const ${FaustPolyWebAudioDsp.name} = ${FaustPolyWebAudioDsp.toString()}
|
|
3684
3683
|
const ${FaustWebAudioDspVoice.name} = ${FaustWebAudioDspVoice.toString()}
|
|
3685
3684
|
const ${FaustWasmInstantiator_default.name} = ${FaustWasmInstantiator_default.toString()}
|
|
3686
3685
|
// Put them in dependencies
|
|
3687
3686
|
const dependencies = {
|
|
3688
|
-
${FaustBaseWebAudioDsp.name},
|
|
3689
|
-
${FaustPolyWebAudioDsp.name},
|
|
3690
|
-
${FaustWasmInstantiator_default.name}
|
|
3687
|
+
FaustBaseWebAudioDsp: ${FaustBaseWebAudioDsp.name},
|
|
3688
|
+
FaustPolyWebAudioDsp: ${FaustPolyWebAudioDsp.name},
|
|
3689
|
+
FaustWasmInstantiator: ${FaustWasmInstantiator_default.name}
|
|
3691
3690
|
};
|
|
3692
3691
|
// Generate the actual AudioWorkletProcessor code
|
|
3693
3692
|
(${FaustAudioWorkletProcessor_default.toString()})(dependencies, faustData);
|
|
@@ -3747,7 +3746,7 @@ export {
|
|
|
3747
3746
|
FaustAudioWorkletNode,
|
|
3748
3747
|
FaustBaseWebAudioDsp,
|
|
3749
3748
|
FaustCompiler_default as FaustCompiler,
|
|
3750
|
-
|
|
3749
|
+
FaustDspInstance,
|
|
3751
3750
|
FaustMonoAudioWorkletNode,
|
|
3752
3751
|
FaustMonoDspGenerator,
|
|
3753
3752
|
FaustMonoOfflineProcessor,
|