@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/esm-bundle/index.js
CHANGED
|
@@ -5923,13 +5923,27 @@ var getFaustAudioWorkletProcessor = (dependencies, faustData, register = true) =
|
|
|
5923
5923
|
}
|
|
5924
5924
|
static get parameterDescriptors() {
|
|
5925
5925
|
const params = [];
|
|
5926
|
-
const
|
|
5926
|
+
const origin = /* @__PURE__ */ new Map();
|
|
5927
|
+
const collect = (side) => (item) => {
|
|
5927
5928
|
const param = analysePolyParameters(item);
|
|
5928
|
-
if (param)
|
|
5929
|
+
if (!param) return;
|
|
5930
|
+
const previous = origin.get(param.name);
|
|
5931
|
+
if (previous === side) {
|
|
5932
|
+
throw new Error(
|
|
5933
|
+
`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.`
|
|
5934
|
+
);
|
|
5935
|
+
}
|
|
5936
|
+
if (previous !== void 0) {
|
|
5937
|
+
throw new Error(
|
|
5938
|
+
`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.`
|
|
5939
|
+
);
|
|
5940
|
+
}
|
|
5941
|
+
origin.set(param.name, side);
|
|
5942
|
+
params.push(param);
|
|
5929
5943
|
};
|
|
5930
|
-
FaustBaseWebAudioDsp2.parseUI(dspMeta.ui,
|
|
5944
|
+
FaustBaseWebAudioDsp2.parseUI(dspMeta.ui, collect("voice"));
|
|
5931
5945
|
if (effectMeta)
|
|
5932
|
-
FaustBaseWebAudioDsp2.parseUI(effectMeta.ui,
|
|
5946
|
+
FaustBaseWebAudioDsp2.parseUI(effectMeta.ui, collect("effect"));
|
|
5933
5947
|
return params;
|
|
5934
5948
|
}
|
|
5935
5949
|
setupWamEventHandler() {
|
|
@@ -6187,13 +6201,14 @@ var getFaustAudioWorkletProcessor = (dependencies, faustData, register = true) =
|
|
|
6187
6201
|
}
|
|
6188
6202
|
const Processor = poly ? FaustPolyAudioWorkletProcessor : FaustMonoAudioWorkletProcessor;
|
|
6189
6203
|
if (register) {
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6204
|
+
const name = processorName || dspName || (poly ? "mydsp_poly" : "mydsp");
|
|
6205
|
+
const scope = globalThis;
|
|
6206
|
+
if (!scope.__faustRegisteredProcessors) {
|
|
6207
|
+
scope.__faustRegisteredProcessors = /* @__PURE__ */ new Set();
|
|
6208
|
+
}
|
|
6209
|
+
if (!scope.__faustRegisteredProcessors.has(name)) {
|
|
6210
|
+
registerProcessor(name, Processor);
|
|
6211
|
+
scope.__faustRegisteredProcessors.add(name);
|
|
6197
6212
|
}
|
|
6198
6213
|
}
|
|
6199
6214
|
return poly ? FaustPolyAudioWorkletProcessor : FaustMonoAudioWorkletProcessor;
|
|
@@ -6734,13 +6749,14 @@ var getFaustFFTAudioWorkletProcessor = (dependencies, faustData, register = true
|
|
|
6734
6749
|
}
|
|
6735
6750
|
const Processor = FaustFFTAudioWorkletProcessor;
|
|
6736
6751
|
if (register) {
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
|
|
6752
|
+
const name = processorName || dspName || "myfftdsp";
|
|
6753
|
+
const scope = globalThis;
|
|
6754
|
+
if (!scope.__faustRegisteredProcessors) {
|
|
6755
|
+
scope.__faustRegisteredProcessors = /* @__PURE__ */ new Set();
|
|
6756
|
+
}
|
|
6757
|
+
if (!scope.__faustRegisteredProcessors.has(name)) {
|
|
6758
|
+
registerProcessor(name, Processor);
|
|
6759
|
+
scope.__faustRegisteredProcessors.add(name);
|
|
6744
6760
|
}
|
|
6745
6761
|
}
|
|
6746
6762
|
return FaustFFTAudioWorkletProcessor;
|
|
@@ -11730,17 +11746,24 @@ const dependencies = {
|
|
|
11730
11746
|
throw e;
|
|
11731
11747
|
}
|
|
11732
11748
|
}
|
|
11733
|
-
|
|
11734
|
-
|
|
11735
|
-
|
|
11736
|
-
|
|
11737
|
-
|
|
11738
|
-
|
|
11739
|
-
|
|
11740
|
-
|
|
11741
|
-
|
|
11742
|
-
|
|
11743
|
-
|
|
11749
|
+
let node;
|
|
11750
|
+
try {
|
|
11751
|
+
node = new FaustPolyAudioWorkletNode(context, {
|
|
11752
|
+
processorOptions: {
|
|
11753
|
+
name: processorName,
|
|
11754
|
+
voiceFactory,
|
|
11755
|
+
mixerModule,
|
|
11756
|
+
voices,
|
|
11757
|
+
sampleSize,
|
|
11758
|
+
effectFactory: effectFactory || void 0,
|
|
11759
|
+
...processorOptions
|
|
11760
|
+
}
|
|
11761
|
+
});
|
|
11762
|
+
} catch (error) {
|
|
11763
|
+
throw new Error(
|
|
11764
|
+
`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)}`
|
|
11765
|
+
);
|
|
11766
|
+
}
|
|
11744
11767
|
return node;
|
|
11745
11768
|
}
|
|
11746
11769
|
}
|