diff --git a/app.js b/app.js index a72dc9ebe59fcff030819577734883faf1564c9a..1710eb68b1db4d5c9f94bf58aa76cea2a169e061 100644 --- a/app.js +++ b/app.js @@ -7,10 +7,12 @@ var port = (process.env.PORT || 5000); var bpm = 120; var stepPos = 0; +var noteSpeedVal = 4; // quarternote + var metronome = null; metronome = setInterval(function(){ io.sockets.emit('metronome', getStepPos()); - }, (60000 / bpm)/4); + }, (60000 / bpm)/noteSpeedVal); http.listen(port, function() { @@ -55,7 +57,7 @@ function generateMetronome(newBpm, oldMetronome){ return setInterval(function(){ io.sockets.emit('metronome', getStepPos()); - }, (60000 / newBpm)/4); + }, (60000 / newBpm)/noteSpeedVal); } diff --git a/public/client.js b/public/client.js index af36f35c60b44acd9832c0fb4cf048afe0851cf6..94b68cce9d126e6f92afc99146fdda97980e5a1b 100644 --- a/public/client.js +++ b/public/client.js @@ -18,6 +18,7 @@ $(function(){ // metronome iosocket.on('metronome', function(serverStepPos){ + console.log('tick'); stepPos = serverStepPos; advanceStep(stepPos); playExternalSound();