@grame/faustwasm 0.0.55 → 0.0.56
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 +4 -9
- package/assets/standalone/faustwasm/index.js.map +2 -2
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +4 -9
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs-bundle/index.d.ts +1 -1
- package/dist/cjs-bundle/index.js +4 -9
- package/dist/cjs-bundle/index.js.map +2 -2
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +4 -9
- package/dist/esm/index.js.map +2 -2
- package/dist/esm-bundle/index.d.ts +1 -1
- package/dist/esm-bundle/index.js +4 -9
- package/dist/esm-bundle/index.js.map +2 -2
- package/package.json +1 -1
- package/src/FaustDspGenerator.ts +6 -15
- package/test/faustlive-wasm/faustwasm/index.d.ts +1 -1
- package/test/faustlive-wasm/faustwasm/index.js +4 -9
- package/test/faustlive-wasm/faustwasm/index.js.map +2 -2
- package/test/bug.dsp +0 -18
package/package.json
CHANGED
package/src/FaustDspGenerator.ts
CHANGED
|
@@ -395,34 +395,25 @@ export class FaustPolyDspGenerator implements IFaustPolyDspGenerator {
|
|
|
395
395
|
async compile(
|
|
396
396
|
compiler: IFaustCompiler,
|
|
397
397
|
name: string,
|
|
398
|
-
|
|
398
|
+
dspCode: string,
|
|
399
399
|
args: string,
|
|
400
|
-
// The ${
|
|
400
|
+
// The ${dspCode} has to be added with wrapping new lines to make it properly formatted and ready to compile
|
|
401
401
|
effectCode = `
|
|
402
|
-
dsp_code = environment{
|
|
403
|
-
${dspCodeAux}
|
|
404
|
-
};
|
|
405
|
-
process = dsp_code.effect;`
|
|
406
|
-
) {
|
|
407
|
-
// Since the effect is going to process the voice outputs "in-place",
|
|
408
|
-
// the voice output number has to be the same as the effect input number
|
|
409
|
-
const dspCode = `
|
|
410
402
|
adapt(1,1) = _;
|
|
411
403
|
adapt(2,2) = _,_;
|
|
412
404
|
adapt(1,2) = _ <: _,_;
|
|
413
405
|
adapt(2,1) = _,_ :> _;
|
|
414
406
|
adaptor(F,G) = adapt(outputs(F),inputs(G));
|
|
415
407
|
dsp_code = environment{
|
|
416
|
-
${
|
|
408
|
+
${dspCode}
|
|
417
409
|
};
|
|
418
|
-
process =
|
|
419
|
-
|
|
410
|
+
process = adaptor(dsp_code.process, dsp_code.effect) : dsp_code.effect;`
|
|
411
|
+
) {
|
|
420
412
|
this.voiceFactory = await compiler.createPolyDSPFactory(name, dspCode, args);
|
|
421
413
|
if (!this.voiceFactory) return null;
|
|
422
414
|
// Compile effect, possibly failing
|
|
423
415
|
try {
|
|
424
|
-
|
|
425
|
-
this.effectFactory = await compiler.createPolyDSPFactory(name, effectCode, args + " -inpl");
|
|
416
|
+
this.effectFactory = await compiler.createPolyDSPFactory(name, effectCode, args);
|
|
426
417
|
} catch (e) {
|
|
427
418
|
console.warn(e);
|
|
428
419
|
}
|
|
@@ -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, dspCode: 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;
|
|
@@ -3636,26 +3636,21 @@ var _FaustPolyDspGenerator = class {
|
|
|
3636
3636
|
this.voiceFactory = null;
|
|
3637
3637
|
this.effectFactory = null;
|
|
3638
3638
|
}
|
|
3639
|
-
async compile(compiler, name,
|
|
3640
|
-
dsp_code = environment{
|
|
3641
|
-
${dspCodeAux}
|
|
3642
|
-
};
|
|
3643
|
-
process = dsp_code.effect;`) {
|
|
3644
|
-
const dspCode = `
|
|
3639
|
+
async compile(compiler, name, dspCode, args, effectCode = `
|
|
3645
3640
|
adapt(1,1) = _;
|
|
3646
3641
|
adapt(2,2) = _,_;
|
|
3647
3642
|
adapt(1,2) = _ <: _,_;
|
|
3648
3643
|
adapt(2,1) = _,_ :> _;
|
|
3649
3644
|
adaptor(F,G) = adapt(outputs(F),inputs(G));
|
|
3650
3645
|
dsp_code = environment{
|
|
3651
|
-
${
|
|
3646
|
+
${dspCode}
|
|
3652
3647
|
};
|
|
3653
|
-
process =
|
|
3648
|
+
process = adaptor(dsp_code.process, dsp_code.effect) : dsp_code.effect;`) {
|
|
3654
3649
|
this.voiceFactory = await compiler.createPolyDSPFactory(name, dspCode, args);
|
|
3655
3650
|
if (!this.voiceFactory)
|
|
3656
3651
|
return null;
|
|
3657
3652
|
try {
|
|
3658
|
-
this.effectFactory = await compiler.createPolyDSPFactory(name, effectCode, args
|
|
3653
|
+
this.effectFactory = await compiler.createPolyDSPFactory(name, effectCode, args);
|
|
3659
3654
|
} catch (e) {
|
|
3660
3655
|
console.warn(e);
|
|
3661
3656
|
}
|