@grame/faustwasm 0.0.54 → 0.0.55
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.d.ts +1 -1
- package/assets/standalone/faustwasm/index.js +11 -13
- package/assets/standalone/faustwasm/index.js.map +2 -2
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +11 -13
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs-bundle/index.d.ts +1 -1
- package/dist/cjs-bundle/index.js +13 -15
- package/dist/cjs-bundle/index.js.map +2 -2
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +11 -13
- package/dist/esm/index.js.map +2 -2
- package/dist/esm-bundle/index.d.ts +1 -1
- package/dist/esm-bundle/index.js +13 -15
- package/dist/esm-bundle/index.js.map +2 -2
- package/package.json +1 -1
- package/src/FaustDspGenerator.ts +16 -7
- package/test/bug.dsp +18 -0
- package/test/faustlive-wasm/faustwasm/index.d.ts +1 -1
- package/test/faustlive-wasm/faustwasm/index.js +11 -13
- package/test/faustlive-wasm/faustwasm/index.js.map +2 -2
|
@@ -1278,7 +1278,7 @@ export declare class FaustPolyDspGenerator implements IFaustPolyDspGenerator {
|
|
|
1278
1278
|
mixerBuffer: Uint8Array;
|
|
1279
1279
|
mixerModule: WebAssembly.Module;
|
|
1280
1280
|
constructor();
|
|
1281
|
-
compile(compiler: IFaustCompiler, name: string,
|
|
1281
|
+
compile(compiler: IFaustCompiler, name: string, dspCodeAux: string, args: string, effectCode?: string): Promise<this | null>;
|
|
1282
1282
|
createNode<SP extends boolean = false>(context: BaseAudioContext, voices: number, name?: string, voiceFactory?: LooseFaustDspFactory, mixerModule?: WebAssembly.Module, effectFactory?: LooseFaustDspFactory | null, sp?: SP, bufferSize?: number, processorName?: string): Promise<SP extends true ? FaustPolyScriptProcessorNode | null : FaustPolyAudioWorkletNode | null>;
|
|
1283
1283
|
createAudioWorkletProcessor(name?: string, voiceFactory?: LooseFaustDspFactory, effectFactory?: LooseFaustDspFactory | null, processorName?: string): Promise<{
|
|
1284
1284
|
new (options: AudioWorkletNodeOptions): AudioWorkletProcessor;
|
|
@@ -2457,11 +2457,8 @@ this.fAudioMixingHalf: ${this.fAudioMixingHalf}`;
|
|
|
2457
2457
|
}
|
|
2458
2458
|
}
|
|
2459
2459
|
});
|
|
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));
|
|
2460
|
+
if (this.fInstance.effectAPI)
|
|
2463
2461
|
this.fInstance.effectAPI.compute(this.fEffect, this.fBufferSize, this.fAudioOutputs, this.fAudioOutputs);
|
|
2464
|
-
}
|
|
2465
2462
|
this.updateOutputs();
|
|
2466
2463
|
if (output !== void 0) {
|
|
2467
2464
|
for (let chan = 0; chan < Math.min(this.getNumOutputs(), output.length); chan++) {
|
|
@@ -2479,11 +2476,7 @@ this.fAudioMixingHalf: ${this.fAudioMixingHalf}`;
|
|
|
2479
2476
|
return this.fInstance.voiceAPI.getNumInputs(0);
|
|
2480
2477
|
}
|
|
2481
2478
|
getNumOutputs() {
|
|
2482
|
-
|
|
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);
|
|
2479
|
+
return this.fInstance.voiceAPI.getNumOutputs(0);
|
|
2487
2480
|
}
|
|
2488
2481
|
static findPath(o, p) {
|
|
2489
2482
|
if (typeof o !== "object") {
|
|
@@ -3643,21 +3636,26 @@ var _FaustPolyDspGenerator = class {
|
|
|
3643
3636
|
this.voiceFactory = null;
|
|
3644
3637
|
this.effectFactory = null;
|
|
3645
3638
|
}
|
|
3646
|
-
async compile(compiler, name,
|
|
3639
|
+
async compile(compiler, name, dspCodeAux, args, effectCode = `
|
|
3640
|
+
dsp_code = environment{
|
|
3641
|
+
${dspCodeAux}
|
|
3642
|
+
};
|
|
3643
|
+
process = dsp_code.effect;`) {
|
|
3644
|
+
const dspCode = `
|
|
3647
3645
|
adapt(1,1) = _;
|
|
3648
3646
|
adapt(2,2) = _,_;
|
|
3649
3647
|
adapt(1,2) = _ <: _,_;
|
|
3650
3648
|
adapt(2,1) = _,_ :> _;
|
|
3651
3649
|
adaptor(F,G) = adapt(outputs(F),inputs(G));
|
|
3652
3650
|
dsp_code = environment{
|
|
3653
|
-
${
|
|
3651
|
+
${dspCodeAux}
|
|
3654
3652
|
};
|
|
3655
|
-
process = adaptor(dsp_code.process, dsp_code.effect)
|
|
3653
|
+
process = dsp_code.process : adaptor(dsp_code.process, dsp_code.effect);`;
|
|
3656
3654
|
this.voiceFactory = await compiler.createPolyDSPFactory(name, dspCode, args);
|
|
3657
3655
|
if (!this.voiceFactory)
|
|
3658
3656
|
return null;
|
|
3659
3657
|
try {
|
|
3660
|
-
this.effectFactory = await compiler.createPolyDSPFactory(name, effectCode, args);
|
|
3658
|
+
this.effectFactory = await compiler.createPolyDSPFactory(name, effectCode, args + " -inpl");
|
|
3661
3659
|
} catch (e) {
|
|
3662
3660
|
console.warn(e);
|
|
3663
3661
|
}
|