@grame/faust-web-component 0.3.6 → 0.3.8

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/index.html CHANGED
@@ -1,68 +1,36 @@
1
- <!doctype html>
1
+ <!DOCTYPE html>
2
2
  <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Vite + TS</title>
8
- <script type="module" src="/src/main.ts"></script>
9
- <style>
10
- #content {
11
- width: 50%;
12
- margin: auto;
13
- }
14
- </style>
15
- </head>
16
- <body>
17
- <div id="content">
18
- <p>Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
19
- <faust-editor>
20
- import("stdfaust.lib");
21
- process = no.noise;
22
- </faust-editor>
23
- <p>Nostrum, id deserunt inventore ut veritatis iusto autem soluta officia debitis omnis, dolor sint cum, illo quam dignissimos fuga quod optio nesciunt.</p>
24
- <!-- Need to comment below example due to occurrence of `<`. -->
25
- <faust-editor>
26
- <!--
27
- import("stdfaust.lib");
28
- ctFreq = 500;
29
- q = 5;
30
- gain = 1;
31
- process = no.noise : _ <: fi.resonlp(ctFreq,q,gain),fi.resonlp(ctFreq,q,gain);
32
- -->
33
- </faust-editor>
34
- <p>Ex velit voluptates, laudantium laboriosam est quis veniam temporibus tempore minima aspernatur, modi labore molestiae provident adipisci voluptatem dolorem voluptatibus asperiores possimus.</p>
35
- <faust-editor>
36
- <!--
3
+
4
+ <body>
5
+ <center>
6
+ <H1>Here's an embedded editor!</H1>
7
+ </center>
8
+
9
+ <faust-editor>
10
+ <!--
37
11
  import("stdfaust.lib");
38
12
  ctFreq = hslider("cutoffFrequency",500,50,10000,0.01);
39
13
  q = hslider("q",5,1,30,0.1);
40
14
  gain = hslider("gain",1,0,1,0.01);
41
15
  process = no.noise : fi.resonlp(ctFreq,q,gain);
42
16
  -->
43
- </faust-editor>
44
- <p>Nam tempora officiis sunt nisi cupiditate expedita magnam atque. Unde, itaque.</p>
45
- <faust-editor>
46
- <!--
47
- import("stdfaust.lib");
48
- process =
49
- dm.cubicnl_demo : // distortion
50
- dm.wah4_demo <: // wah pedal
51
- dm.phaser2_demo : // stereo phaser
52
- dm.compressor_demo : // stereo compressor
53
- dm.zita_light; // stereo reverb
54
- -->
55
- </faust-editor>
56
- <p>Minus, ducimus consequuntur? Corrupti animi aut magni nihil, dolor eos tenetur, autem deserunt et iure culpa, suscipit minus quia velit laudantium asperiores.</p>
57
- <faust-widget>
58
- <!--
17
+ </faust-editor>
18
+ <center>
19
+ <H1>Here's a simple DSP widget!</H1>
20
+
21
+ <faust-widget>
22
+ <!--
59
23
  import("stdfaust.lib");
60
- ctFreq = hslider("cutoffFrequency",500,50,10000,0.01);
61
- q = hslider("q",5,1,30,0.1);
62
- gain = hslider("gain",1,0,1,0.01);
63
- process = no.noise : fi.resonlp(ctFreq,q,gain);
24
+ ctFreq = hslider("[0]cutoffFrequency",500,50,10000,0.01) : si.smoo;
25
+ q = hslider("[1]q",5,1,30,0.1) : si.smoo;
26
+ gain = hslider("[2]gain",1,0,1,0.01) : si.smoo;
27
+ t = button("[3]gate") : si.smoo;
28
+ process = no.noise : fi.resonlp(ctFreq,q,gain)*t <: dm.zita_light;
64
29
  -->
65
- </faust-widget>
66
- </div>
67
- </body>
68
- </html>
30
+ </faust-widget>
31
+ </center>
32
+ <script src="faust-web-component.js"></script>
33
+
34
+ </body>
35
+
36
+ </html>
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.3.6",
4
+ "version": "0.3.8",
5
5
  "module": "dist/faust-web-component.js",
6
6
  "files": [
7
7
  "src/",
@@ -42,8 +42,8 @@
42
42
  "@codemirror/legacy-modes": "^6.3.3",
43
43
  "@fortawesome/fontawesome-svg-core": "^6.4.2",
44
44
  "@fortawesome/free-solid-svg-icons": "^6.4.2",
45
- "@grame/faustwasm": "^0.4.5",
46
- "@shren/faust-ui": "^1.1.12",
45
+ "@grame/faustwasm": "^0.5.4",
46
+ "@shren/faust-ui": "^1.1.13",
47
47
  "codemirror": "^6.0.1",
48
48
  "split.js": "^1.6.5"
49
49
  }
package/src/common.ts CHANGED
@@ -79,19 +79,7 @@ export async function accessMIDIDevice(
79
79
 
80
80
  // Set up MIDI input callback
81
81
  export const midiInputCallback = (node: IFaustMonoWebAudioNode | IFaustPolyWebAudioNode) => {
82
- return (data) => {
83
-
84
- const cmd = data[0] >> 4;
85
- const channel = data[0] & 0xf;
86
- const data1 = data[1];
87
- const data2 = data[2];
88
-
89
- if (channel === 9) return;
90
- else if (cmd === 8 || (cmd === 9 && data2 === 0)) node.keyOff(channel, data1, data2);
91
- else if (cmd === 9) node.keyOn(channel, data1, data2);
92
- else if (cmd === 11) node.ctrlChange(channel, data1, data2);
93
- else if (cmd === 14) node.pitchWheel(channel, (data2 * 128.0 + data1));
94
- }
82
+ return (data) => { node.midiMessage(data); }
95
83
  }
96
84
 
97
85
  // Analyze the metadata of a Faust JSON file extract the [midi:on] and [nvoices:n] options