]> git.0d.be Git - nanofun.git/blobdiff - nanofun.js
display keyboard shortcut
[nanofun.git] / nanofun.js
index 7437981bbc6421d77f4ed1259608eb364893ff17..5deb9c4eba92a4a24a1677b5314e6adeb8ba4ec4 100644 (file)
@@ -342,6 +342,7 @@ var nanofun = function() {
     for (var i=0; i<NANOPAD_TOUCHS.length; i++) {
       var $new_touch = $nanotouch.clone();
       $new_touch.attr('data-touch', i);
+      $new_touch.find('.key').text(KEYBOARD_CODES[i]);
       $new_touch.appendTo($nanopad);
     }
     $nanotouch.remove(); /* remove template */
@@ -513,7 +514,11 @@ var nanofun = function() {
       var fraction = parseInt(this.value) / parseInt(127);
       var touchIdx = parseInt($(this).parent().data('touch'));
       var now = self.audioCtx.currentTime;
-      self.touchGainNodes[touchIdx].gain.exponentialRampToValueAtTime((fraction * fraction) || 0.0001, now + 0.015);
+      if (fraction == 0) {
+        self.touchGainNodes[touchIdx].gain.value = 0;
+      } else {
+        self.touchGainNodes[touchIdx].gain.exponentialRampToValueAtTime((fraction * fraction) || 0.0001, now + 0.015);
+      }
     });
 
     self.time_interval_id = setInterval(function() {