@grame/faustwasm 0.0.25

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.
Files changed (111) hide show
  1. package/README.md +181 -0
  2. package/assets/standalone/faust-ui/index.css +414 -0
  3. package/assets/standalone/faust-ui/index.css.map +1 -0
  4. package/assets/standalone/faust-ui/index.d.ts +1 -0
  5. package/assets/standalone/faust-ui/index.js +3478 -0
  6. package/assets/standalone/faust-ui/index.js.map +1 -0
  7. package/assets/standalone/faustwasm/index.d.ts +1252 -0
  8. package/assets/standalone/faustwasm/index.js +3772 -0
  9. package/assets/standalone/faustwasm/index.js.map +7 -0
  10. package/assets/standalone/index.html +73 -0
  11. package/assets/standalone/index.js +198 -0
  12. package/assets/standalone/types.d.ts +9 -0
  13. package/dist/cjs/index.d.ts +1252 -0
  14. package/dist/cjs/index.js +3752 -0
  15. package/dist/cjs/index.js.map +7 -0
  16. package/dist/cjs-bundle/index.d.ts +1259 -0
  17. package/dist/cjs-bundle/index.js +11507 -0
  18. package/dist/cjs-bundle/index.js.map +7 -0
  19. package/dist/esm/index.d.ts +1252 -0
  20. package/dist/esm/index.js +3772 -0
  21. package/dist/esm/index.js.map +7 -0
  22. package/dist/esm-bundle/index.d.ts +1259 -0
  23. package/dist/esm-bundle/index.js +11495 -0
  24. package/dist/esm-bundle/index.js.map +7 -0
  25. package/fileutils.js +40 -0
  26. package/libfaust-wasm/libfaust-wasm.d.cts +3 -0
  27. package/libfaust-wasm/libfaust-wasm.d.ts +3 -0
  28. package/libfaust-wasm/libfaust-wasm.data +0 -0
  29. package/libfaust-wasm/libfaust-wasm.data.d.ts +2 -0
  30. package/libfaust-wasm/libfaust-wasm.js +21 -0
  31. package/libfaust-wasm/libfaust-wasm.wasm +0 -0
  32. package/libfaust-wasm/libfaust-wasm.wasm.d.ts +2 -0
  33. package/library.md +91 -0
  34. package/package.json +43 -0
  35. package/postbuild-bundled.js +11 -0
  36. package/postbuild.js +63 -0
  37. package/prebuild-bundled.js +11 -0
  38. package/rsrc/overview.png +0 -0
  39. package/rsrc/overview.xlsx +0 -0
  40. package/scripts/faust2sndfile.js +43 -0
  41. package/scripts/faust2svg.js +17 -0
  42. package/scripts/faust2wasm.js +29 -0
  43. package/src/FaustAudioWorkletNode.ts +264 -0
  44. package/src/FaustAudioWorkletProcessor.ts +273 -0
  45. package/src/FaustCompiler.ts +252 -0
  46. package/src/FaustDspGenerator.ts +498 -0
  47. package/src/FaustDspInstance.ts +141 -0
  48. package/src/FaustFFTAudioWorkletProcessor.ts +554 -0
  49. package/src/FaustOfflineProcessor.ts +141 -0
  50. package/src/FaustScriptProcessorNode.ts +80 -0
  51. package/src/FaustSvgDiagrams.ts +37 -0
  52. package/src/FaustWasmInstantiator.ts +202 -0
  53. package/src/FaustWebAudioDsp.ts +1060 -0
  54. package/src/LibFaust.ts +57 -0
  55. package/src/WavDecoder.ts +207 -0
  56. package/src/WavEncoder.ts +204 -0
  57. package/src/copyWebStandaloneAssets.d.ts +3 -0
  58. package/src/copyWebStandaloneAssets.js +20 -0
  59. package/src/exports-bundle.ts +5 -0
  60. package/src/exports.ts +24 -0
  61. package/src/faust2svgFiles.d.ts +3 -0
  62. package/src/faust2svgFiles.js +43 -0
  63. package/src/faust2wasmFiles.d.ts +5 -0
  64. package/src/faust2wasmFiles.js +93 -0
  65. package/src/faust2wavFiles.d.ts +3 -0
  66. package/src/faust2wavFiles.js +58 -0
  67. package/src/index-bundle-iife.ts +7 -0
  68. package/src/index-bundle.ts +5 -0
  69. package/src/index.ts +5 -0
  70. package/src/instantiateFaustModule.ts +32 -0
  71. package/src/instantiateFaustModuleFromFile.ts +57 -0
  72. package/src/types.ts +234 -0
  73. package/test/clarinet.dsp +1 -0
  74. package/test/faustlive-wasm/faust-ui/index.css +414 -0
  75. package/test/faustlive-wasm/faust-ui/index.css.map +1 -0
  76. package/test/faustlive-wasm/faust-ui/index.d.ts +1 -0
  77. package/test/faustlive-wasm/faust-ui/index.js +3478 -0
  78. package/test/faustlive-wasm/faust-ui/index.js.map +1 -0
  79. package/test/faustlive-wasm/faustwasm/index.d.ts +1252 -0
  80. package/test/faustlive-wasm/faustwasm/index.js +3772 -0
  81. package/test/faustlive-wasm/faustwasm/index.js.map +7 -0
  82. package/test/faustlive-wasm/index.css +97 -0
  83. package/test/faustlive-wasm/index.html +130 -0
  84. package/test/faustlive-wasm/index.js +638 -0
  85. package/test/guitar.dsp +1 -0
  86. package/test/guitar1.dsp +2 -0
  87. package/test/libfaust-in-worklet/index.html +13 -0
  88. package/test/libfaust-in-worklet/index.js +40 -0
  89. package/test/mono.dsp +8 -0
  90. package/test/node/test.js +17 -0
  91. package/test/noise.dsp +3 -0
  92. package/test/organ.dsp +5 -0
  93. package/test/organ1.dsp +6 -0
  94. package/test/osc.dsp +4 -0
  95. package/test/osc2.dsp +5 -0
  96. package/test/osc3.dsp +4 -0
  97. package/test/p-dj.dsp +4 -0
  98. package/test/poly.dsp +13 -0
  99. package/test/rev.dsp +2 -0
  100. package/test/t1.dsp +1 -0
  101. package/test/web/fft.html +87 -0
  102. package/test/web/fft1.html +88 -0
  103. package/test/web/fft2.html +114 -0
  104. package/test/web/fftw.js +1907 -0
  105. package/test/web/index.html +12 -0
  106. package/test/web/index.js +235 -0
  107. package/test/web/kissfft.js +904 -0
  108. package/test/web/mono.html +46 -0
  109. package/test/web/poly-key.html +62 -0
  110. package/test/web/poly.html +59 -0
  111. package/tsconfig.json +22 -0
