@grame/faustwasm 0.0.52 → 0.0.54
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 +2 -1
- package/assets/standalone/faustwasm/index.js +18 -6
- package/assets/standalone/faustwasm/index.js.map +2 -2
- package/dist/cjs/index.js +18 -6
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs-bundle/index.js +19 -7
- package/dist/cjs-bundle/index.js.map +2 -2
- package/dist/esm/index.js +18 -6
- package/dist/esm/index.js.map +2 -2
- package/dist/esm-bundle/index.js +19 -7
- package/dist/esm-bundle/index.js.map +2 -2
- package/libfaust-wasm/libfaust-wasm.js +1 -1
- package/libfaust-wasm/libfaust-wasm.wasm +0 -0
- package/package.json +1 -1
- package/src/FaustDspGenerator.ts +11 -5
- package/test/faustlive-wasm/faustwasm/index.js +18 -6
- package/test/faustlive-wasm/faustwasm/index.js.map +2 -2
|
Binary file
|
package/package.json
CHANGED
package/src/FaustDspGenerator.ts
CHANGED
|
@@ -397,15 +397,21 @@ export class FaustPolyDspGenerator implements IFaustPolyDspGenerator {
|
|
|
397
397
|
name: string,
|
|
398
398
|
dspCode: string,
|
|
399
399
|
args: string,
|
|
400
|
+
// The ${dspCode} has to be added with wrapping new lines to make is properly formatted and compile
|
|
400
401
|
effectCode = `
|
|
401
|
-
adapt(1,1) = _;
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
402
|
+
adapt(1,1) = _;
|
|
403
|
+
adapt(2,2) = _,_;
|
|
404
|
+
adapt(1,2) = _ <: _,_;
|
|
405
|
+
adapt(2,1) = _,_ :> _;
|
|
406
|
+
adaptor(F,G) = adapt(outputs(F),inputs(G));
|
|
407
|
+
dsp_code = environment{
|
|
408
|
+
${dspCode}
|
|
409
|
+
};
|
|
410
|
+
process = adaptor(dsp_code.process, dsp_code.effect) : dsp_code.effect;`
|
|
405
411
|
) {
|
|
406
412
|
this.voiceFactory = await compiler.createPolyDSPFactory(name, dspCode, args);
|
|
407
413
|
if (!this.voiceFactory) return null;
|
|
408
|
-
// Compile effect, possibly failing since 'compilePolyNode2' can be called by
|
|
414
|
+
// Compile effect, possibly failing since 'compilePolyNode2' can be called by 'compilePolyNode'
|
|
409
415
|
try {
|
|
410
416
|
this.effectFactory = await compiler.createPolyDSPFactory(name, effectCode, args);
|
|
411
417
|
} catch (e) {
|
|
@@ -2457,8 +2457,11 @@ this.fAudioMixingHalf: ${this.fAudioMixingHalf}`;
|
|
|
2457
2457
|
}
|
|
2458
2458
|
}
|
|
2459
2459
|
});
|
|
2460
|
-
if (this.fInstance.effectAPI)
|
|
2460
|
+
if (this.fInstance.effectAPI) {
|
|
2461
|
+
console.log("effectAPI.getNumInputs() = %d", this.fInstance.effectAPI.getNumInputs(this.fEffect));
|
|
2462
|
+
console.log("effectAPI.getNumOutputs() = %d", this.fInstance.effectAPI.getNumOutputs(this.fEffect));
|
|
2461
2463
|
this.fInstance.effectAPI.compute(this.fEffect, this.fBufferSize, this.fAudioOutputs, this.fAudioOutputs);
|
|
2464
|
+
}
|
|
2462
2465
|
this.updateOutputs();
|
|
2463
2466
|
if (output !== void 0) {
|
|
2464
2467
|
for (let chan = 0; chan < Math.min(this.getNumOutputs(), output.length); chan++) {
|
|
@@ -2476,7 +2479,11 @@ this.fAudioMixingHalf: ${this.fAudioMixingHalf}`;
|
|
|
2476
2479
|
return this.fInstance.voiceAPI.getNumInputs(0);
|
|
2477
2480
|
}
|
|
2478
2481
|
getNumOutputs() {
|
|
2479
|
-
|
|
2482
|
+
if (this.fInstance.effectAPI) {
|
|
2483
|
+
console.log("effectAPI.getNumOutputs() = %d", this.fInstance.effectAPI.getNumOutputs(this.fEffect));
|
|
2484
|
+
console.log("VOICE.getNumOutputs() = %d", this.fInstance.voiceAPI.getNumOutputs(0));
|
|
2485
|
+
}
|
|
2486
|
+
return this.fInstance.effectAPI ? this.fInstance.effectAPI.getNumOutputs(this.fEffect) : this.fInstance.voiceAPI.getNumOutputs(0);
|
|
2480
2487
|
}
|
|
2481
2488
|
static findPath(o, p) {
|
|
2482
2489
|
if (typeof o !== "object") {
|
|
@@ -3637,10 +3644,15 @@ var _FaustPolyDspGenerator = class {
|
|
|
3637
3644
|
this.effectFactory = null;
|
|
3638
3645
|
}
|
|
3639
3646
|
async compile(compiler, name, dspCode, args, effectCode = `
|
|
3640
|
-
adapt(1,1) = _;
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3647
|
+
adapt(1,1) = _;
|
|
3648
|
+
adapt(2,2) = _,_;
|
|
3649
|
+
adapt(1,2) = _ <: _,_;
|
|
3650
|
+
adapt(2,1) = _,_ :> _;
|
|
3651
|
+
adaptor(F,G) = adapt(outputs(F),inputs(G));
|
|
3652
|
+
dsp_code = environment{
|
|
3653
|
+
${dspCode}
|
|
3654
|
+
};
|
|
3655
|
+
process = adaptor(dsp_code.process, dsp_code.effect) : dsp_code.effect;`) {
|
|
3644
3656
|
this.voiceFactory = await compiler.createPolyDSPFactory(name, dspCode, args);
|
|
3645
3657
|
if (!this.voiceFactory)
|
|
3646
3658
|
return null;
|