@grame/faustwasm 0.0.45 → 0.0.46
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 +2 -2
- package/assets/standalone/faustwasm/index.js.map +1 -1
- package/assets/standalone/index.js +159 -142
- package/assets/standalone/template-poly.html +60 -0
- package/assets/standalone/template.html +50 -0
- package/assets/standalone/template.js +63 -0
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs-bundle/index.d.ts +2 -2
- package/dist/cjs-bundle/index.js.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm-bundle/index.d.ts +2 -2
- package/dist/esm-bundle/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/faust2wasm.js +6 -2
- package/src/FaustDspGenerator.ts +2 -2
- package/src/copyWebStandaloneAssets.d.ts +2 -1
- package/src/copyWebStandaloneAssets.js +16 -1
- package/test/faustlive-wasm/faustwasm/index.d.ts +2 -2
- package/test/faustlive-wasm/faustwasm/index.js.map +1 -1
- package/test/poly.dsp +1 -1
package/package.json
CHANGED
package/scripts/faust2wasm.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
//@ts-check
|
|
3
3
|
import * as process from "process";
|
|
4
4
|
import faust2wasmFiles from "../src/faust2wasmFiles.js";
|
|
5
|
-
import copyWebStandaloneAssets from "../src/copyWebStandaloneAssets.js";
|
|
5
|
+
import { copyWebStandaloneAssets, copyTemplate } from "../src/copyWebStandaloneAssets.js";
|
|
6
6
|
|
|
7
7
|
const argv = process.argv.slice(2);
|
|
8
8
|
|
|
@@ -26,5 +26,9 @@ const [inputFile, outputDir, ...argvFaust] = argv;
|
|
|
26
26
|
|
|
27
27
|
(async () => {
|
|
28
28
|
await faust2wasmFiles(inputFile, outputDir, argvFaust, poly);
|
|
29
|
-
if (standalone)
|
|
29
|
+
if (standalone) {
|
|
30
|
+
copyWebStandaloneAssets(outputDir);
|
|
31
|
+
} else {
|
|
32
|
+
copyTemplate(outputDir, poly);
|
|
33
|
+
}
|
|
30
34
|
})();
|
package/src/FaustDspGenerator.ts
CHANGED
|
@@ -103,7 +103,7 @@ export interface IFaustPolyDspGenerator {
|
|
|
103
103
|
*
|
|
104
104
|
* @param compiler - the Faust compiler
|
|
105
105
|
* @param name - the DSP name
|
|
106
|
-
* @param dspCode - the DSP code ('
|
|
106
|
+
* @param dspCode - the DSP code ('dspCode' can possibly contain an integrated effect)
|
|
107
107
|
* @param args - the compilation parameters
|
|
108
108
|
* @param effectCode - optional effect DSP code
|
|
109
109
|
* @returns the compiled factory or 'null' if failure
|
|
@@ -119,7 +119,7 @@ export interface IFaustPolyDspGenerator {
|
|
|
119
119
|
* @param voices - the number of voices
|
|
120
120
|
* @param name - AudioWorklet Processor name
|
|
121
121
|
* @param voiceFactory - the Faust factory for voices, either obtained with a compiler (createDSPFactory) or loaded from files (loadDSPFactory)
|
|
122
|
-
* @param mixerModule - the wasm Mixer module (loaded from 'mixer32.wasm' or 'mixer64.wasm' files)
|
|
122
|
+
* @param mixerModule - the wasm Mixer module (loaded from 'mixer32.wasm' or 'mixer64.wasm' files located in the 'faustwasm' package)
|
|
123
123
|
* @param effectFactory - the Faust factory for the effect, either obtained with a compiler (createDSPFactory) or loaded from files (loadDSPFactory)
|
|
124
124
|
* @param sp - whether to compile a ScriptProcessorNode or an AudioWorkletNode
|
|
125
125
|
* @param bufferSize - the buffer size in frames to be used in ScriptProcessorNode only, since AudioWorkletNode always uses 128 frames
|
|
@@ -17,4 +17,19 @@ const copyWebStandaloneAssets = (outputDir) => {
|
|
|
17
17
|
cpSync(assetsPath, outputDir);
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* @param {string} outputDir
|
|
22
|
+
*/
|
|
23
|
+
const copyTemplate = (outputDir, poly = false) => {
|
|
24
|
+
console.log(`Writing index file.`)
|
|
25
|
+
if (!fs.existsSync(outputDir)) fs.mkdirSync(outputDir);
|
|
26
|
+
const templateJSPath = path.join(__dirname, "../assets/standalone/template.js");
|
|
27
|
+
const templateHTMLPath = (poly) ? path.join(__dirname, "../assets/standalone/template-poly.html") : path.join(__dirname, "../assets/standalone/template.html");
|
|
28
|
+
const faustwasmPath = path.join(__dirname, "../assets/standalone/faustwasm");
|
|
29
|
+
cpSync(templateJSPath, outputDir + "/template.js");
|
|
30
|
+
cpSync(templateHTMLPath, outputDir + "/template.html");
|
|
31
|
+
cpSync(faustwasmPath, outputDir + "/faustwasm");
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { copyWebStandaloneAssets, copyTemplate };
|
|
35
|
+
|
|
@@ -1199,7 +1199,7 @@ export interface IFaustPolyDspGenerator {
|
|
|
1199
1199
|
*
|
|
1200
1200
|
* @param compiler - the Faust compiler
|
|
1201
1201
|
* @param name - the DSP name
|
|
1202
|
-
* @param dspCode - the DSP code ('
|
|
1202
|
+
* @param dspCode - the DSP code ('dspCode' can possibly contain an integrated effect)
|
|
1203
1203
|
* @param args - the compilation parameters
|
|
1204
1204
|
* @param effectCode - optional effect DSP code
|
|
1205
1205
|
* @returns the compiled factory or 'null' if failure
|
|
@@ -1215,7 +1215,7 @@ export interface IFaustPolyDspGenerator {
|
|
|
1215
1215
|
* @param voices - the number of voices
|
|
1216
1216
|
* @param name - AudioWorklet Processor name
|
|
1217
1217
|
* @param voiceFactory - the Faust factory for voices, either obtained with a compiler (createDSPFactory) or loaded from files (loadDSPFactory)
|
|
1218
|
-
* @param mixerModule - the wasm Mixer module (loaded from 'mixer32.wasm' or 'mixer64.wasm' files)
|
|
1218
|
+
* @param mixerModule - the wasm Mixer module (loaded from 'mixer32.wasm' or 'mixer64.wasm' files located in the 'faustwasm' package)
|
|
1219
1219
|
* @param effectFactory - the Faust factory for the effect, either obtained with a compiler (createDSPFactory) or loaded from files (loadDSPFactory)
|
|
1220
1220
|
* @param sp - whether to compile a ScriptProcessorNode or an AudioWorkletNode
|
|
1221
1221
|
* @param bufferSize - the buffer size in frames to be used in ScriptProcessorNode only, since AudioWorkletNode always uses 128 frames
|