@grame/faustwasm 0.16.6 → 0.16.7
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/assets/standalone/faustwasm/index.js +52 -29
- package/assets/standalone/faustwasm/index.js.map +2 -2
- package/dist/cjs/index.js +52 -29
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs-bundle/index.js +52 -29
- package/dist/cjs-bundle/index.js.map +2 -2
- package/dist/esm/index.js +52 -29
- package/dist/esm/index.js.map +2 -2
- package/dist/esm-bundle/index.js +52 -29
- package/dist/esm-bundle/index.js.map +2 -2
- package/package.json +1 -1
- package/src/FaustAudioWorkletProcessor.ts +59 -12
- package/src/FaustDspGenerator.ts +30 -11
- package/src/FaustFFTAudioWorkletProcessor.ts +23 -7
- package/test/faustlive-wasm/faustwasm/index.js +52 -29
- package/test/faustlive-wasm/faustwasm/index.js.map +2 -2
- package/faustwasm-soundfile-wav-samplerate.patch +0 -77
- package/waw400 +0 -0
- package/waw400.dsp +0 -7
package/dist/cjs/index.js
CHANGED
|
@@ -149,13 +149,27 @@ export default ${(_b = jsCode.match(jsCodeHead)) == null ? void 0 : _b[1]};
|
|
|
149
149
|
}
|
|
150
150
|
static get parameterDescriptors() {
|
|
151
151
|
const params = [];
|
|
152
|
-
const
|
|
152
|
+
const origin = /* @__PURE__ */ new Map();
|
|
153
|
+
const collect = (side) => (item) => {
|
|
153
154
|
const param = analysePolyParameters(item);
|
|
154
|
-
if (param)
|
|
155
|
+
if (!param) return;
|
|
156
|
+
const previous = origin.get(param.name);
|
|
157
|
+
if (previous === side) {
|
|
158
|
+
throw new Error(
|
|
159
|
+
`Faust: control "${param.name}" is declared twice in the ${side}. Two widgets resolved to the same path, so one of them would be unreachable. Give them distinct labels or groups.`
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
if (previous !== void 0) {
|
|
163
|
+
throw new Error(
|
|
164
|
+
`Faust: control "${param.name}" is declared both in the ${previous} and in the ${side}. A polyphonic DSP cannot share a control path between \`process\` and \`effect\`: setParamValue routes a path to one side only, so the other would keep its default. Declare it under a distinct path on each side and have the host write both.`
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
origin.set(param.name, side);
|
|
168
|
+
params.push(param);
|
|
155
169
|
};
|
|
156
|
-
FaustBaseWebAudioDsp2.parseUI(dspMeta.ui,
|
|
170
|
+
FaustBaseWebAudioDsp2.parseUI(dspMeta.ui, collect("voice"));
|
|
157
171
|
if (effectMeta)
|
|
158
|
-
FaustBaseWebAudioDsp2.parseUI(effectMeta.ui,
|
|
172
|
+
FaustBaseWebAudioDsp2.parseUI(effectMeta.ui, collect("effect"));
|
|
159
173
|
return params;
|
|
160
174
|
}
|
|
161
175
|
setupWamEventHandler() {
|
|
@@ -413,13 +427,14 @@ export default ${(_b = jsCode.match(jsCodeHead)) == null ? void 0 : _b[1]};
|
|
|
413
427
|
}
|
|
414
428
|
const Processor = poly ? FaustPolyAudioWorkletProcessor : FaustMonoAudioWorkletProcessor;
|
|
415
429
|
if (register) {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
430
|
+
const name = processorName || dspName || (poly ? "mydsp_poly" : "mydsp");
|
|
431
|
+
const scope = globalThis;
|
|
432
|
+
if (!scope.__faustRegisteredProcessors) {
|
|
433
|
+
scope.__faustRegisteredProcessors = /* @__PURE__ */ new Set();
|
|
434
|
+
}
|
|
435
|
+
if (!scope.__faustRegisteredProcessors.has(name)) {
|
|
436
|
+
registerProcessor(name, Processor);
|
|
437
|
+
scope.__faustRegisteredProcessors.add(name);
|
|
423
438
|
}
|
|
424
439
|
}
|
|
425
440
|
return poly ? FaustPolyAudioWorkletProcessor : FaustMonoAudioWorkletProcessor;
|
|
@@ -960,13 +975,14 @@ export default ${(_b = jsCode.match(jsCodeHead)) == null ? void 0 : _b[1]};
|
|
|
960
975
|
}
|
|
961
976
|
const Processor = FaustFFTAudioWorkletProcessor;
|
|
962
977
|
if (register) {
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
978
|
+
const name = processorName || dspName || "myfftdsp";
|
|
979
|
+
const scope = globalThis;
|
|
980
|
+
if (!scope.__faustRegisteredProcessors) {
|
|
981
|
+
scope.__faustRegisteredProcessors = /* @__PURE__ */ new Set();
|
|
982
|
+
}
|
|
983
|
+
if (!scope.__faustRegisteredProcessors.has(name)) {
|
|
984
|
+
registerProcessor(name, Processor);
|
|
985
|
+
scope.__faustRegisteredProcessors.add(name);
|
|
970
986
|
}
|
|
971
987
|
}
|
|
972
988
|
return FaustFFTAudioWorkletProcessor;
|
|
@@ -5956,17 +5972,24 @@ const dependencies = {
|
|
|
5956
5972
|
throw e;
|
|
5957
5973
|
}
|
|
5958
5974
|
}
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
5975
|
+
let node;
|
|
5976
|
+
try {
|
|
5977
|
+
node = new FaustPolyAudioWorkletNode(context, {
|
|
5978
|
+
processorOptions: {
|
|
5979
|
+
name: processorName,
|
|
5980
|
+
voiceFactory,
|
|
5981
|
+
mixerModule,
|
|
5982
|
+
voices,
|
|
5983
|
+
sampleSize,
|
|
5984
|
+
effectFactory: effectFactory || void 0,
|
|
5985
|
+
...processorOptions
|
|
5986
|
+
}
|
|
5987
|
+
});
|
|
5988
|
+
} catch (error) {
|
|
5989
|
+
throw new Error(
|
|
5990
|
+
`Faust: the AudioWorkletProcessor "${processorName}" did not register. The module loaded, so the failure happened inside registerProcessor \u2014 its error is reported in the AudioWorklet scope and appears in the browser console above this one. A duplicate control path shared between \`process\` and \`effect\` is the usual cause. Original error: ${error instanceof Error ? error.message : String(error)}`
|
|
5991
|
+
);
|
|
5992
|
+
}
|
|
5970
5993
|
return node;
|
|
5971
5994
|
}
|
|
5972
5995
|
}
|