@grame/faustwasm 0.0.32 → 0.0.34

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.
@@ -1181,6 +1181,24 @@ export interface IFaustMonoDspGenerator {
1181
1181
  * @returns the compiled processor or 'null' if failure
1182
1182
  */
1183
1183
  createOfflineProcessor(sampleRate: number, bufferSize: number, factory?: LooseFaustDspFactory, meta?: FaustDspMeta): Promise<IFaustMonoOfflineProcessor | null>;
1184
+ /**
1185
+ * Get DSP JSON description with its UI and metadata as object.
1186
+ *
1187
+ * @return the DSP JSON description as object
1188
+ */
1189
+ getMeta(): FaustDspMeta;
1190
+ /**
1191
+ * Get DSP JSON description with its UI and metadata.
1192
+ *
1193
+ * @return the DSP JSON description
1194
+ */
1195
+ getJSON(): string;
1196
+ /**
1197
+ * Get DSP UI description.
1198
+ *
1199
+ * @return the DSP UI description
1200
+ */
1201
+ getUI(): FaustUIDescriptor;
1184
1202
  }
1185
1203
  export interface IFaustPolyDspGenerator {
1186
1204
  /**
@@ -1222,6 +1240,24 @@ export interface IFaustPolyDspGenerator {
1222
1240
  * @returns the compiled processor or 'null' if failure
1223
1241
  */
1224
1242
  createOfflineProcessor(sampleRate: number, bufferSize: number, voices: number, voiceFactory?: LooseFaustDspFactory, mixerModule?: WebAssembly.Module, effectFactory?: LooseFaustDspFactory | null): Promise<IFaustPolyOfflineProcessor | null>;
1243
+ /**
1244
+ * Get DSP JSON description with its UI and metadata as object.
1245
+ *
1246
+ * @return the DSP JSON description as object
1247
+ */
1248
+ getMeta(): FaustDspMeta;
1249
+ /**
1250
+ * Get DSP JSON description with its UI and metadata.
1251
+ *
1252
+ * @return the DSP JSON description
1253
+ */
1254
+ getJSON(): string;
1255
+ /**
1256
+ * Get DSP UI description.
1257
+ *
1258
+ * @return the DSP UI description
1259
+ */
1260
+ getUI(): FaustUIDescriptor;
1225
1261
  }
1226
1262
  export declare class FaustMonoDspGenerator implements IFaustMonoDspGenerator {
1227
1263
  private static gWorkletProcessors;
@@ -1237,6 +1273,9 @@ export declare class FaustMonoDspGenerator implements IFaustMonoDspGenerator {
1237
1273
  parameterDescriptors: AudioParamDescriptor[];
1238
1274
  }>;
1239
1275
  createOfflineProcessor(sampleRate: number, bufferSize: number, factory?: LooseFaustDspFactory): Promise<FaustMonoOfflineProcessor>;
1276
+ getMeta(): any;
1277
+ getJSON(): string;
1278
+ getUI(): any;
1240
1279
  }
1241
1280
  export declare class FaustPolyDspGenerator implements IFaustPolyDspGenerator {
1242
1281
  private static gWorkletProcessors;
@@ -1254,6 +1293,9 @@ export declare class FaustPolyDspGenerator implements IFaustPolyDspGenerator {
1254
1293
  parameterDescriptors: AudioParamDescriptor[];
1255
1294
  }>;
1256
1295
  createOfflineProcessor(sampleRate: number, bufferSize: number, voices: number, voiceFactory?: LooseFaustDspFactory, mixerModule?: WebAssembly.Module, effectFactory?: LooseFaustDspFactory | null): Promise<FaustPolyOfflineProcessor>;
1296
+ getMeta(): FaustDspMeta;
1297
+ getJSON(): string;
1298
+ getUI(): FaustUIDescriptor;
1257
1299
  }
1258
1300
 
1259
1301
  export {};
@@ -9659,6 +9659,15 @@ const dependencies = {
9659
9659
  const monoDsp = new FaustMonoWebAudioDsp(instance, sampleRate, sampleSize, bufferSize);
9660
9660
  return new FaustMonoOfflineProcessor(monoDsp, bufferSize);
9661
9661
  }
9662
+ getMeta() {
9663
+ return JSON.parse(this.factory.json);
9664
+ }
9665
+ getJSON() {
9666
+ return JSON.stringify(this.getMeta());
9667
+ }
9668
+ getUI() {
9669
+ return this.getMeta().ui;
9670
+ }
9662
9671
  };
9663
9672
  var FaustMonoDspGenerator = _FaustMonoDspGenerator;
9664
9673
  FaustMonoDspGenerator.gWorkletProcessors = /* @__PURE__ */ new Map();
@@ -9779,6 +9788,36 @@ const dependencies = {
9779
9788
  const polyDsp = new FaustPolyWebAudioDsp(instance, sampleRate, sampleSize, bufferSize);
9780
9789
  return new FaustPolyOfflineProcessor(polyDsp, bufferSize);
9781
9790
  }
9791
+ getMeta() {
9792
+ const o = this.voiceFactory ? JSON.parse(this.voiceFactory.json) : null;
9793
+ const e = this.effectFactory ? JSON.parse(this.effectFactory.json) : null;
9794
+ const r = { ...o };
9795
+ if (e) {
9796
+ r.ui = [{
9797
+ type: "tgroup",
9798
+ label: "Sequencer",
9799
+ items: [
9800
+ { type: "vgroup", label: "Instrument", items: o.ui },
9801
+ { type: "vgroup", label: "Effect", items: e.ui }
9802
+ ]
9803
+ }];
9804
+ } else {
9805
+ r.ui = [{
9806
+ type: "tgroup",
9807
+ label: "Polyphonic",
9808
+ items: [
9809
+ { type: "vgroup", label: "Voices", items: o.ui }
9810
+ ]
9811
+ }];
9812
+ }
9813
+ return r;
9814
+ }
9815
+ getJSON() {
9816
+ return JSON.stringify(this.getMeta());
9817
+ }
9818
+ getUI() {
9819
+ return this.getMeta().ui;
9820
+ }
9782
9821
  };
9783
9822
  var FaustPolyDspGenerator = _FaustPolyDspGenerator;
9784
9823
  FaustPolyDspGenerator.gWorkletProcessors = /* @__PURE__ */ new Map();