@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 {};
@@ -9622,6 +9622,15 @@ const dependencies = {
9622
9622
  const monoDsp = new FaustMonoWebAudioDsp(instance, sampleRate, sampleSize, bufferSize);
9623
9623
  return new FaustMonoOfflineProcessor(monoDsp, bufferSize);
9624
9624
  }
9625
+ getMeta() {
9626
+ return JSON.parse(this.factory.json);
9627
+ }
9628
+ getJSON() {
9629
+ return JSON.stringify(this.getMeta());
9630
+ }
9631
+ getUI() {
9632
+ return this.getMeta().ui;
9633
+ }
9625
9634
  };
9626
9635
  var FaustMonoDspGenerator = _FaustMonoDspGenerator;
9627
9636
  FaustMonoDspGenerator.gWorkletProcessors = /* @__PURE__ */ new Map();
@@ -9742,6 +9751,36 @@ const dependencies = {
9742
9751
  const polyDsp = new FaustPolyWebAudioDsp(instance, sampleRate, sampleSize, bufferSize);
9743
9752
  return new FaustPolyOfflineProcessor(polyDsp, bufferSize);
9744
9753
  }
9754
+ getMeta() {
9755
+ const o = this.voiceFactory ? JSON.parse(this.voiceFactory.json) : null;
9756
+ const e = this.effectFactory ? JSON.parse(this.effectFactory.json) : null;
9757
+ const r = { ...o };
9758
+ if (e) {
9759
+ r.ui = [{
9760
+ type: "tgroup",
9761
+ label: "Sequencer",
9762
+ items: [
9763
+ { type: "vgroup", label: "Instrument", items: o.ui },
9764
+ { type: "vgroup", label: "Effect", items: e.ui }
9765
+ ]
9766
+ }];
9767
+ } else {
9768
+ r.ui = [{
9769
+ type: "tgroup",
9770
+ label: "Polyphonic",
9771
+ items: [
9772
+ { type: "vgroup", label: "Voices", items: o.ui }
9773
+ ]
9774
+ }];
9775
+ }
9776
+ return r;
9777
+ }
9778
+ getJSON() {
9779
+ return JSON.stringify(this.getMeta());
9780
+ }
9781
+ getUI() {
9782
+ return this.getMeta().ui;
9783
+ }
9745
9784
  };
9746
9785
  var FaustPolyDspGenerator = _FaustPolyDspGenerator;
9747
9786
  FaustPolyDspGenerator.gWorkletProcessors = /* @__PURE__ */ new Map();