@@ -0,0 +1,97 @@
1
+ * {
2
+ font-family: 'Roboto', sans-serif;
3
+ font-size: 14px;
4
+ font-weight: normal;
5
+ }
6
+
7
+ body {
8
+ margin-left: 10%;
9
+ margin-right: 10%;
10
+ background-color: #FFFFFF,
11
+ }
12
+
13
+ h1 {
14
+ font-family: 'Open Sans', sans-serif;
15
+ font-size: 30px;
16
+ font-weight: lighter;
17
+ }
18
+
19
+ h2 {
20
+ font-family: 'Open Sans', sans-serif;
21
+ font-size: 24px;
22
+ }
23
+
24
+ h3 {
25
+ font-family: 'Open Sans', sans-serif;
26
+ font-size: 16px;
27
+ font-weight: bold;
28
+ }
29
+
30
+ h4 {
31
+ font-family: 'Open Sans', sans-serif;
32
+ font-size: 14px;
33
+ font-weight: bold;
34
+ }
35
+
36
+ .config {
37
+ display: grid;
38
+ grid-template-columns: 1fr 1fr 1fr 1fr;
39
+ grid-gap: 8px;
40
+ }
41
+
42
+ .config-element {
43
+ border: none;
44
+ background-color: #9FA8EB;
45
+ padding: 10px;
46
+ }
47
+
48
+ .config-element p {
49
+ font-style: italic;
50
+ }
51
+
52
+ .config-element ul {
53
+ font-style: italic;
54
+ list-style-type: none;
55
+ }
56
+
57
+ .config-element li {
58
+ font-style: italic;
59
+ list-style-type: none;
60
+ }
61
+
62
+ .line2 {
63
+ display: grid;
64
+ grid-template-columns: 1fr 1fr;
65
+ }
66
+
67
+ /* WEBKIT */
68
+ text {
69
+ -webkit-touch-callout: none;
70
+ -webkit-user-select: none;
71
+ -khtml-user-select: none;
72
+ -moz-user-select: none;
73
+ -ms-user-select: none;
74
+ user-select: none;
75
+ }
76
+
77
+ #filedrag {
78
+ font-weight: bold;
79
+ text-align: center;
80
+ padding: 1em 0;
81
+ margin: 1em 0;
82
+ color: #8d97e8;
83
+ border: 4px dashed #8d97e8;
84
+ cursor: default;
85
+ font-size: 20px;
86
+ }
87
+
88
+ #filedrag.hover {
89
+ color: #FF7F00;
90
+ border-color: #FF7F00;
91
+ border-style: solid;
92
+ }
93
+
94
+ td {
95
+ text-align: center;
96
+ padding: 40px;
97
+ }
@@ -0,0 +1,130 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>FaustLive WASM</title>
8
+ <link rel="stylesheet" href="index.css">
9
+ <link rel="stylesheet" href="faust-ui/index.css">
10
+ </head>
11
+ <body>
12
+ <center>
13
+ <H1> Testing the embedded dynamic Faust compiler </H1>
14
+ </center>
15
+
16
+ <P> This page embeds the Faust compiler as a JavaScript library named libfaust.js (associated with the auxiliary
17
+ WebAssembly library), including its WebAssembly generating backend, and compiled using <a
18
+ href="http://kripken.github.io/emscripten-site/">Emscripten</a>.
19
+
20
+ <P> You can compile Faust .dsp files or URL by just dropping them on the drop zone. A WebAudio node will be created
21
+ and connected to audio inputs/outputs and controlled with the displayed HTML/SVG based GUI.
22
+ <P>Settings (buffer size, polyphonic mode and voices, audio rendering model, sample size and ftz mode) can be
23
+ changed dynamically
24
+ and the DSP will be recompiled on the fly.
25
+ <P>Clicking on the yellow cross on the top right allows to access to the GRAME online compiler, to generate
26
+ different targets (like for instance standalone applications, VST, Max/MSP plugins, iOS or JUCE ready
27
+ projects...).
28
+ <div class="config">
29
+
30
+ <div class="config-element">
31
+ <H3>Buffer size</H3>
32
+ <form method="POST" name="menu">
33
+ <select id="selectedBuffer" name="selectedBuffer" onchange="setBufferSize(this.form.selectedBuffer)">
34
+ <option value=128> 128 </option>
35
+ <option value=256> 256 </option>
36
+ <option value=512> 512 </option>
37
+ <option selected value=1024> 1024 </option>
38
+ <option value=2048> 2048 </option>
39
+ <option value=4096> 4096 </option>
40
+ <option value=8192> 8192 </option>
41
+ </select>
42
+ </form>
43
+ <p>You can change the buffer size (from 256 to 8192 frames in ScripProcessor mode, it will be fixed at 128
44
+ frames in AudioWorklet mode).</p>
45
+ </div>
46
+
47
+ <div class="config-element">
48
+ <H3>Polyphonic instrument</H3>
49
+ <div class="line2">
50
+ <form method="POST" name="menu">
51
+ <select id="selectedPoly" name="selectedPoly" onchange="setPoly(this.form.selectedPoly)">
52
+ <option value=ON> ON </option>
53
+ <option selected value=OFF> OFF </option>
54
+ </select>
55
+ </form>
56
+ <form method="POST" name="menu">
57
+ <select id="polyVoices" name="polyVoices" onchange="setPolyVoices(this.form.polyVoices)">
58
+ <option value=1> 1 </option>
59
+ <option value=2> 2 </option>
60
+ <option value=4> 4 </option>
61
+ <option value=8> 8 </option>
62
+ <option selected value=16> 16 </option>
63
+ <option value=32> 32 </option>
64
+ <option value=64> 64 </option>
65
+ <option value=128> 128 </option>
66
+ </select>
67
+ </form>
68
+ </div>
69
+ <p>Assuming your DSP code is <a
70
+ href="https://faustdoc.grame.fr/manual/midi/#midi-polyphony-support">polyphonic ready</a>, you
71
+ can activate the polyphonic mode, adjust the number of available voices, and test it with a MIDI device
72
+ or application (usable with Chrome which implements the <a
73
+ href="https://webaudio.github.io/web-midi-api/">Web MIDI API</a>).
74
+ </div>
75
+
76
+ <div class="config-element">
77
+ <H3>ScriptProcessor/AudioWorklet</H3>
78
+ <form method="POST" name="menu">
79
+ <select id="selectedRenderingMode" name="selectedRenderingMode"
80
+ onchange="setRenderingMode(this.form.selectedRenderingMode)">
81
+ <option selected value=ScriptProcessor> ScriptProcessor </option>
82
+ <option value=AudioWorklet> AudioWorklet </option>
83
+ </select>
84
+ </form>
85
+ <p>ScriptProcessor: audio rendering is done using the old ScriptProcessor model.</p>
86
+ <p>AudioWorklet: audio rendering is done using the new AudioWorklet model.
87
+ <p>
88
+ </div>
89
+
90
+ <div class="config-element">
91
+ <H3>Sample format</H3>
92
+ <form method="POST" name="menu">
93
+ <select id="selectedSampleFormat" name="selectedSampleFormat"
94
+ onchange="setSampleFormat(this.form.selectedSampleFormat)">
95
+ <option selected value=float> float </option>
96
+ <option value=double> double </option>
97
+ </select>
98
+ </form>
99
+ <H3>Float denormals handling</H3>
100
+ <form method="POST" name="menu">
101
+ <select id="selectedFTZ" name="selectedFTZ" onchange="setFTZ(this.form.selectedFTZ)">
102
+ <option value=0> 0 </option>
103
+ <option value=1> 1 </option>
104
+ <option selected value=2> 2 </option>
105
+ </select>
106
+ </form>
107
+ <p>0: means no denormal handling.</p>
108
+ <p>1: uses <B>fabs</B> and a <B>threshold</B> to detect denormal values (slower).
109
+ <p>
110
+ <p>2: uses a <B>bitmask</B> to detect denormal values (faster).</p>
111
+ </div>
112
+
113
+ </div>
114
+
115
+ <p> <input id="localstorage" type="checkbox" onclick="setLocalStorage(checked)"> <B>Save page and DSP control
116
+ parameters state</B> </p>
117
+
118
+ <div id="filedrag">
119
+ Loading JavaScript/WebAssembly ressources...
120
+ </div>
121
+
122
+ <form id="upload" action="CompilerResponse" method="POST" enctype="multipart/form-data">
123
+ <input type="hidden" id="MAX_FILE_SIZE" name="MAX_FILE_SIZE" value="5000000" />
124
+ </form>
125
+
126
+ <div id="faust-ui"></div>
127
+
128
+ <script src="index.js"></script>
129
+ </body>
130
+ </html>