]> git.0d.be Git - nanofun.git/commitdiff
align rows of pads with rows of pots and sliders
authorFrédéric Péters <fpeters@0d.be>
Tue, 21 Feb 2017 10:18:03 +0000 (11:18 +0100)
committerFrédéric Péters <fpeters@0d.be>
Tue, 21 Feb 2017 10:18:03 +0000 (11:18 +0100)
nanofun.js

index bb571a9350cb559b3fbfa8080e82b607a3f56552..627a47b7fcf97521bfd80f7fede7cac600e9647c 100644 (file)
@@ -348,7 +348,11 @@ var nanofun = function() {
     midi.onControlChange = function(port, data, control, value) {
       if (control > 7 && control < 16) return; /* range between sliders and pots */
       if (control > 23) return; /* after pots */
-      if (control >= 16) { control -= 8; }
+      if (control < 8) {
+        control += 8; /* sliders, control bottom pads (8-15) */
+      } else {
+        control -= 16; /* pots, control top pads (0-7) */
+      }
       $('[data-touch=' + control + '] .touch-gain').val(value).trigger('change');
     }