Skip to content

Commit

Permalink
useMeterBPM
Browse files Browse the repository at this point in the history
  • Loading branch information
sksum committed Jun 28, 2020
1 parent 81d1d95 commit abdc6be
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/blocks/MeterBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,12 +643,18 @@ function setupMeterBlocks() {
logo.parameterQueue[turtle] = [];
logo.initTurtle(turtle);
logo._setListener(turtle, eventName, __listener);
let duration ;
if (logo.bpm[orgTurtle].length > 0) {
duration = 60 / last(logo.bpm[orgTurtle]);
} else {
duration = 60 / logo._masterBPM;
}
if (logo.turtles.turtleList[turtle].interval !== undefined)clearInterval(this.interval);
logo.turtles.turtleList[turtle].interval = setInterval(
() => {
logo.stage.dispatchEvent(eventName);
}
,666);
,duration*1000);
console.debug("set listener",eventName);
}
}
Expand Down

0 comments on commit abdc6be

Please sign in to comment.