@grame/faust-web-component 0.3.5 → 0.3.7

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/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.5",
4
+ "version": "0.3.7",
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.1",
46
- "@shren/faust-ui": "^1.1.11",
45
+ "@grame/faustwasm": "^0.5.2",
46
+ "@shren/faust-ui": "^1.1.12",
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