From 2761ba1231686407af2e11786e29e84c69b0183f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 25 Apr 2017 13:12:22 -0400 Subject: freq --- client/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'client/index.js') diff --git a/client/index.js b/client/index.js index 728fd60..0a0eed1 100644 --- a/client/index.js +++ b/client/index.js @@ -25,6 +25,7 @@ function add (x, y) { const i = x + 1 const j = y + 1 const div = document.createElement('div') + const freq = root * i/j let add = 0 let frac = Math.log2(i/j) % 1 div.style.left = (x * s) + 'px' @@ -49,14 +50,14 @@ function add (x, y) { div.addEventListener('mouseenter', function(){ div.style.backgroundColor = color(frac, add + add_on, mul_on) if (dragging) { - kalimba.play( root * i/j ) + kalimba.play( freq ) } }) div.addEventListener('mouseleave', function(){ div.style.backgroundColor = color(frac, add + add_off, mul_off) }) div.addEventListener('click', function(){ - kalimba.play( root * i/j ) + kalimba.play( freq ) }) document.body.appendChild(div) } -- cgit v1.2.3-70-g09d2