@grame/faustwasm 0.0.64 → 0.0.65

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.
@@ -988,6 +988,22 @@ export declare class FaustSvgDiagrams implements IFaustSvgDiagrams {
988
988
  constructor(compiler: FaustCompiler);
989
989
  from(name: string, code: string, args: string): Record<string, string>;
990
990
  }
991
+ export interface IFaustCmajor {
992
+ /**
993
+ * Generates auxiliary files from Faust code. The output depends on the compiler options.
994
+ *
995
+ * @param name - the DSP's name
996
+ * @param code - Faust code
997
+ * @param args - compilation args
998
+ * @returns the Cmajor compiled string
999
+ */
1000
+ compile(name: string, code: string, args: string): string;
1001
+ }
1002
+ export declare class FaustCmajor implements IFaustCmajor {
1003
+ private compiler;
1004
+ constructor(compiler: FaustCompiler);
1005
+ compile(name: string, code: string, args: string): string;
1006
+ }
991
1007
  export interface WavEncoderOptions {
992
1008
  bitDepth: number;
993
1009
  float?: boolean;
@@ -2740,7 +2740,7 @@ var FaustSvgDiagrams = class {
2740
2740
  files2.filter((file) => file !== "." && file !== "..").forEach((file) => fs.unlink(`/${name}-svg/${file}`));
2741
2741
  } catch {
2742
2742
  }
2743
- const success = this.compiler.generateAuxFiles(name, code, `-lang wasm -svg ${args}`);
2743
+ const success = this.compiler.generateAuxFiles(name, code, `-lang wasm -o binary -svg ${args}`);
2744
2744
  if (!success)
2745
2745
  throw new Error(this.compiler.getErrorMessage());
2746
2746
  const svgs = {};
@@ -2751,6 +2751,19 @@ var FaustSvgDiagrams = class {
2751
2751
  };
2752
2752
  var FaustSvgDiagrams_default = FaustSvgDiagrams;
2753
2753
 
2754
+ // src/FaustCmajor.ts
2755
+ var FaustCmajor = class {
2756
+ constructor(compiler) {
2757
+ this.compiler = compiler;
2758
+ }
2759
+ compile(name, code, args) {
2760
+ const fs = this.compiler.fs();
2761
+ const success = this.compiler.generateAuxFiles(name, code, `-lang cmajor-hybrid -cn ${name} -o ${name}.cmajor`);
2762
+ return success ? fs.readFile(`${name}.cmajor`, { encoding: "utf8" }) : "";
2763
+ }
2764
+ };
2765
+ var FaustCmajor_default = FaustCmajor;
2766
+
2754
2767
  // src/LibFaust.ts
2755
2768
  var LibFaust = class {
2756
2769
  constructor(module) {
@@ -3831,6 +3844,7 @@ FaustPolyDspGenerator.gWorkletProcessors = /* @__PURE__ */ new Map();
3831
3844
  export {
3832
3845
  FaustAudioWorkletNode,
3833
3846
  FaustBaseWebAudioDsp,
3847
+ FaustCmajor_default as FaustCmajor,
3834
3848
  FaustCompiler_default as FaustCompiler,
3835
3849
  FaustDspInstance,
3836
3850
  FaustMonoAudioWorkletNode,