@grame/faustwasm 0.12.2 → 0.13.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/.prettierrc +5 -0
- package/README.md +21 -3
- package/assets/standalone/faustwasm/index.d.ts +38 -16
- package/assets/standalone/faustwasm/index.js +1593 -404
- package/assets/standalone/faustwasm/index.js.map +2 -2
- package/dist/cjs/index.d.ts +38 -16
- package/dist/cjs/index.js +1592 -404
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs-bundle/index.d.ts +38 -16
- package/dist/cjs-bundle/index.js +1595 -406
- package/dist/cjs-bundle/index.js.map +2 -2
- package/dist/esm/index.d.ts +38 -16
- package/dist/esm/index.js +1593 -404
- package/dist/esm/index.js.map +2 -2
- package/dist/esm-bundle/index.d.ts +38 -16
- package/dist/esm-bundle/index.js +1595 -406
- package/dist/esm-bundle/index.js.map +2 -2
- package/eslint.config.js +11 -0
- package/package.json +57 -51
- package/sound.cpp +163 -0
- package/sound.dsp +4 -0
- package/sound.json +1 -0
- package/sound.wasm +0 -0
- package/src/FaustAudioWorkletCommunicator.ts +150 -143
- package/src/FaustAudioWorkletNode.ts +173 -75
- package/src/FaustAudioWorkletProcessor.ts +218 -90
- package/src/FaustCmajor.ts +9 -3
- package/src/FaustCompiler.ts +112 -35
- package/src/FaustDspGenerator.ts +589 -117
- package/src/FaustDspInstance.ts +58 -24
- package/src/FaustFFTAudioWorkletProcessor.ts +822 -612
- package/src/FaustOfflineProcessor.ts +187 -56
- package/src/FaustScriptProcessorNode.ts +156 -49
- package/src/FaustSensors.ts +426 -96
- package/src/FaustSvgDiagrams.ts +18 -5
- package/src/FaustWasmInstantiator.ts +224 -70
- package/src/FaustWebAudioDsp.ts +1060 -349
- package/src/LibFaust.ts +13 -4
- package/src/SoundfileReader.ts +175 -131
- package/src/WavDecoder.ts +42 -20
- package/src/WavEncoder.ts +35 -21
- package/src/copyWebStandaloneAssets.d.ts +20 -5
- package/src/copyWebStandaloneAssets.js +203 -75
- package/src/exports-bundle.ts +5 -5
- package/src/exports.ts +24 -24
- package/src/faust2CmajorFiles.d.ts +7 -3
- package/src/faust2cmajorFiles.js +10 -8
- package/src/faust2svgFiles.d.ts +7 -3
- package/src/faust2svgFiles.js +9 -7
- package/src/faust2wasmFiles.d.ts +10 -5
- package/src/faust2wasmFiles.js +34 -17
- package/src/faust2wavFiles.d.ts +12 -3
- package/src/faust2wavFiles.js +25 -12
- package/src/index-bundle-iife.ts +2 -2
- package/src/index-bundle.ts +1 -1
- package/src/index.ts +1 -1
- package/src/instantiateFaustModule.ts +43 -36
- package/src/instantiateFaustModuleFromFile.ts +30 -14
- package/src/types.ts +101 -25
- package/test/faustlive-wasm/faustwasm/index.d.ts +38 -16
- package/test/faustlive-wasm/faustwasm/index.js +1593 -404
- package/test/faustlive-wasm/faustwasm/index.js.map +2 -2
- package/test/web/create-faust-node.html +53 -0
- package/test/web/create-faust-node.js +181 -0
- package/test/organ/create-node.js +0 -252
- package/test/organ/dsp-meta.json +0 -131
- package/test/organ/dsp-module.wasm +0 -0
- package/test/organ/faust-pwa.js +0 -344
- package/test/organ/faust-ui/index.css +0 -442
- package/test/organ/faust-ui/index.css.map +0 -1
- package/test/organ/faust-ui/index.d.ts +0 -1
- package/test/organ/faust-ui/index.js +0 -3756
- package/test/organ/faust-ui/index.js.map +0 -1
- package/test/organ/faustwasm/index.d.ts +0 -1705
- package/test/organ/faustwasm/index.js +0 -4773
- package/test/organ/faustwasm/index.js.map +0 -7
- package/test/organ/icon.png +0 -0
- package/test/organ/index.html +0 -76
- package/test/organ/index.js +0 -69
- package/test/organ/manifest.json +0 -17
- package/test/organ/service-worker.js +0 -165
package/src/FaustDspInstance.ts
CHANGED
|
@@ -10,25 +10,30 @@ export interface IFaustDspInstance {
|
|
|
10
10
|
* @param $inputs - the input audio buffer as in index in wasm memory
|
|
11
11
|
* @param $output - the output audio buffer as in index in wasm memory
|
|
12
12
|
*/
|
|
13
|
-
compute(
|
|
13
|
+
compute(
|
|
14
|
+
$dsp: number,
|
|
15
|
+
count: number,
|
|
16
|
+
$inputs: number,
|
|
17
|
+
$output: number
|
|
18
|
+
): void;
|
|
14
19
|
|
|
15
20
|
/**
|
|
16
21
|
* Give the number of inputs of a Faust wasm instance.
|
|
17
|
-
*
|
|
22
|
+
*
|
|
18
23
|
* @param $dsp - the DSP pointer
|
|
19
24
|
*/
|
|
20
25
|
getNumInputs($dsp: number): number;
|
|
21
26
|
|
|
22
27
|
/**
|
|
23
28
|
* Give the number of outputs of a Faust wasm instance.
|
|
24
|
-
*
|
|
29
|
+
*
|
|
25
30
|
* @param $dsp - the DSP pointer
|
|
26
31
|
*/
|
|
27
32
|
getNumOutputs($dsp: number): number;
|
|
28
33
|
|
|
29
34
|
/**
|
|
30
35
|
* Give a parameter current value.
|
|
31
|
-
*
|
|
36
|
+
*
|
|
32
37
|
* @param $dsp - the DSP pointer
|
|
33
38
|
* @param index - the parameter index
|
|
34
39
|
* @return the parameter value
|
|
@@ -37,7 +42,7 @@ export interface IFaustDspInstance {
|
|
|
37
42
|
|
|
38
43
|
/**
|
|
39
44
|
* Give the Faust wasm instance sample rate.
|
|
40
|
-
*
|
|
45
|
+
*
|
|
41
46
|
* @param $dsp - the DSP pointer
|
|
42
47
|
* @return the sample rate
|
|
43
48
|
*/
|
|
@@ -54,34 +59,34 @@ export interface IFaustDspInstance {
|
|
|
54
59
|
init($dsp: number, sampleRate: number): void;
|
|
55
60
|
|
|
56
61
|
/** Init instance state (delay lines...).
|
|
57
|
-
*
|
|
62
|
+
*
|
|
58
63
|
* @param $dsp - the DSP pointer
|
|
59
64
|
*/
|
|
60
65
|
instanceClear($dsp: number): void;
|
|
61
66
|
|
|
62
67
|
/** Init instance constant state.
|
|
63
|
-
*
|
|
68
|
+
*
|
|
64
69
|
* @param $dsp - the DSP pointer
|
|
65
70
|
* @param sampleRate - the sampling rate in Hertz
|
|
66
71
|
*/
|
|
67
72
|
instanceConstants($dsp: number, sampleRate: number): void;
|
|
68
73
|
|
|
69
74
|
/** Init instance state.
|
|
70
|
-
*
|
|
75
|
+
*
|
|
71
76
|
* @param $dsp - the DSP pointer
|
|
72
77
|
* @param sampleRate - the sampling rate in Hertz
|
|
73
78
|
*/
|
|
74
79
|
instanceInit($dsp: number, sampleRate: number): void;
|
|
75
80
|
|
|
76
81
|
/** Init default control parameters values.
|
|
77
|
-
*
|
|
82
|
+
*
|
|
78
83
|
* @param $dsp - the DSP pointer
|
|
79
84
|
*/
|
|
80
85
|
instanceResetUserInterface($dsp: number): void;
|
|
81
86
|
|
|
82
87
|
/**
|
|
83
88
|
* Set a parameter current value.
|
|
84
|
-
*
|
|
89
|
+
*
|
|
85
90
|
* @param $dsp - the DSP pointer
|
|
86
91
|
* @param index - the parameter index
|
|
87
92
|
* @param value - the parameter value
|
|
@@ -94,7 +99,12 @@ export interface IFaustDspInstance {
|
|
|
94
99
|
*/
|
|
95
100
|
export interface IFaustMixerInstance {
|
|
96
101
|
clearOutput(bufferSize: number, chans: number, $outputs: number): void;
|
|
97
|
-
mixCheckVoice(
|
|
102
|
+
mixCheckVoice(
|
|
103
|
+
bufferSize: number,
|
|
104
|
+
chans: number,
|
|
105
|
+
$inputs: number,
|
|
106
|
+
$outputs: number
|
|
107
|
+
): number;
|
|
98
108
|
fadeOut(bufferSize: number, chans: number, $outputs: number): void;
|
|
99
109
|
}
|
|
100
110
|
|
|
@@ -123,17 +133,41 @@ export interface FaustPolyDspInstance {
|
|
|
123
133
|
export class FaustDspInstance implements IFaustDspInstance {
|
|
124
134
|
private readonly fExports: IFaustDspInstance;
|
|
125
135
|
|
|
126
|
-
constructor(exports: IFaustDspInstance) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
constructor(exports: IFaustDspInstance) {
|
|
137
|
+
this.fExports = exports;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
compute($dsp: number, count: number, $input: number, $output: number) {
|
|
141
|
+
this.fExports.compute($dsp, count, $input, $output);
|
|
142
|
+
}
|
|
143
|
+
getNumInputs($dsp: number) {
|
|
144
|
+
return this.fExports.getNumInputs($dsp);
|
|
145
|
+
}
|
|
146
|
+
getNumOutputs($dsp: number) {
|
|
147
|
+
return this.fExports.getNumOutputs($dsp);
|
|
148
|
+
}
|
|
149
|
+
getParamValue($dsp: number, index: number) {
|
|
150
|
+
return this.fExports.getParamValue($dsp, index);
|
|
151
|
+
}
|
|
152
|
+
getSampleRate($dsp: number) {
|
|
153
|
+
return this.fExports.getSampleRate($dsp);
|
|
154
|
+
}
|
|
155
|
+
init($dsp: number, sampleRate: number) {
|
|
156
|
+
this.fExports.init($dsp, sampleRate);
|
|
157
|
+
}
|
|
158
|
+
instanceClear($dsp: number) {
|
|
159
|
+
this.fExports.instanceClear($dsp);
|
|
160
|
+
}
|
|
161
|
+
instanceConstants($dsp: number, sampleRate: number) {
|
|
162
|
+
this.fExports.instanceConstants($dsp, sampleRate);
|
|
163
|
+
}
|
|
164
|
+
instanceInit($dsp: number, sampleRate: number) {
|
|
165
|
+
this.fExports.instanceInit($dsp, sampleRate);
|
|
166
|
+
}
|
|
167
|
+
instanceResetUserInterface($dsp: number) {
|
|
168
|
+
this.fExports.instanceResetUserInterface($dsp);
|
|
169
|
+
}
|
|
170
|
+
setParamValue($dsp: number, index: number, value: number) {
|
|
171
|
+
this.fExports.setParamValue($dsp, index, value);
|
|
172
|
+
}
|
|
139
173
|
}
|