@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/dist/cjs/index.js CHANGED
@@ -2465,8 +2465,11 @@ this.fAudioMixingHalf: ${this.fAudioMixingHalf}`;
2465
2465
  }
2466
2466
  }
2467
2467
  });
2468
- if (this.fInstance.effectAPI)
2468
+ if (this.fInstance.effectAPI) {
2469
+ console.log("effectAPI.getNumInputs() = %d", this.fInstance.effectAPI.getNumInputs(this.fEffect));
2470
+ console.log("effectAPI.getNumOutputs() = %d", this.fInstance.effectAPI.getNumOutputs(this.fEffect));
2469
2471
  this.fInstance.effectAPI.compute(this.fEffect, this.fBufferSize, this.fAudioOutputs, this.fAudioOutputs);
2472
+ }
2470
2473
  this.updateOutputs();
2471
2474
  if (output !== void 0) {
2472
2475
  for (let chan = 0; chan < Math.min(this.getNumOutputs(), output.length); chan++) {
@@ -2484,7 +2487,11 @@ this.fAudioMixingHalf: ${this.fAudioMixingHalf}`;
2484
2487
  return this.fInstance.voiceAPI.getNumInputs(0);
2485
2488
  }
2486
2489
  getNumOutputs() {
2487
- return this.fInstance.voiceAPI.getNumOutputs(0);
2490
+ if (this.fInstance.effectAPI) {
2491
+ console.log("effectAPI.getNumOutputs() = %d", this.fInstance.effectAPI.getNumOutputs(this.fEffect));
2492
+ console.log("VOICE.getNumOutputs() = %d", this.fInstance.voiceAPI.getNumOutputs(0));
2493
+ }
2494
+ return this.fInstance.effectAPI ? this.fInstance.effectAPI.getNumOutputs(this.fEffect) : this.fInstance.voiceAPI.getNumOutputs(0);
2488
2495
  }
2489
2496
  static findPath(o, p) {
2490
2497
  if (typeof o !== "object") {
@@ -3645,10 +3652,15 @@ const dependencies = {
3645
3652
  this.effectFactory = null;
3646
3653
  }
3647
3654
  async compile(compiler, name, dspCode, args, effectCode = `
3648
- adapt(1,1) = _; adapt(2,2) = _,_; adapt(1,2) = _ <: _,_; adapt(2,1) = _,_ :> _;
3649
- adaptor(F,G) = adapt(outputs(F),inputs(G));
3650
- dsp_code = environment{${dspCode}};
3651
- process = adaptor(dsp_code.process, dsp_code.effect) : dsp_code.effect;`) {
3655
+ adapt(1,1) = _;
3656
+ adapt(2,2) = _,_;
3657
+ adapt(1,2) = _ <: _,_;
3658
+ adapt(2,1) = _,_ :> _;
3659
+ adaptor(F,G) = adapt(outputs(F),inputs(G));
3660
+ dsp_code = environment{
3661
+ ${dspCode}
3662
+ };
3663
+ process = adaptor(dsp_code.process, dsp_code.effect) : dsp_code.effect;`) {
3652
3664
  this.voiceFactory = await compiler.createPolyDSPFactory(name, dspCode, args);
3653
3665
  if (!this.voiceFactory)
3654
3666
  return null;