Skip to content

Commit

Permalink
fix problem with uninitialized beatfactor in oscillator blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
walterbender committed Oct 15, 2015
1 parent e50aac7 commit 328bc6d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/logo.js
Original file line number Diff line number Diff line change
Expand Up @@ -1840,7 +1840,7 @@ function Logo(matrix, musicnotation, canvas, blocks, turtles, stage,
var duration = noteBeatValue; // microseconds
logo.doWait(turtle, ((duration + logo.noteDelay) / 1000) * logo.duplicateFactor[turtle]);
} else {
var duration = noteBeatValue * logo.noteBeatValues[turtle][0];
var duration = noteBeatValue * logo.beatFactor[turtle]; // beat value
logo.doWait(turtle, ((logo.bpmFactor / duration) + (logo.noteDelay / 1000)) * logo.duplicateFactor[turtle]);
}
var waitTime = 0;
Expand Down Expand Up @@ -1877,8 +1877,10 @@ function Logo(matrix, musicnotation, canvas, blocks, turtles, stage,
}
if (logo.blocks.blockList[blk].name == 'osctime') {
var stopTime = duration;
console.log('stopTime: ' + stopTime);
} else {
var stopTime = logo.bpmFactor * 1000 / duration;
console.log('stopTime: ' + stopTime);
}
setTimeout(function(){
for (var i = 0; i < oscillators.length; i++) {
Expand Down

0 comments on commit 328bc6d

Please sign in to comment.