Skip to content

Commit

Permalink
feat: Paw stays depending on note length
Browse files Browse the repository at this point in the history
  • Loading branch information
awsdcrafting committed Feb 2, 2024
1 parent 5196264 commit 383b787
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bongocat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/experimental/bongox.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 383b787

Please sign in to comment.