From 58f26c6b8c49f608f077a1eb71e99849bab3309a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 23 Nov 2017 17:52:24 +0100 Subject: [PATCH] add individual checkboxes for effects --- index.html | 5 ++++- nanofun.css | 20 ++++++++++++++++++++ nanofun.js | 28 ++++++++++++++++++++-------- 3 files changed, 44 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 91e5690..1854c66 100644 --- a/index.html +++ b/index.html @@ -14,6 +14,7 @@
+

@@ -24,10 +25,12 @@
-
+
+ Effects
+
diff --git a/nanofun.css b/nanofun.css index 846a388..7422765 100644 --- a/nanofun.css +++ b/nanofun.css @@ -59,6 +59,13 @@ div.nanotouch input[type=range] { margin: 0; } +div.nanotouch .effects { + position: absolute; + left: 0; + bottom: 5ex; + z-index: 10000; +} + div.nanotouch .loop { position: absolute; left: 0; @@ -106,3 +113,16 @@ form label { #devices div.on { background: #6aff6a; } + +form fieldset { + padding: 0; + border: 0; + margin: 0; + margin-top: 1em; +} + +form fieldset legend { + font-weight: bold; + margin: 0; + padding-left: 0; +} diff --git a/nanofun.js b/nanofun.js index 014ebb0..bde7c13 100644 --- a/nanofun.js +++ b/nanofun.js @@ -295,13 +295,14 @@ var nanofun = function() { var self = this; self.initAudio = function() { - self.sample_buffers = Array(16); - self.samples = Array(16); - self.sample_start_times = Array(16); + self.sample_buffers = Array(NANOPAD_TOUCHS.length); + self.samples = Array(NANOPAD_TOUCHS.length); + self.sample_start_times = Array(NANOPAD_TOUCHS.length); self.audioCtx = new window.AudioContext(); - self.touchGainNodes = Array(16); + self.touchGainNodes = Array(NANOPAD_TOUCHS.length); self.masterGainNode = self.audioCtx.createGain(); - for (var i=0; i<16; i++) { + self.effectsGainNode = self.audioCtx.createGain(); + for (var i=0; i