@grame/faustwasm 0.0.66 → 0.0.67

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/TODO.md ADDED
@@ -0,0 +1,5 @@
1
+ # Soundfile handling
2
+
3
+ - la memoire wasm doit être allouée en extene dès qu'il y a des `soundfile` dans le DSP.
4
+
5
+ - actuellement **createMemoryAux** est utilisé pour le mode polyphoncique, il faudra en faire un pour le mode mono on avec soundfile
@@ -131,6 +131,7 @@ export interface FaustUIInputItem {
131
131
  type: FaustUIInputType;
132
132
  label: string;
133
133
  address: string;
134
+ url: string;
134
135
  index: number;
135
136
  init?: number;
136
137
  min?: number;
@@ -158,7 +159,7 @@ export interface FaustUIMeta {
158
159
  }
159
160
  export type FaustUIGroupType = "vgroup" | "hgroup" | "tgroup";
160
161
  export type FaustUIOutputType = "hbargraph" | "vbargraph";
161
- export type FaustUIInputType = "vslider" | "hslider" | "button" | "checkbox" | "nentry";
162
+ export type FaustUIInputType = "vslider" | "hslider" | "button" | "checkbox" | "nentry" | "soundfile";
162
163
  export interface FaustUIGroup {
163
164
  type: FaustUIGroupType;
164
165
  label: string;
@@ -767,7 +768,8 @@ export interface FaustFFTAudioWorkletProcessorOptions {
767
768
  }
768
769
  export declare const getFaustFFTAudioWorkletProcessor: (dependencies: FaustFFTAudioWorkletProcessorDependencies, faustData: FaustFFTData, register?: boolean) => {
769
770
  new (options: AudioWorkletNodeOptions): AudioWorkletProcessor;
770
- prototype: AudioWorkletProcessor; /** Generated from the current window function */
771
+ /** Generated from the current window function */
772
+ prototype: AudioWorkletProcessor;
771
773
  parameterDescriptors: AudioParamDescriptor[];
772
774
  };
773
775
  export interface ILibFaust extends LibFaustWasm {
@@ -131,6 +131,7 @@ export interface FaustUIInputItem {
131
131
  type: FaustUIInputType;
132
132
  label: string;
133
133
  address: string;
134
+ url: string;
134
135
  index: number;
135
136
  init?: number;
136
137
  min?: number;
@@ -158,7 +159,7 @@ export interface FaustUIMeta {
158
159
  }
159
160
  export type FaustUIGroupType = "vgroup" | "hgroup" | "tgroup";
160
161
  export type FaustUIOutputType = "hbargraph" | "vbargraph";
161
- export type FaustUIInputType = "vslider" | "hslider" | "button" | "checkbox" | "nentry";
162
+ export type FaustUIInputType = "vslider" | "hslider" | "button" | "checkbox" | "nentry" | "soundfile";
162
163
  export interface FaustUIGroup {
163
164
  type: FaustUIGroupType;
164
165
  label: string;
@@ -767,7 +768,8 @@ export interface FaustFFTAudioWorkletProcessorOptions {
767
768
  }
768
769
  export declare const getFaustFFTAudioWorkletProcessor: (dependencies: FaustFFTAudioWorkletProcessorDependencies, faustData: FaustFFTData, register?: boolean) => {
769
770
  new (options: AudioWorkletNodeOptions): AudioWorkletProcessor;
770
- prototype: AudioWorkletProcessor; /** Generated from the current window function */
771
+ /** Generated from the current window function */
772
+ prototype: AudioWorkletProcessor;
771
773
  parameterDescriptors: AudioParamDescriptor[];
772
774
  };
773
775
  export interface ILibFaust extends LibFaustWasm {
@@ -131,6 +131,7 @@ export interface FaustUIInputItem {
131
131
  type: FaustUIInputType;
132
132
  label: string;
133
133
  address: string;
134
+ url: string;
134
135
  index: number;
135
136
  init?: number;
136
137
  min?: number;
@@ -158,7 +159,7 @@ export interface FaustUIMeta {
158
159
  }
159
160
  export type FaustUIGroupType = "vgroup" | "hgroup" | "tgroup";
160
161
  export type FaustUIOutputType = "hbargraph" | "vbargraph";
161
- export type FaustUIInputType = "vslider" | "hslider" | "button" | "checkbox" | "nentry";
162
+ export type FaustUIInputType = "vslider" | "hslider" | "button" | "checkbox" | "nentry" | "soundfile";
162
163
  export interface FaustUIGroup {
163
164
  type: FaustUIGroupType;
164
165
  label: string;
@@ -774,7 +775,8 @@ export interface FaustFFTAudioWorkletProcessorOptions {
774
775
  }
775
776
  export declare const getFaustFFTAudioWorkletProcessor: (dependencies: FaustFFTAudioWorkletProcessorDependencies, faustData: FaustFFTData, register?: boolean) => {
776
777
  new (options: AudioWorkletNodeOptions): AudioWorkletProcessor;
777
- prototype: AudioWorkletProcessor; /** Generated from the current window function */
778
+ /** Generated from the current window function */
779
+ prototype: AudioWorkletProcessor;
778
780
  parameterDescriptors: AudioParamDescriptor[];
779
781
  };
780
782
  export interface ILibFaust extends LibFaustWasm {
@@ -131,6 +131,7 @@ export interface FaustUIInputItem {
131
131
  type: FaustUIInputType;
132
132
  label: string;
133
133
  address: string;
134
+ url: string;
134
135
  index: number;
135
136
  init?: number;
136
137
  min?: number;
@@ -158,7 +159,7 @@ export interface FaustUIMeta {
158
159
  }
159
160
  export type FaustUIGroupType = "vgroup" | "hgroup" | "tgroup";
160
161
  export type FaustUIOutputType = "hbargraph" | "vbargraph";
161
- export type FaustUIInputType = "vslider" | "hslider" | "button" | "checkbox" | "nentry";
162
+ export type FaustUIInputType = "vslider" | "hslider" | "button" | "checkbox" | "nentry" | "soundfile";
162
163
  export interface FaustUIGroup {
163
164
  type: FaustUIGroupType;
164
165
  label: string;
@@ -767,7 +768,8 @@ export interface FaustFFTAudioWorkletProcessorOptions {
767
768
  }
768
769
  export declare const getFaustFFTAudioWorkletProcessor: (dependencies: FaustFFTAudioWorkletProcessorDependencies, faustData: FaustFFTData, register?: boolean) => {
769
770
  new (options: AudioWorkletNodeOptions): AudioWorkletProcessor;
770
- prototype: AudioWorkletProcessor; /** Generated from the current window function */
771
+ /** Generated from the current window function */
772
+ prototype: AudioWorkletProcessor;
771
773
  parameterDescriptors: AudioParamDescriptor[];
772
774
  };
773
775
  export interface ILibFaust extends LibFaustWasm {
@@ -131,6 +131,7 @@ export interface FaustUIInputItem {
131
131
  type: FaustUIInputType;
132
132
  label: string;
133
133
  address: string;
134
+ url: string;
134
135
  index: number;
135
136
  init?: number;
136
137
  min?: number;
@@ -158,7 +159,7 @@ export interface FaustUIMeta {
158
159
  }
159
160
  export type FaustUIGroupType = "vgroup" | "hgroup" | "tgroup";
160
161
  export type FaustUIOutputType = "hbargraph" | "vbargraph";
161
- export type FaustUIInputType = "vslider" | "hslider" | "button" | "checkbox" | "nentry";
162
+ export type FaustUIInputType = "vslider" | "hslider" | "button" | "checkbox" | "nentry" | "soundfile";
162
163
  export interface FaustUIGroup {
163
164
  type: FaustUIGroupType;
164
165
  label: string;
@@ -774,7 +775,8 @@ export interface FaustFFTAudioWorkletProcessorOptions {
774
775
  }
775
776
  export declare const getFaustFFTAudioWorkletProcessor: (dependencies: FaustFFTAudioWorkletProcessorDependencies, faustData: FaustFFTData, register?: boolean) => {
776
777
  new (options: AudioWorkletNodeOptions): AudioWorkletProcessor;
777
- prototype: AudioWorkletProcessor; /** Generated from the current window function */
778
+ /** Generated from the current window function */
779
+ prototype: AudioWorkletProcessor;
778
780
  parameterDescriptors: AudioParamDescriptor[];
779
781
  };
780
782
  export interface ILibFaust extends LibFaustWasm {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grame/faustwasm",
3
- "version": "0.0.66",
3
+ "version": "0.0.67",
4
4
  "description": "WebAssembly version of Faust Compiler",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/esm/index.d.ts",
package/src/types.ts CHANGED
@@ -112,7 +112,7 @@ export interface LibFaustWasm {
112
112
  * json: the compiled DSP JSON description
113
113
  * poly: whether the factory is a polyphonic one or not
114
114
  */
115
- export interface FaustDspFactory extends Required<LooseFaustDspFactory> {}
115
+ export interface FaustDspFactory extends Required<LooseFaustDspFactory> { }
116
116
 
117
117
  export interface LooseFaustDspFactory {
118
118
  cfactory?: number;
@@ -143,6 +143,7 @@ export interface FaustUIInputItem {
143
143
  type: FaustUIInputType;
144
144
  label: string;
145
145
  address: string;
146
+ url: string;
146
147
  index: number;
147
148
  init?: number;
148
149
  min?: number;
@@ -170,7 +171,7 @@ export interface FaustUIMeta {
170
171
  }
171
172
  export type FaustUIGroupType = "vgroup" | "hgroup" | "tgroup";
172
173
  export type FaustUIOutputType = "hbargraph" | "vbargraph";
173
- export type FaustUIInputType = "vslider" | "hslider" | "button" | "checkbox" | "nentry";
174
+ export type FaustUIInputType = "vslider" | "hslider" | "button" | "checkbox" | "nentry" | "soundfile";
174
175
  export interface FaustUIGroup {
175
176
  type: FaustUIGroupType;
176
177
  label: string;
@@ -193,7 +194,7 @@ export interface AudioWorkletProcessor {
193
194
  export declare const AudioWorkletProcessor: {
194
195
  prototype: AudioWorkletProcessor;
195
196
  parameterDescriptors: AudioParamDescriptor[];
196
- new (options: AudioWorkletNodeOptions): AudioWorkletProcessor;
197
+ new(options: AudioWorkletNodeOptions): AudioWorkletProcessor;
197
198
  };
198
199
 
199
200
  export interface AudioWorkletGlobalScope {
@@ -212,7 +213,7 @@ export interface InterfaceFFT {
212
213
  dispose(): void;
213
214
  }
214
215
  export declare const InterfaceFFT: {
215
- new (size: number): InterfaceFFT;
216
+ new(size: number): InterfaceFFT;
216
217
  }
217
218
 
218
219
  export type TWindowFunction = (index: number, length: number, ...args: any[]) => number;
@@ -131,6 +131,7 @@ export interface FaustUIInputItem {
131
131
  type: FaustUIInputType;
132
132
  label: string;
133
133
  address: string;
134
+ url: string;
134
135
  index: number;
135
136
  init?: number;
136
137
  min?: number;
@@ -158,7 +159,7 @@ export interface FaustUIMeta {
158
159
  }
159
160
  export type FaustUIGroupType = "vgroup" | "hgroup" | "tgroup";
160
161
  export type FaustUIOutputType = "hbargraph" | "vbargraph";
161
- export type FaustUIInputType = "vslider" | "hslider" | "button" | "checkbox" | "nentry";
162
+ export type FaustUIInputType = "vslider" | "hslider" | "button" | "checkbox" | "nentry" | "soundfile";
162
163
  export interface FaustUIGroup {
163
164
  type: FaustUIGroupType;
164
165
  label: string;
@@ -767,7 +768,8 @@ export interface FaustFFTAudioWorkletProcessorOptions {
767
768
  }
768
769
  export declare const getFaustFFTAudioWorkletProcessor: (dependencies: FaustFFTAudioWorkletProcessorDependencies, faustData: FaustFFTData, register?: boolean) => {
769
770
  new (options: AudioWorkletNodeOptions): AudioWorkletProcessor;
770
- prototype: AudioWorkletProcessor; /** Generated from the current window function */
771
+ /** Generated from the current window function */
772
+ prototype: AudioWorkletProcessor;
771
773
  parameterDescriptors: AudioParamDescriptor[];
772
774
  };
773
775
  export interface ILibFaust extends LibFaustWasm {
package/test/tp0.dsp ADDED
@@ -0,0 +1,17 @@
1
+ import("stdfaust.lib");
2
+
3
+ //process = 0,_~+(1):soundfile("sound[url:{http://127.0.0.1:8000/RnB.wav}]",2):_,_,!,!;
4
+
5
+ //process = 0,_~+(1):soundfile("sound[url:{'https://www.w3schools.com/html/horse.mp3'}]",2):_,_,!,!;
6
+
7
+
8
+ process = 0,_~+(1):soundfile("sound[url:{'http://127.0.0.1:8000/RnB.wav'}]",2):!,!,_,_;
9
+
10
+ //process = 0,_~+(1.5):soundfile("sound[url:{'http://127.0.0.1:8000/tango.wav'}]",2):!,!,_,_;
11
+
12
+ //process = 1,_~+(1):soundfile("sound[url:{'http://127.0.0.1:8000/RnB.wav';'http://127.0.0.1:8000/tango.wav'}]",2):!,!,_,_;
13
+
14
+ //left = 0,_~+(1):soundfile("sound[url:{'http://127.0.0.1:8000/RnB.wav';'http://127.0.0.1:8000/tango.wav'}]",2):!,!,_,!;
15
+ //right = 1,_~+(1.5):soundfile("sound[url:{'http://127.0.0.1:8000/RnB.wav';'http://127.0.0.1:8000/tango.wav'}]",2):!,!,_,!;
16
+
17
+ //process = left, right;
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "tp0",
3
+ "filename": "tp0.dsp",
4
+ "version": "2.72.14",
5
+ "compile_options": "-lang cpp -ct 1 -es 1 -mcd 16 -mdd 1024 -mdy 33 -single -ftz 0",
6
+ "library_list": ["/usr/local/share/faust/stdfaust.lib"],
7
+ "include_pathnames": ["/usr/local/share/faust","/usr/local/share/faust","/usr/share/faust","test","/Users/letz/Developpements/faust-wasm/faustwasm/test"],
8
+ "size": 20,
9
+ "inputs": 0,
10
+ "outputs": 2,
11
+ "meta": [
12
+ { "compile_options": "-lang cpp -ct 1 -es 1 -mcd 16 -mdd 1024 -mdy 33 -single -ftz 0" },
13
+ { "filename": "tp0.dsp" },
14
+ { "name": "tp0" }
15
+ ],
16
+ "ui": [
17
+ {
18
+ "type": "vgroup",
19
+ "label": "tp0",
20
+ "items": [
21
+ {
22
+ "type": "soundfile",
23
+ "label": "sound",
24
+ "url": "{'file:///Users/letz/Developpements/faust-wasm/faustwasm/test/RnB.wav'}",
25
+ "address": "/tp0/sound"
26
+ }
27
+ ]
28
+ }
29
+ ]
30
+ }
@@ -0,0 +1,5 @@
1
+ import("stdfaust.lib");
2
+
3
+ //process = 0,_~+(1):soundfile("sound[url:{http://127.0.0.1:8000/RnB.wav}]",2):_,_,!,!;
4
+
5
+ process = 0,_~+(1.5):soundfile("sound[url:{'RnB.wav';'tango.wav'}]",2):!,!,_,_;