fix beatsToSec function (was getting millis)

This commit is contained in:
Eric Rosenbaum 2017-01-10 10:59:55 -05:00
parent 6948968a85
commit 03d78a203b

View file

@ -128,10 +128,14 @@ AudioPlayer.prototype.waitForBeats = function (beats) {
return new Promise(function (resolve) {
setTimeout(function () {
resolve();
}, ((60 / storedContext.audioEngine.currentTempo) * 1000 * beats));
}, storedContext.beatsToSec(beats) * 1000);
});
};
AudioPlayer.prototype.beatsToSec = function (beats) {
return (60 / this.audioEngine.currentTempo) * beats;
};
AudioPlayer.prototype.stopAllSounds = function () {
// stop drum notes
// for (var i = 0; i<this.drumSamplers.length; i++) {