@grame/faustwasm 0.5.5 → 0.6.1
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 -0
- package/assets/standalone/faustwasm/index.js +24 -11
- package/assets/standalone/faustwasm/index.js.map +2 -2
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +24 -11
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs-bundle/index.d.ts +2 -0
- package/dist/cjs-bundle/index.js +26 -13
- package/dist/cjs-bundle/index.js.map +2 -2
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +24 -11
- package/dist/esm/index.js.map +2 -2
- package/dist/esm-bundle/index.d.ts +2 -0
- package/dist/esm-bundle/index.js +26 -13
- package/dist/esm-bundle/index.js.map +2 -2
- package/libfaust-wasm/libfaust-wasm.js +1 -1
- package/libfaust-wasm/libfaust-wasm.wasm +0 -0
- package/package.json +1 -1
- package/src/FaustWebAudioDsp.ts +31 -13
- package/test/faustlive-wasm/faustwasm/index.d.ts +2 -0
- package/test/faustlive-wasm/faustwasm/index.js +24 -11
- package/test/faustlive-wasm/faustwasm/index.js.map +2 -2
- package/test/midi.dsp +2 -2
- package/foo.cpp +0 -3312
package/dist/cjs/index.d.ts
CHANGED
|
@@ -699,11 +699,13 @@ export declare class FaustBaseWebAudioDsp implements IFaustBaseWebAudioDsp {
|
|
|
699
699
|
protected fSampleSize: number;
|
|
700
700
|
protected fPitchwheelLabel: {
|
|
701
701
|
path: string;
|
|
702
|
+
chan: number;
|
|
702
703
|
min: number;
|
|
703
704
|
max: number;
|
|
704
705
|
}[];
|
|
705
706
|
protected fCtrlLabel: {
|
|
706
707
|
path: string;
|
|
708
|
+
chan: number;
|
|
707
709
|
min: number;
|
|
708
710
|
max: number;
|
|
709
711
|
}[][];
|
package/dist/cjs/index.js
CHANGED
|
@@ -2120,11 +2120,19 @@ export default ${(_b = jsCode.match(jsCodeHead)) == null ? void 0 : _b[1]};
|
|
|
2120
2120
|
if (midi) {
|
|
2121
2121
|
const strMidi = midi.trim();
|
|
2122
2122
|
if (strMidi === "pitchwheel") {
|
|
2123
|
-
|
|
2124
|
-
} else {
|
|
2125
|
-
const matched = strMidi.match(/^ctrl\s(\d+)/);
|
|
2123
|
+
const matched = strMidi.match(/^pitchwheel\s(\d+)/);
|
|
2126
2124
|
if (matched) {
|
|
2127
|
-
this.
|
|
2125
|
+
this.fPitchwheelLabel.push({ path: item.address, chan: parseInt(matched[1]), min: item.min, max: item.max });
|
|
2126
|
+
} else {
|
|
2127
|
+
this.fPitchwheelLabel.push({ path: item.address, chan: 0, min: item.min, max: item.max });
|
|
2128
|
+
}
|
|
2129
|
+
} else {
|
|
2130
|
+
const matched2 = strMidi.match(/^ctrl\s(\d+)\s(\d+)/);
|
|
2131
|
+
const matched1 = strMidi.match(/^ctrl\s(\d+)/);
|
|
2132
|
+
if (matched2) {
|
|
2133
|
+
this.fCtrlLabel[parseInt(matched2[1])].push({ path: item.address, chan: parseInt(matched2[2]), min: item.min, max: item.max });
|
|
2134
|
+
} else if (matched1) {
|
|
2135
|
+
this.fCtrlLabel[parseInt(matched1[1])].push({ path: item.address, chan: 0, min: item.min, max: item.max });
|
|
2128
2136
|
}
|
|
2129
2137
|
}
|
|
2130
2138
|
}
|
|
@@ -2392,10 +2400,12 @@ export default ${(_b = jsCode.match(jsCodeHead)) == null ? void 0 : _b[1]};
|
|
|
2392
2400
|
this.fCachedEvents.push({ type: "ctrlChange", data: [channel, ctrl, value] });
|
|
2393
2401
|
if (this.fCtrlLabel[ctrl].length) {
|
|
2394
2402
|
this.fCtrlLabel[ctrl].forEach((ctrl2) => {
|
|
2395
|
-
const { path } = ctrl2;
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
this.fOutputHandler
|
|
2403
|
+
const { path, chan } = ctrl2;
|
|
2404
|
+
if (chan === 0 || channel === chan - 1) {
|
|
2405
|
+
this.setParamValue(path, _FaustBaseWebAudioDsp.remap(value, 0, 127, ctrl2.min, ctrl2.max));
|
|
2406
|
+
if (this.fOutputHandler)
|
|
2407
|
+
this.fOutputHandler(path, this.getParamValue(path));
|
|
2408
|
+
}
|
|
2399
2409
|
});
|
|
2400
2410
|
}
|
|
2401
2411
|
}
|
|
@@ -2403,9 +2413,12 @@ export default ${(_b = jsCode.match(jsCodeHead)) == null ? void 0 : _b[1]};
|
|
|
2403
2413
|
if (this.fPlotHandler)
|
|
2404
2414
|
this.fCachedEvents.push({ type: "pitchWheel", data: [channel, wheel] });
|
|
2405
2415
|
this.fPitchwheelLabel.forEach((pw) => {
|
|
2406
|
-
|
|
2407
|
-
if (
|
|
2408
|
-
this.
|
|
2416
|
+
const { path, chan } = pw;
|
|
2417
|
+
if (chan === 0 || channel === chan - 1) {
|
|
2418
|
+
this.setParamValue(path, _FaustBaseWebAudioDsp.remap(wheel, 0, 16383, pw.min, pw.max));
|
|
2419
|
+
if (this.fOutputHandler)
|
|
2420
|
+
this.fOutputHandler(path, this.getParamValue(path));
|
|
2421
|
+
}
|
|
2409
2422
|
});
|
|
2410
2423
|
}
|
|
2411
2424
|
setParamValue(path, value) {
|