diff options
Diffstat (limited to 'bundle.js')
| -rw-r--r-- | bundle.js | 35 |
1 files changed, 27 insertions, 8 deletions
@@ -38107,6 +38107,9 @@ exports.default = { load: load, play: play, pause: pause, stop: stop }; // for help tuning function keydown(e) { + if (document.activeElement !== document.body) { + return; + } // console.log(e.keyCode) if (e.metaKey && last && current) { var sample = samples[current]; @@ -39198,6 +39201,9 @@ function bind() { var isReset = false; function keydown(e) { + if (document.activeElement !== document.body) { + return; + } var step = 1; if (e.shiftKey) { step += 4; @@ -39320,6 +39326,12 @@ function bindRoot() { "mul-2": function mul2() { return setRoot(root * 2); }, + "div-3-2": function div32() { + return setRoot(root * 2 / 3); + }, + "mul-3-2": function mul32() { + return setRoot(root * 3 / 2); + }, "sub-10": function sub10() { return setRoot(root - 10); }, @@ -39331,7 +39343,16 @@ function bindRoot() { }, "add-10": function add10() { return setRoot(root + 10); - }, + } + }).forEach(function (_ref, index) { + var _ref2 = _slicedToArray(_ref, 2), + key = _ref2[0], + fn = _ref2[1]; + + var el = document.querySelector(".root-select ." + key); + el.addEventListener("click", fn); + }); + Object.entries({ "note-c": function noteC() { return setRoot(440 * Math.pow(2, -9 / 12) * getOctave(root)); }, @@ -39371,16 +39392,14 @@ function bindRoot() { "note-c2": function noteC2() { return setRoot(440 * Math.pow(2, 3 / 12) * getOctave(root)); } - }).forEach(function (_ref, index) { - var _ref2 = _slicedToArray(_ref, 2), - key = _ref2[0], - fn = _ref2[1]; + }).forEach(function (_ref3, index) { + var _ref4 = _slicedToArray(_ref3, 2), + key = _ref4[0], + fn = _ref4[1]; var el = document.querySelector(".root-select ." + key); el.addEventListener("click", fn); - if (key.startsWith("note")) { - el.style.background = (0, _color2.default)(Math.pow(2, (index - 7) / 12), 0, 1.6); - } + el.style.background = (0, _color2.default)(Math.pow(2, index / 12), 0, 1.6); }); } |
