From 30ea017682f7ea2fc0312d177198966cd8b6aff0 Mon Sep 17 00:00:00 2001 From: jxzhe Date: Fri, 31 Mar 2023 21:26:58 +0800 Subject: [PATCH 1/2] Make the slider change value before mouse release --- globals.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/globals.js b/globals.js index 6ef1827..f6dff75 100644 --- a/globals.js +++ b/globals.js @@ -58,7 +58,7 @@ WebMidi.enable(function (err) { //check if WebMidi.js is enabled } midiSelectSlider = select("#slider"); midiSelectSlider.attribute("max", WebMidi.inputs.length - 1); - midiSelectSlider.changed(inputChanged); + midiSelectSlider.input(inputChanged); midiIn = WebMidi.inputs[midiSelectSlider.value()] inputChanged(); }); From 885b03df6b19c456ce6fe7963abd4069262d59eb Mon Sep 17 00:00:00 2001 From: jxzhe Date: Fri, 31 Mar 2023 21:33:59 +0800 Subject: [PATCH 2/2] Release all notes & pedals before slider change --- globals.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/globals.js b/globals.js index f6dff75..3eef67f 100644 --- a/globals.js +++ b/globals.js @@ -64,6 +64,10 @@ WebMidi.enable(function (err) { //check if WebMidi.js is enabled }); function inputChanged() { + isKeyOn.fill(0); + controllerChange(64, 0); + controllerChange(67, 0); + midiIn.removeListener(); midiIn = WebMidi.inputs[midiSelectSlider.value()]; midiIn.addListener('noteon', "all", function (e) {