@grame/faust-web-component 0.2.3 → 0.2.4
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/README.md +30 -9
- package/dist/index.html +26 -0
- package/package.json +1 -1
package/README.md
CHANGED
@@ -9,6 +9,17 @@ This component is ideal for demonstrating some code in Faust and allowing the re
|
|
9
9
|
|
10
10
|
These components are built on top of [faustwasm](https://github.com/grame-cncm/faustwasm) and [faust-ui](https://github.com/Fr0stbyteR/faust-ui) packages.
|
11
11
|
|
12
|
+
## Build Instructions
|
13
|
+
|
14
|
+
Clone this repository, then run:
|
15
|
+
|
16
|
+
```shell
|
17
|
+
npm install
|
18
|
+
npm run build
|
19
|
+
```
|
20
|
+
|
21
|
+
This will generate `dist/faust-web-component.js`, which you can use with a `<script>` tag.
|
22
|
+
|
12
23
|
## Example Usage
|
13
24
|
|
14
25
|
```html
|
@@ -40,18 +51,29 @@ process = no.noise : fi.resonlp(ctFreq,q,gain)*t <: dm.zita_light;
|
|
40
51
|
<script src="faust-web-component.js"></script>
|
41
52
|
```
|
42
53
|
|
43
|
-
|
54
|
+
## NPM package
|
44
55
|
|
45
|
-
|
56
|
+
A [npm package](https://www.npmjs.com/package/@grame/faust-web-component) can be used with the CDN link: https://cdn.jsdelivr.net/npm/@grame/faust-web-component@0.2.3/dist/faust-web-component.js (possibly update the version number).
|
57
|
+
|
58
|
+
Here is an HTML example using this model:
|
59
|
+
|
60
|
+
```html
|
61
|
+
<p><em>Here's an embedded editor!</em></p>
|
46
62
|
|
47
|
-
|
63
|
+
<faust-editor>
|
64
|
+
<!--
|
65
|
+
import("stdfaust.lib");
|
48
66
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
67
|
+
vol = hslider("volume [unit:dB]", -10, -96, 0, 0.1) : ba.db2linear : si.smoo;
|
68
|
+
freq1 = hslider("freq1 [unit:Hz]", 1000, 20, 3000, 1);
|
69
|
+
freq2 = hslider("freq2 [unit:Hz]", 200, 20, 3000, 1);
|
70
|
+
|
71
|
+
process = vgroup("Oscillator", os.osc(freq1) * vol, os.osc(freq2) * vol);
|
72
|
+
-->
|
73
|
+
</faust-editor>
|
53
74
|
|
54
|
-
|
75
|
+
<script src="https://cdn.jsdelivr.net/npm/@grame/faust-web-component@0.2.3/dist/faust-web-component.js"></script>
|
76
|
+
```
|
55
77
|
|
56
78
|
## Demo
|
57
79
|
|
@@ -63,4 +85,3 @@ Several steps needs to be done before official release:
|
|
63
85
|
|
64
86
|
- audio input via file (including some stock signals)
|
65
87
|
- greater configurability via HTML attributes
|
66
|
-
- package publication on npm
|
package/dist/index.html
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
<p><em>Here's an embedded editor!</em></p>
|
2
|
+
|
3
|
+
<faust-editor>
|
4
|
+
<!--
|
5
|
+
import("stdfaust.lib");
|
6
|
+
ctFreq = hslider("cutoffFrequency",500,50,10000,0.01);
|
7
|
+
q = hslider("q",5,1,30,0.1);
|
8
|
+
gain = hslider("gain",1,0,1,0.01);
|
9
|
+
process = no.noise : fi.resonlp(ctFreq,q,gain);
|
10
|
+
-->
|
11
|
+
</faust-editor>
|
12
|
+
|
13
|
+
<p><em>And here's a simple DSP widget!</em></p>
|
14
|
+
|
15
|
+
<faust-widget>
|
16
|
+
<!--
|
17
|
+
import("stdfaust.lib");
|
18
|
+
|
19
|
+
declare options "[midi:on][nvoices:12]";
|
20
|
+
|
21
|
+
process = pm.clarinet_ui_MIDI <: _,_;
|
22
|
+
-->
|
23
|
+
</faust-widget>
|
24
|
+
|
25
|
+
<script src="https://cdn.jsdelivr.net/npm/@grame/faust-web-component@0.2.3/dist/faust-web-component.js"></script>
|
26
|
+
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@grame/faust-web-component",
|
3
3
|
"description": "Web component embedding the Faust Compiler",
|
4
|
-
"version": "0.2.
|
4
|
+
"version": "0.2.4",
|
5
5
|
"module": "dist/faust-web-component.js",
|
6
6
|
"files": ["src/", "public/", "index.html", "tsconfig.json", "vite.config.js", "dist/faust-web-component.js"],
|
7
7
|
"type": "module",
|