From: Frédéric Péters Date: Tue, 21 Feb 2017 10:18:03 +0000 (+0100) Subject: align rows of pads with rows of pots and sliders X-Git-Url: https://git.0d.be/?p=nanofun.git;a=commitdiff_plain;h=5ac772fed652a2ebdddacc1f7397f9710d1f0167 align rows of pads with rows of pots and sliders --- diff --git a/nanofun.js b/nanofun.js index bb571a9..627a47b 100644 --- a/nanofun.js +++ b/nanofun.js @@ -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'); }