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