@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 CHANGED
@@ -222,7 +222,8 @@ The package is used in the following projects:
222
222
 
223
223
  - [faust-web-component](https://github.com/grame-cncm/faust-web-component), a package providing two web components for embedding interactive Faust snippets in web pages.
224
224
  - [Faust Playground](https://github.com/grame-cncm/faustplayground), a Web platform designed to enable children to learn basic audio programming in a simple and graphic way.
225
- - [Faust Editor](https://github.com/grame-cncm/fausteditor), an online editor used to edit, compile and run Faust code from any recent Web Browser with WebAssembly support.
225
+ - [Faust Editor](https://github.com/grame-cncm/fausteditor), a simple online editor used to edit, compile and run Faust code from any recent Web Browser with WebAssembly support.
226
+ - [Faust Web IDE](https://github.com/grame-cncm/faustide), a more powerfull editor used to edit, compile and run Faust code from any recent Web Browser with WebAssembly support.
226
227
  - [Testing the embedded dynamic Faust compiler](https://fausteditor.grame.fr/faustlive-wasm.html) page allows to test the compiler, with this [HTML source code](https://github.com/grame-cncm/fausteditor/blob/master/faustlive-wasm.html) using [this JavaScript code](https://github.com/grame-cncm/fausteditor/blob/master/src/faustlive-wasm.js).
227
228
 
228
229
  ## Documentation
@@ -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
- return this.fInstance.voiceAPI.getNumOutputs(0);
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) = _; adapt(2,2) = _,_; adapt(1,2) = _ <: _,_; adapt(2,1) = _,_ :> _;
3641
- adaptor(F,G) = adapt(outputs(F),inputs(G));
3642
- dsp_code = environment{${dspCode}};
3643
- process = adaptor(dsp_code.process, dsp_code.effect) : dsp_code.effect;`) {
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;