diff --git a/src/bongocat.js b/src/bongocat.js index 6860b08..70949fe 100644 --- a/src/bongocat.js +++ b/src/bongocat.js @@ -259,7 +259,7 @@ function setPaw(paw, cBpm) { var currentPaw = document.getElementById(paw); currentPaw.style.backgroundPosition = "top right"; - window.setTimeout(releasePaw, cBpm / 2, paw); + window.setTimeout(releasePaw, 1000 * (60 / cBpm / 2), paw); } function releasePaw(paw) diff --git a/src/experimental/bongox.js b/src/experimental/bongox.js index cf341a1..ae5095e 100644 --- a/src/experimental/bongox.js +++ b/src/experimental/bongox.js @@ -242,7 +242,7 @@ function rtttl(song) { let paws = ["paw-left", "paw-right"] let rnd = Math.floor(Math.random() * 2) - playbacks.push(preparePlaybackObject(setPaw, time*1000, paws[rnd], bpm)) + playbacks.push(preparePlaybackObject(setPaw, time*1000, paws[rnd], bpm * (noteDuration / 4))) //playSynthSound(noteFrequency, time) playbacks.push(preparePlaybackObject(playSynthSound, 0, noteFrequency, time)); time += noteLength / 10 * 8