@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/index.js
CHANGED
|
@@ -120,13 +120,27 @@ var getFaustAudioWorkletProcessor = (dependencies, faustData, register = true) =
|
|
|
120
120
|
}
|
|
121
121
|
static get parameterDescriptors() {
|
|
122
122
|
const params = [];
|
|
123
|
-
const
|
|
123
|
+
const origin = /* @__PURE__ */ new Map();
|
|
124
|
+
const collect = (side) => (item) => {
|
|
124
125
|
const param = analysePolyParameters(item);
|
|
125
|
-
if (param)
|
|
126
|
+
if (!param) return;
|
|
127
|
+
const previous = origin.get(param.name);
|
|
128
|
+
if (previous === side) {
|
|
129
|
+
throw new Error(
|
|
130
|
+
`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.`
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
if (previous !== void 0) {
|
|
134
|
+
throw new Error(
|
|
135
|
+
`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.`
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
origin.set(param.name, side);
|
|
139
|
+
params.push(param);
|
|
126
140
|
};
|
|
127
|
-
FaustBaseWebAudioDsp2.parseUI(dspMeta.ui,
|
|
141
|
+
FaustBaseWebAudioDsp2.parseUI(dspMeta.ui, collect("voice"));
|
|
128
142
|
if (effectMeta)
|
|
129
|
-
FaustBaseWebAudioDsp2.parseUI(effectMeta.ui,
|
|
143
|
+
FaustBaseWebAudioDsp2.parseUI(effectMeta.ui, collect("effect"));
|
|
130
144
|
return params;
|
|
131
145
|
}
|
|
132
146
|
setupWamEventHandler() {
|
|
@@ -384,13 +398,14 @@ var getFaustAudioWorkletProcessor = (dependencies, faustData, register = true) =
|
|
|
384
398
|
}
|
|
385
399
|
const Processor = poly ? FaustPolyAudioWorkletProcessor : FaustMonoAudioWorkletProcessor;
|
|
386
400
|
if (register) {
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
401
|
+
const name = processorName || dspName || (poly ? "mydsp_poly" : "mydsp");
|
|
402
|
+
const scope = globalThis;
|
|
403
|
+
if (!scope.__faustRegisteredProcessors) {
|
|
404
|
+
scope.__faustRegisteredProcessors = /* @__PURE__ */ new Set();
|
|
405
|
+
}
|
|
406
|
+
if (!scope.__faustRegisteredProcessors.has(name)) {
|
|
407
|
+
registerProcessor(name, Processor);
|
|
408
|
+
scope.__faustRegisteredProcessors.add(name);
|
|
394
409
|
}
|
|
395
410
|
}
|
|
396
411
|
return poly ? FaustPolyAudioWorkletProcessor : FaustMonoAudioWorkletProcessor;
|
|
@@ -931,13 +946,14 @@ var getFaustFFTAudioWorkletProcessor = (dependencies, faustData, register = true
|
|
|
931
946
|
}
|
|
932
947
|
const Processor = FaustFFTAudioWorkletProcessor;
|
|
933
948
|
if (register) {
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
949
|
+
const name = processorName || dspName || "myfftdsp";
|
|
950
|
+
const scope = globalThis;
|
|
951
|
+
if (!scope.__faustRegisteredProcessors) {
|
|
952
|
+
scope.__faustRegisteredProcessors = /* @__PURE__ */ new Set();
|
|
953
|
+
}
|
|
954
|
+
if (!scope.__faustRegisteredProcessors.has(name)) {
|
|
955
|
+
registerProcessor(name, Processor);
|
|
956
|
+
scope.__faustRegisteredProcessors.add(name);
|
|
941
957
|
}
|
|
942
958
|
}
|
|
943
959
|
return FaustFFTAudioWorkletProcessor;
|
|
@@ -5927,17 +5943,24 @@ const dependencies = {
|
|
|
5927
5943
|
throw e;
|
|
5928
5944
|
}
|
|
5929
5945
|
}
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
5940
|
-
|
|
5946
|
+
let node;
|
|
5947
|
+
try {
|
|
5948
|
+
node = new FaustPolyAudioWorkletNode(context, {
|
|
5949
|
+
processorOptions: {
|
|
5950
|
+
name: processorName,
|
|
5951
|
+
voiceFactory,
|
|
5952
|
+
mixerModule,
|
|
5953
|
+
voices,
|
|
5954
|
+
sampleSize,
|
|
5955
|
+
effectFactory: effectFactory || void 0,
|
|
5956
|
+
...processorOptions
|
|
5957
|
+
}
|
|
5958
|
+
});
|
|
5959
|
+
} catch (error) {
|
|
5960
|
+
throw new Error(
|
|
5961
|
+
`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)}`
|
|
5962
|
+
);
|
|
5963
|
+
}
|
|
5941
5964
|
return node;
|
|
5942
5965
|
}
|
|
5943
5966
|
}
|